Borrar filtros
Borrar filtros

PIXEL counting at grey scaled picture

1 visualización (últimos 30 días)
DIMITRIOS ZAFEIRIOU
DIMITRIOS ZAFEIRIOU el 24 de En. de 2022
Comentada: DIMITRIOS ZAFEIRIOU el 24 de En. de 2022
I have a picture which is greyscaled and i want to count the number of pixels from 200-255( the bright ones) from the histogram.Any ideas about the coding or other way? Thank you!

Respuesta aceptada

KALYAN ACHARJYA
KALYAN ACHARJYA el 24 de En. de 2022
Editada: KALYAN ACHARJYA el 24 de En. de 2022
%Using Histogram (Considering 256 Levels)
[counts,binLocations]=imhist(grayImage);
pix_counts=sum(counts(200:end))
##
%% 2nd Method, easier
high_pix=grayImage>199;
pix_counts=sum(high_pix(:))

Más respuestas (1)

Image Analyst
Image Analyst el 24 de En. de 2022
And yet another option:
brightRegions = grayImage >= 200;
numBrightPixels = nnz(brightRegions);

Categorías

Más información sobre Histograms en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by