資源簡介
基于分水嶺算法的重疊細(xì)胞分割
%% 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
評論
共有 條評論