Greetings, how to calculate area and parameter of cell.

2 visualizaciones (últimos 30 días)

Respuesta aceptada

Image Analyst
Image Analyst el 13 de Mzo. de 2018
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 comentarios
alice shaarveina
alice shaarveina el 13 de Mzo. de 2018
I tried, but it shows this kind of error Sir.
Image Analyst
Image Analyst el 13 de Mzo. de 2018
Get rid of the space you have after Perimeter.

Iniciar sesión para comentar.

Más respuestas (1)

KSSV
KSSV el 13 de Mzo. de 2018
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

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by