docs: 更新流程图,补充分割/后处理/统计/可视化步骤
This commit is contained in:
+106
-129
@@ -1,130 +1,107 @@
|
||||
<mxfile host="65bd71144e">
|
||||
<diagram name="简化版网格划分算法流程" id="flowchart">
|
||||
<mxGraphModel dx="888" dy="899" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1200" pageHeight="1600" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0"/>
|
||||
<mxCell id="1" parent="0"/>
|
||||
<mxCell id="title" value="cDNA微阵列网格划分 —— 简化版算法流程图" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=20;fontStyle=1;fontColor=#1565C0" parent="1" vertex="1">
|
||||
<mxGeometry x="300" y="30" width="600" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="s1" value="1. 读取图像" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#C8E6C9;strokeColor=#2E7D32;strokeWidth=2;fontSize=14;fontStyle=1;align=center;verticalAlign=middle" parent="1" vertex="1">
|
||||
<mxGeometry x="480" y="100" width="240" height="50" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="s2" value="2. 转为灰度图
color.rgb2gray(img)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#C8E6C9;strokeColor=#2E7D32;strokeWidth=2;fontSize=14;fontStyle=1;align=center;verticalAlign=middle" parent="1" vertex="1">
|
||||
<mxGeometry x="480" y="190" width="240" height="55" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="s3L" value="3. 纵轴投影
np.sum(gray, axis=0)
每一列灰度值求和" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#E8EAF6;strokeColor=#3949AB;strokeWidth=2;fontSize=13;align=center;verticalAlign=middle" parent="1" vertex="1">
|
||||
<mxGeometry x="300" y="290" width="240" height="65" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="s3R" value="3. 横轴投影
np.sum(gray, axis=1)
每一行灰度值求和" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#E8EAF6;strokeColor=#3949AB;strokeWidth=2;fontSize=13;align=center;verticalAlign=middle" parent="1" vertex="1">
|
||||
<mxGeometry x="660" y="290" width="240" height="65" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="s4" value="4. 计算阈值 X
X = (max - min) × 10%" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF9C4;strokeColor=#F9A825;strokeWidth=3;fontSize=14;fontStyle=1;align=center;verticalAlign=middle" parent="1" vertex="1">
|
||||
<mxGeometry x="480" y="400" width="240" height="55" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="s5" value="5. 曲线减去 X
col_shifted = col_profile - X
row_shifted = row_profile - X" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF9C4;strokeColor=#F9A825;strokeWidth=3;fontSize=13;align=center;verticalAlign=middle" parent="1" vertex="1">
|
||||
<mxGeometry x="480" y="500" width="240" height="65" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="s6" value="6. 减阈值后结果" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE0B2;strokeColor=#E65100;strokeWidth=2;fontSize=13;align=center;verticalAlign=middle" parent="1" vertex="1">
|
||||
<mxGeometry x="480" y="610" width="240" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="d1" value="> 0 ?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#FFF9C4;strokeColor=#F9A825;strokeWidth=2;fontSize=13;fontStyle=1;align=center;verticalAlign=middle" parent="1" vertex="1">
|
||||
<mxGeometry x="525" y="690" width="150" height="80" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="s7pos" value="正 → 斑点区域" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#C8E6C9;strokeColor=#2E7D32;strokeWidth=2;fontSize=13;fontStyle=1;align=center;verticalAlign=middle" parent="1" vertex="1">
|
||||
<mxGeometry x="270" y="705" width="160" height="50" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="s7neg" value="负 → 空隙" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFCDD2;strokeColor=#C62828;strokeWidth=2;fontSize=13;fontStyle=1;align=center;verticalAlign=middle" parent="1" vertex="1">
|
||||
<mxGeometry x="760" y="705" width="160" height="50" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="s8" value="7. 找过零点" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#E3F2FD;strokeColor=#1565C0;strokeWidth=3;fontSize=14;fontStyle=1;align=center;verticalAlign=middle" parent="1" vertex="1">
|
||||
<mxGeometry x="480" y="820" width="240" height="50" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="note1" value="遍历 is_positive 数组
当相邻位置正负不同时
记录该位置 = 过零点" style="shape=note;whiteSpace=wrap;html=1;fillColor=#FFFDE7;strokeColor=#F9A825;strokeWidth=1;fontSize=11;align=center;verticalAlign=middle;backgroundOutline=1;size=14" parent="1" vertex="1">
|
||||
<mxGeometry x="800" y="820" width="160" height="80" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="s9" value="8. 配对过零点" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#E3F2FD;strokeColor=#1565C0;strokeWidth=3;fontSize=14;fontStyle=1;align=center;verticalAlign=middle" parent="1" vertex="1">
|
||||
<mxGeometry x="480" y="920" width="240" height="50" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="note2" value="配对「离开斑点+进入下一斑点」
即:正→负 与 负→正
中点 = 空隙中央 = 划线位置" style="shape=note;whiteSpace=wrap;html=1;fillColor=#FFFDE7;strokeColor=#F9A825;strokeWidth=1;fontSize=11;align=center;verticalAlign=middle;backgroundOutline=1;size=14" parent="1" vertex="1">
|
||||
<mxGeometry x="800" y="920" width="180" height="80" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="s10" value="9. 画出网格线
ax.axvline(x) / ax.axhline(y)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#C8E6C9;strokeColor=#2E7D32;strokeWidth=2;fontSize=13;fontStyle=1;align=center;verticalAlign=middle" parent="1" vertex="1">
|
||||
<mxGeometry x="480" y="1020" width="240" height="55" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="s11" value="10. 输出网格叠加图" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#C8E6C9;strokeColor=#2E7D32;strokeWidth=2;fontSize=14;fontStyle=1;align=center;verticalAlign=middle" parent="1" vertex="1">
|
||||
<mxGeometry x="480" y="1120" width="240" height="50" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="e1" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1" parent="1" source="s1" target="s2" edge="1">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="e2L" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1" parent="1" source="s2" target="s3L" edge="1">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="e2R" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1" parent="1" source="s2" target="s3R" edge="1">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="e3L" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1" parent="1" source="s3L" target="s4" edge="1">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="e3R" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1" parent="1" source="s3R" target="s4" edge="1">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="e4" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1" parent="1" source="s4" target="s5" edge="1">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="e5" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1" parent="1" source="s5" target="s6" edge="1">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="e6" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1" parent="1" source="s6" target="d1" edge="1">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="e7y" value="是" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#2E7D32;strokeWidth=2;endArrow=classic;endFill=1;fontColor=#2E7D32;fontStyle=1;fontSize=12" parent="1" source="d1" target="s7pos" edge="1">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="e7n" value="否" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#C62828;strokeWidth=2;endArrow=classic;endFill=1;fontColor=#C62828;fontStyle=1;fontSize=12" parent="1" source="d1" target="s7neg" edge="1">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="e8p" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1;dashed=1" parent="1" source="s7pos" target="s8" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="350" y="845"/>
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="e8n" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1;dashed=1" parent="1" source="s7neg" target="s8" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="840" y="790"/>
|
||||
<mxPoint x="600" y="790"/>
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="e8" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1" parent="1" source="s8" target="s9" edge="1">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="e9" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1" parent="1" source="s9" target="s10" edge="1">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="e10" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1" parent="1" source="s10" target="s11" edge="1">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="legend_title" value="图例" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" parent="1" vertex="1">
|
||||
<mxGeometry x="270" y="952.5" width="60" height="30" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="leg1" value="输入/输出" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#C8E6C9;strokeColor=#2E7D32;strokeWidth=2;fontSize=11;align=center;verticalAlign=middle" parent="1" vertex="1">
|
||||
<mxGeometry x="270" y="992.5" width="100" height="30" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="leg2" value="数据处理" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF9C4;strokeColor=#F9A825;strokeWidth=2;fontSize=11;align=center;verticalAlign=middle" parent="1" vertex="1">
|
||||
<mxGeometry x="270" y="1032.5" width="100" height="30" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="leg3" value="核心逻辑" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#E3F2FD;strokeColor=#1565C0;strokeWidth=2;fontSize=11;align=center;verticalAlign=middle" parent="1" vertex="1">
|
||||
<mxGeometry x="270" y="1072.5" width="100" height="30" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="leg4" value="投影计算" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#E8EAF6;strokeColor=#3949AB;strokeWidth=2;fontSize=11;align=center;verticalAlign=middle" parent="1" vertex="1">
|
||||
<mxGeometry x="270" y="1112.5" width="100" height="30" as="geometry"/>
|
||||
</mxCell>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
<mxfile host="draw.io" modified="2026-05-08T12:00:00.000Z" agent="Claude" version="24.0.0">
|
||||
<diagram name="简化版完整算法流程" id="flowchart">
|
||||
<mxGraphModel dx="1200" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1200" pageHeight="2000" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0"/>
|
||||
<mxCell id="1" parent="0"/>
|
||||
|
||||
<!-- 标题 -->
|
||||
<mxCell id="title" value="cDNA微阵列网格划分 —— 简化版完整算法流程" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=18;fontStyle=1;fontColor=#1565C0" vertex="1" parent="1">
|
||||
<mxGeometry x="250" y="20" width="700" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
|
||||
<!-- ====== 阶段1:输入 ====== -->
|
||||
<mxCell id="s1" value="1. 读取图像" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#C8E6C9;strokeColor=#2E7D32;strokeWidth=2;fontSize=14;fontStyle=1;align=center;verticalAlign=middle" vertex="1" parent="1">
|
||||
<mxGeometry x="480" y="80" width="240" height="45" as="geometry"/>
|
||||
</mxCell>
|
||||
|
||||
<mxCell id="s2" value="2. 转为灰度图
color.rgb2gray(img)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#C8E6C9;strokeColor=#2E7D32;strokeWidth=2;fontSize=13;fontStyle=1;align=center;verticalAlign=middle" vertex="1" parent="1">
|
||||
<mxGeometry x="480" y="155" width="240" height="45" as="geometry"/>
|
||||
</mxCell>
|
||||
|
||||
<!-- ====== 阶段2:网格划线 ====== -->
|
||||
<mxCell id="s_otsu" value="3. Otsu 自动阈值
遍历0~255,选最小类内方差 T
pct = T / 255(自适应)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF9C4;strokeColor=#F9A825;strokeWidth=3;fontSize=12;fontStyle=1;align=center;verticalAlign=middle" vertex="1" parent="1">
|
||||
<mxGeometry x="480" y="230" width="240" height="55" as="geometry"/>
|
||||
</mxCell>
|
||||
|
||||
<mxCell id="s3L" value="3a. 横轴投影
np.sum(gray, axis=0)
每列灰度求和" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#E8EAF6;strokeColor=#3949AB;strokeWidth=2;fontSize=12;align=center;verticalAlign=middle" vertex="1" parent="1">
|
||||
<mxGeometry x="270" y="320" width="210" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
|
||||
<mxCell id="s3R" value="3b. 纵轴投影
np.sum(gray, axis=1)
每行灰度求和" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#E8EAF6;strokeColor=#3949AB;strokeWidth=2;fontSize=12;align=center;verticalAlign=middle" vertex="1" parent="1">
|
||||
<mxGeometry x="720" y="320" width="210" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
|
||||
<mxCell id="s4" value="4. 计算投影阈值 X
X = (max-min) × pct" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF9C4;strokeColor=#F9A825;strokeWidth=3;fontSize=13;fontStyle=1;align=center;verticalAlign=middle" vertex="1" parent="1">
|
||||
<mxGeometry x="480" y="430" width="240" height="50" as="geometry"/>
|
||||
</mxCell>
|
||||
|
||||
<mxCell id="s5" value="5. 曲线减去 X
正 = 斑点,负 = 空隙,零 = 分界线" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF9C4;strokeColor=#F9A825;strokeWidth=3;fontSize=12;fontStyle=1;align=center;verticalAlign=middle" vertex="1" parent="1">
|
||||
<mxGeometry x="480" y="520" width="240" height="55" as="geometry"/>
|
||||
</mxCell>
|
||||
|
||||
<mxCell id="s6" value="6. 找过零点,配对取空隙中点
离开斑点 + 进入下一斑点 → 划线位置" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#E3F2FD;strokeColor=#1565C0;strokeWidth=3;fontSize=12;fontStyle=1;align=center;verticalAlign=middle" vertex="1" parent="1">
|
||||
<mxGeometry x="480" y="610" width="240" height="55" as="geometry"/>
|
||||
</mxCell>
|
||||
|
||||
<!-- ====== 阶段3:分割 ====== -->
|
||||
<mxCell id="s7" value="7. 逐格 Otsu 分割
对每个格子独立算 Otsu 阈值,二值化" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE0B2;strokeColor=#E65100;strokeWidth=2;fontSize=12;align=center;verticalAlign=middle" vertex="1" parent="1">
|
||||
<mxGeometry x="480" y="710" width="240" height="55" as="geometry"/>
|
||||
</mxCell>
|
||||
|
||||
<mxCell id="s8" value="8. keep_largest_object
每个格子只保留面积最大的连通域" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE0B2;strokeColor=#E65100;strokeWidth=2;fontSize=12;align=center;verticalAlign=middle" vertex="1" parent="1">
|
||||
<mxGeometry x="480" y="800" width="240" height="50" as="geometry"/>
|
||||
</mxCell>
|
||||
|
||||
<mxCell id="s9" value="9. remove_small_objects
全局去噪:面积 < 中位数25% 自动剔除" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE0B2;strokeColor=#E65100;strokeWidth=2;fontSize=12;align=center;verticalAlign=middle" vertex="1" parent="1">
|
||||
<mxGeometry x="480" y="890" width="240" height="50" as="geometry"/>
|
||||
</mxCell>
|
||||
|
||||
<mxCell id="s10" value="10. 统计斑点数
ndimage.label 标记连通域,过滤面积<10" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE0B2;strokeColor=#E65100;strokeWidth=2;fontSize=12;align=center;verticalAlign=middle" vertex="1" parent="1">
|
||||
<mxGeometry x="480" y="980" width="240" height="50" as="geometry"/>
|
||||
</mxCell>
|
||||
|
||||
<!-- ====== 阶段4:输出 ====== -->
|
||||
<mxCell id="s11" value="11. 输出 6 张可视化图片
网格 / 投影曲线 / 直方图 / 分割 / 后处理" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#C8E6C9;strokeColor=#2E7D32;strokeWidth=2;fontSize=12;align=center;verticalAlign=middle" vertex="1" parent="1">
|
||||
<mxGeometry x="480" y="1070" width="240" height="55" as="geometry"/>
|
||||
</mxCell>
|
||||
|
||||
<!-- ====== 连接线 ====== -->
|
||||
<mxCell id="e1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1" edge="1" parent="1" source="s1" target="s2"><mxGeometry relative="1" as="geometry"/></mxCell>
|
||||
<mxCell id="e2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1" edge="1" parent="1" source="s2" target="s_otsu"><mxGeometry relative="1" as="geometry"/></mxCell>
|
||||
<mxCell id="e3L" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1" edge="1" parent="1" source="s_otsu" target="s3L"><mxGeometry relative="1" as="geometry"/></mxCell>
|
||||
<mxCell id="e3R" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1" edge="1" parent="1" source="s_otsu" target="s3R"><mxGeometry relative="1" as="geometry"/></mxCell>
|
||||
<mxCell id="e4L" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1" edge="1" parent="1" source="s3L" target="s4"><mxGeometry relative="1" as="geometry"/></mxCell>
|
||||
<mxCell id="e4R" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1" edge="1" parent="1" source="s3R" target="s4"><mxGeometry relative="1" as="geometry"/></mxCell>
|
||||
<mxCell id="e5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1" edge="1" parent="1" source="s4" target="s5"><mxGeometry relative="1" as="geometry"/></mxCell>
|
||||
<mxCell id="e6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1" edge="1" parent="1" source="s5" target="s6"><mxGeometry relative="1" as="geometry"/></mxCell>
|
||||
<mxCell id="e7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1" edge="1" parent="1" source="s6" target="s7"><mxGeometry relative="1" as="geometry"/></mxCell>
|
||||
<mxCell id="e8" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1" edge="1" parent="1" source="s7" target="s8"><mxGeometry relative="1" as="geometry"/></mxCell>
|
||||
<mxCell id="e9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1" edge="1" parent="1" source="s8" target="s9"><mxGeometry relative="1" as="geometry"/></mxCell>
|
||||
<mxCell id="e10" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1" edge="1" parent="1" source="s9" target="s10"><mxGeometry relative="1" as="geometry"/></mxCell>
|
||||
<mxCell id="e11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#666666;strokeWidth=2;endArrow=classic;endFill=1" edge="1" parent="1" source="s10" target="s11"><mxGeometry relative="1" as="geometry"/></mxCell>
|
||||
|
||||
<!-- ====== 图例 ====== -->
|
||||
<mxCell id="legend_title" value="图例" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" vertex="1" parent="1">
|
||||
<mxGeometry x="60" y="1000" width="60" height="25" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="leg1" value="输入/输出" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#C8E6C9;strokeColor=#2E7D32;strokeWidth=2;fontSize=11;align=center;verticalAlign=middle" vertex="1" parent="1">
|
||||
<mxGeometry x="60" y="1035" width="100" height="28" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="leg2" value="网格划线" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF9C4;strokeColor=#F9A825;strokeWidth=2;fontSize=11;align=center;verticalAlign=middle" vertex="1" parent="1">
|
||||
<mxGeometry x="60" y="1070" width="100" height="28" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="leg3" value="过零点/配对" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#E3F2FD;strokeColor=#1565C0;strokeWidth=2;fontSize=11;align=center;verticalAlign=middle" vertex="1" parent="1">
|
||||
<mxGeometry x="60" y="1105" width="100" height="28" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="leg4" value="投影计算" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#E8EAF6;strokeColor=#3949AB;strokeWidth=2;fontSize=11;align=center;verticalAlign=middle" vertex="1" parent="1">
|
||||
<mxGeometry x="60" y="1140" width="100" height="28" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="leg5" value="分割/后处理" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE0B2;strokeColor=#E65100;strokeWidth=2;fontSize=11;align=center;verticalAlign=middle" vertex="1" parent="1">
|
||||
<mxGeometry x="60" y="1175" width="100" height="28" as="geometry"/>
|
||||
</mxCell>
|
||||
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
</mxfile>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 74 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 66 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 154 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 71 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
@@ -193,7 +193,9 @@ def keep_largest_object(binary: np.ndarray) -> np.ndarray:
|
||||
max_idx = int(np.argmax(areas)) + 1
|
||||
return (labeled == max_idx).astype(np.uint8)
|
||||
|
||||
|
||||
# ================================================================
|
||||
# 函数4:自动去除小连通域(噪声)
|
||||
# ================================================================
|
||||
def remove_small_objects(binary: np.ndarray) -> np.ndarray:
|
||||
"""
|
||||
自动去除小连通域(噪声)。
|
||||
|
||||
Reference in New Issue
Block a user