原始图像的低位Contrast to Noise Ratio使得对象提取的挑战性增大,因为阈值设置可能不会对每个图像都有效。然而我试图从你目前的身材中提取骨骼。在我的处理中应用了两个技巧:(1)对图像进行非线性变换以增强与背景相比低强度的骨骼; (2)在应用Canny边缘检测器之后,在可能的骨骼区域处在图像边界上填充零。见下面我的代码:
I=rgb2gray(I);
I=double(I);
I=I.^0.6; % non linear transform before canny edge detector
BW=edge(I,'canny');
%%% padding at the possible bone regions
BW(1,BW(2,:)==1)=1;
BW(end,BW(end-1,:)==1)=1;
BW(BW(:,2)==1,1)=1;
BW(BW(:,end-1)==1,end)=1;
%%% padding in order to fill in the bone boundaries
bw2=imfill(padarray(BW,size(BW),'symmetric'),'holes');
bw2=bw2(size(bw,1)+(1:size(bw,1)),size(bw,2)+(1:size(bw,2)));
bw2=bwareaopen(bw2,200); % remove the too small regions
MASK=I>10; % remove the background with very low intensity
figure,imshow(bw2.*MASK)
结果:
一切看起来只是一个骨骼边界好的有点凌乱。
你最好在分离重叠的第二个问题上发起一个新帖子。它看起来与你原来的问题不同。 – lennon310