原始圖像的低位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