Conceptual motivation for the difference between imhist() and histcounts()
3 views (last 30 days)
Show older comments
In trying to divorce my toolbox from the IPT, I reimplemented imhist() using histc()/histcounts().
While histc()/histcounts() describes bin locations by their edges, imhist() describes bin locations by their centers. As a consequence, when using imhist(), the first and last bins straddle the extreme values of the data range, effectively making them uniquely half-width bins.
Why this is the preferred behavior? Is this something that is particularly of importance for images? It seems rather contrary to my intuition. I would expect an image with a uniform intensity distribution to have a flat histogram, which isn't what imhist() produces.
0 Comments
Accepted Answer
Steven Lord
on 16 Mar 2021
I haven't used imhist very much if at all, but I suspect using histcounts with the 'integers' BinMethod is likely to be close in functionality to it.
More Answers (0)
See Also
Categories
Find more on Image Filtering and Enhancement 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!