How to get pixelcount in image.
Show older comments
I tried with [pixel-count x]=imhist(i), i is gray scale image but I got pixel-count=256xdouble like dis not value. Please help me with this, matlab code.
Accepted Answer
More Answers (1)
Guillaume
on 9 Dec 2016
What pixel count?
imhist returns the number of pixels at each of 256 different gray levels. If you want more or less intensity levels, simply specify a different number of bins rather than using the default.
If you want to know the total number of pixels in the image, it's simply height*width, i.e.
numpixels = size(i, 1) * size(i, 2); %and you shouldn't call your image i.
2 Comments
Deepika Rani
on 9 Dec 2016
Guillaume
on 9 Dec 2016
This is the exact question I asked, what do you mean by pixel count? Pixel count of what?
Categories
Find more on Blocked Images in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!