• 大小: 1005B
    文件类型: .m
    金币: 1
    下载: 0 次
    发布日期: 2021-05-07
  • 语言: Matlab
  • 标签: 分水岭  

资源简介

基于分水岭算法的重叠细胞分割 %% 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

评论

共有 条评论