how to count pixel in binary image ?
Ältere Kommentare anzeigen
Hi, i'm trying to counting a binary image on handwritting. how to count a high string using pixel? example for counting high of alphabet A.
Akzeptierte Antwort
Weitere Antworten (1)
Asad Alam
am 25 Feb. 2021
0 Stimmen
How can we count pixels of an image by satisfy a condition?
1 Kommentar
Image Analyst
am 27 Feb. 2021
You can use length() and pass your condition in as a mask. Like if your condition is the pixel value is less than 100, you'd do
condition = yourImage < 100; % tru or false values - a logical 2-d matrix.
pixelsLessThan100 = yourImage(condition); % These are a list (1-d vector) of gray level values.
% Count the number of pixels.
count = length(pixelsLessThan100);
Kategorien
Mehr zu Denoising and Compression finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!