b8a8ff2bc6
实现内容: - 网格划分:投影分析 + 自相关估周期 + 白顶帽去背景 + 质心提取 - 三种阈值分割:人工阈值、Otsu自动阈值、迭代阈值 - TV去噪(Chambolle投影算法) - 后处理:去小连通域 + 保留最大连通域 - 完整可视化:网格叠加、阈值对比、收敛曲线、分割结果 参考MATLAB代码:NewGridAndCV/demo_GriddingAndCV.m
26 lines
693 B
Matlab
26 lines
693 B
Matlab
function showphi(I, phi, i)
|
|
% show curve evolution of phi
|
|
|
|
% Copyright (c) 2009,
|
|
% Yue Wu @ ECE Department, Tufts University
|
|
% All Rights Reserved
|
|
|
|
for j = 1:size(phi,3)
|
|
phi_{j} = phi(:,:,j);
|
|
end
|
|
% imshow(I,'initialmagnification','fit','displayrange',[0 255]);
|
|
% hold on;
|
|
|
|
if size(phi,3) == 1
|
|
contour(phi_{1}, [0 0], 'r','LineWidth',4);
|
|
contour(phi_{1}, [0 0], 'g','LineWidth',1.3);
|
|
else
|
|
contour(phi_{1}, [0 0], 'r','LineWidth',4);
|
|
contour(phi_{1}, [0 0], 'x','LineWidth',1.3);
|
|
contour(phi_{2}, [0 0], 'g','LineWidth',4);
|
|
contour(phi_{2}, [0 0], 'x','LineWidth',1.3);
|
|
end
|
|
% hold off;
|
|
% title([num2str(i) ' Iterations']);
|
|
|
|
drawnow; |