how to count pixel in binary image ?
显示 更早的评论
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.
采纳的回答
更多回答(1 个)
Asad Alam
2021-2-25
0 个投票
How can we count pixels of an image by satisfy a condition?
1 个评论
Image Analyst
2021-2-27
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);
类别
在 帮助中心 和 File Exchange 中查找有关 Denoising and Compression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!