필터 지우기
필터 지우기

how to find the dimension of the biggest component?

조회 수: 2 (최근 30일)
Sultan
Sultan 2017년 7월 18일
댓글: Image Analyst 2017년 7월 18일
hi all,
I need to find the dimension of the biggest components.Then plotted against p=linspace(0,1,10).
N=10
for i=1:N
for j=1:N
if rand(1,1)<0.55
A(i,j)=1;
else
A(i,j)=0;
end
end
end
CC = bwconncomp(A,4);
numPixels = cellfun(@numel,CC.PixelIdxList);
[biggest,idx] = max(numPixels);
A(CC.PixelIdxList{idx}) = 2
colours=[1 1 1;0 0 0;1 0 0]
colormap (colours)
imagesc(A)
  댓글 수: 2
Jan
Jan 2017년 7월 18일
Please explain uniquely what "the biggest components" are. What problems do you have with the posted code?
Sultan
Sultan 2017년 7월 18일
biggest component is the component who has biggest number of pixels. The problem is that i want to find the dimension of it

댓글을 달려면 로그인하십시오.

답변 (1개)

Image Analyst
Image Analyst 2017년 7월 18일
You can use regionprops() to find the axis of an ellipse fitted to the data. They don't give you the Feret (caliper) diameter, so you can adapt my attached code to give you that.
  댓글 수: 2
Sultan
Sultan 2017년 7월 18일
can you provide more help, still not clear
Image Analyst
Image Analyst 2017년 7월 18일
Sure. Attach your image and segmentation algoritm to produce your binary image. Then you can use my Image Segmentation Tutorial http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862&sort=downloads_desc to find out how to find all the areas of your blobs. Next, tell me which blob(s) you want the maximum extent (width) computed for. All of them? Just for the one with the greatest area?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by