필터 지우기
필터 지우기

diameter of image (1024x1024 logical value)

조회 수: 1 (최근 30일)
prrrrr
prrrrr 2020년 7월 3일
답변: Image Analyst 2020년 7월 3일
Hello I have a 104x1024 logical.
when i use imshow(figure) to display it, it looks something like this
how do i get the diameter calculated?
i had already thought about the area but i don't know how.
this is an edited polar plot image
Thanks a lot
  댓글 수: 1
Rik
Rik 2020년 7월 3일
This is not a perfect circle, so which diameter do you want? Width, height, maximal, minimal, other?

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

채택된 답변

Image Analyst
Image Analyst 2020년 7월 3일
You can get the Equivalent Circular Diameter from regionprops(). This is the diameter of the blob if you were to smoosh and mold that same shape into a perfectly circular shape. In other words, the diameter of a perfect circle with the same number of pixels as your irregularly shaped blob.
props = regionprops(mask, 'EquivDiameter');
% Extract it from the structure into a simple variable.
ecd = props.EquivDiameter % This is the "Equivalent Circular Diameter".

추가 답변 (1개)

KSSV
KSSV 2020년 7월 3일
Let A be your logical of 1024*1024
[y,x] = find(A) ; % get all th points with 1
C = [mean(x) mean(y)] ; % this gives the center of the region
% Get the boundary
idx = boundary(x,y) ;
bx = x(idx) ; by = y(idx) ;
% Get ditance
d = sqrt((C(1)-bx).^2+(C(2)-by).^2) ;
mind = min(d) ;
maxd = max(d) ;

카테고리

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

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by