counting of pixels having same same value
1 view (last 30 days)
Show older comments
how to count pixels having same value
4 Comments
Manuel Schmidberger
on 8 Apr 2019
Depending on that you wanna count (one or more values) you can use this:
VALS=[1,2...N] % Array of values 1xN
thermIm= % Matrix of thermal image values
noVals=sum(sum(ismember(thermIm,VALS)))
noVals is the amount of pixels in thermal image containing the values stored in array VALS
If you have just one value you can just use a combination of "length" and "find"
VAL= % Random number 1x1
noVals=length(find(thermIm==VAL))
Accepted Answer
Image Analyst
on 8 Apr 2019
Edited: Image Analyst
on 8 Apr 2019
You can take a histogram:
histObject = histogram(yourImage);
or
[counts, grayLevels] = imhist(grayImage);
More Answers (0)
See Also
Categories
Find more on Image Processing Toolbox 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!