资源简介
基于分水岭算法的重叠细胞分割
%% 1.Make a binary image containing two overlapping circular objects.
%% 2.Compute the distance transform of the complement of the binary image.
%% 3.Complement the distance transform, and force pixels that don't belong
%% 4.Compute the watershed transform and display the resulting label matrix as an RGB images.
代码片段和文件信息
%% 1.Make a binary image containing two overlapping circular objects.
center1 = -10;
center2 = -center1;
dist = sqrt(2*(2*center1)^2);
radius = dist/2 * 1.4;
lims = [floor(center1-1.2*radius) ceil(center2+1.2*radius)];
[xy] = meshgrid(lims(1):lims(2));
bw1 = sqrt((x-center1).^2 + (y-center1).^2) <= radius;
bw2 = sqrt((x-center2).^2 + (y-center2).^2) <= radius;
bw = bw1 | bw2;
figure imshow(bw‘InitialMagnification‘‘fit‘) title(‘bw‘)
%% 2.Compute the distance transform of the complem
- 上一篇:DMC动态矩阵控制MATLAB程序(简易
- 下一篇:混沌系统驱动响应同步代码
评论
共有 条评论