b8a8ff2bc6
实现内容: - 网格划分:投影分析 + 自相关估周期 + 白顶帽去背景 + 质心提取 - 三种阈值分割:人工阈值、Otsu自动阈值、迭代阈值 - TV去噪(Chambolle投影算法) - 后处理:去小连通域 + 保留最大连通域 - 完整可视化:网格叠加、阈值对比、收敛曲线、分割结果 参考MATLAB代码:NewGridAndCV/demo_GriddingAndCV.m
19 lines
444 B
Matlab
19 lines
444 B
Matlab
function output=redcolorcontour(inputcolor,inputcontour)
|
|
%%将轮廓图像bw中的1显示为红色,显示在彩色图像的对应位置
|
|
%%
|
|
|
|
[r,c]=size(inputcontour);
|
|
% inputcolor
|
|
|
|
for i=1:r
|
|
for j=1:c
|
|
if uint8(inputcontour(i,j))==255
|
|
inputcolor(i,j)=255;
|
|
inputcolor(i,j,2)=0;
|
|
inputcolor(i,j,3)=0;
|
|
end
|
|
end
|
|
end
|
|
output(:,:,1)=inputcolor(:,:,1);
|
|
output(:,:,2)=inputcolor(:,:,2);
|
|
output(:,:,3)=inputcolor(:,:,3); |