我正在尝试在matlab中执行种子区域增长,并且无法找到很多帮助或文档。我的算法的第一步是将种子放在要分割的区域中。
我已经通过执行
计算了要分割的对象是向右还是向左 total1=sum(BW3(:,[1:5]));%get the total of the first 5 columns in the image
totalFirst=sum(total1);
display(totalFirst); %testing
total2=sum(BW3(:,[end-4:end])); %get the total of the last 5 columns in the image
totalLast=sum(total2);
display (totalLast); %testing
然后,如果前5个cols的总和大于最后5个cols的总和,那么该对象是正确的,否则它将被定向。
因此,如果对象是正确的,我需要将种子放在图像的第5行和第5列。如果它是朝向的,种子必须放在最后的第5行和第5列。
任何人都可以指导我在这些指定的行和列中实际种植种子的语法吗?
由于
我正在使用乳腺X线摄影图像,我正在尝试使用种子区域生长来切割胸肌
答案 0 :(得分:1)
使用以下代码解决:
if O==1 % 1 means right orientated
x=5;
y=5;
else % 0 means left orintated
x=5;
y=size(J,2)-4;
end
%Added the method from mathworks to my project to perfrom seeded region growing
%mathworks.in/matlabcentral/fileexchange/
Phi=segCroissRegion(32,J,x,y);