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!