I have image with different cell size but I want Count the number of big cells only!!
I try this code:
A = imread ('cell.png');
level=graythresh(A);
I=im2bw(A,level);
[labeled,numObjects]=bwlabel(I,4)
numObjects = 26

 Respuesta aceptada

Dishant Arora
Dishant Arora el 10 de Mzo. de 2014
Editada: Dishant Arora el 10 de Mzo. de 2014

0 votos

use bwareaopen to remove objects smaller than certain number of pixels.
BW2 = bwareaopen(BW, thresh);
[~, numObjects] = bwlabel(BW2,4);

2 comentarios

Moon Shadow
Moon Shadow el 21 de Mzo. de 2014
It did nit worked with me!!
It calculate small and big cells.
I = imread('cell.png'); EDU>> imshow(I); EDU>> bw = im2bw(I); EDU>> figure,imshow(bw);
EDU>> BW2 = bwareaopen(bw, 1000); EDU>> figure,imshow(BW2); [labeled,numObjects]=bwlabel(BW2,4) numObjects = 10
Dishant Arora
Dishant Arora el 25 de Mzo. de 2014
Check out for 8-connectivity when using bwlabel or attach your image.

Iniciar sesión para comentar.

Más respuestas (1)

Image Analyst
Image Analyst el 25 de Mzo. de 2014

0 votos

See my code to extract the largest blob, attached below in blue. In there, there is a general purpose function I wrote that can take the N largest or smallest blobs in a binary image.

Categorías

Más información sobre Images en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 10 de Mzo. de 2014

Respondida:

el 25 de Mzo. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by