Greetings, how to calculate area and parameter of cell.

조회 수: 2 (최근 30일)
alice shaarveina
alice shaarveina 2018년 3월 13일
댓글: Image Analyst 2018년 3월 13일

채택된 답변

Image Analyst
Image Analyst 2018년 3월 13일
In short
binaryImage = yourImage < 128;
props = regionprops(binaryImage, 'Area', 'Perimeter');
allAreas = [props.Area]
allPerimeters = [props.Perimeter];
You can add other parameters is you wish.
  댓글 수: 2
alice shaarveina
alice shaarveina 2018년 3월 13일
I tried, but it shows this kind of error Sir.
Image Analyst
Image Analyst 2018년 3월 13일
Get rid of the space you have after Perimeter.

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

추가 답변 (1개)

KSSV
KSSV 2018년 3월 13일
I = imread('cell.bmp') ;
imshow(I) ;
I = imcrop(I) ; % crop the required region
[y,x] = find(I~=255) ;
idx = kmeans([x y],7) ; % segment the cells
Area = zeros(7,1) ;
P = zeros(7,1) ;
imshow(I)
hold on
for i = 1:7
plot(x(idx==i),y(idx==i),'.','color',rand(1,3)) ;
id = boundary(x(idx==i),y(idx==i)) ;
Area(i) = polyarea(x(id),y(id)) ;
d = cumsum(sqrt((diff(x(id))).^2+(diff(y(id))).^2)) ;
P(i) = d(end) ;
end

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by