how to extract connected components with similar height

조회 수: 1 (최근 30일)
Lukasz Jarod
Lukasz Jarod 2015년 1월 6일
편집: Lukasz Jarod 2015년 1월 6일
im doing simple extraction of connected components, but now i want to choose only componets with similar height how can i do that??
[L Ne]=bwlabel(imagen);
labeledImage=bwlabel(imagen);
%%Measure properties of image regions
propied=regionprops(L,'BoundingBox');
hold on
%%Plot Bounding Box
for n=1:size(propied,1)
rectangle('Position',propied(n).BoundingBox,'EdgeColor','g','LineWidth',2)
end
hold off
pause (1)
%%Objects extraction
for n=1:Ne
[r,c] = find(L==n);
n1=imagen(min(r):max(r),min(c):max(c));
height=max(r)-min(r)+1;
width=max(c)-min(c)+1;
end

답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by