2011-03-11 4 views

답변

2

당신은 단순히 bwtraceboundary을 사용할 수 있습니다, 여기에 예입니다 : 이미이 시도


BW = imread('blobs.png'); 
imshow(BW,[]); 
s=size(BW); 
for row = 2:55:s(1) 
    for col=1:s(2) 
     if BW(row,col), 
     break; 
     end 
    end 

    contour = bwtraceboundary(BW, [row, col], 'W', 8, 50,... 
            'counterclockwise'); 
    if(~isempty(contour)) 
     hold on; 
     plot(contour(:,2),contour(:,1),'g','LineWidth',2); 
     hold on; 
     plot(col, row,'gx','LineWidth',2); 
    else 
     hold on; plot(col, row,'rx','LineWidth',2); 
    end 
end 
+0

그러나 그것은 작동하지 않았다! 노력에 감사드립니다. – junto

+0

내 PC에서 일하고 있는데, 뭐가 잘못 되었나요? – MBZ

+3

@junto : 아니, "작동하지 않는다"고 했지. –

관련 문제