How to find what percentage of image an object covers

5 visualizaciones (últimos 30 días)
Elysi Cochin
Elysi Cochin el 25 de En. de 2021
Respondida: waqas el 26 de En. de 2021
From the given image, how can i find the percentage of cells covers the image or in other words what percentage of cell covers that image or what is the percentage of foreground image?

Respuestas (1)

waqas
waqas el 26 de En. de 2021
im = im2bw(imread('image.jpeg'));
imshow(bw)
whitearea = bwarea(bw);
blackarea = bwarea(~bw);
conversion to black and white is not perfect in the above code but this should give you the idea. You can use thresholding before converting to black and white image. This will take care of the pixels that are removed from the cells.

Categorías

Más información sobre Convert Image Type 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