How to use imhist() for a part of an image

4 views (last 30 days)
How do I define a part of an image to display the histogram?
I don't want to use imcrop() on my image because in my application I have to crop it twice, and the coordinates will be reset back to 0 and I have to declare the bounding box again, which I don't want as I have to automate this over several photos.
imhist(I) only allows me to display the histogram of an image I, but I only want to display a certain portion of it, not the whole image.

Accepted Answer

Adam
Adam on 9 Feb 2017
e.g.
imhist( I(200:300, 320:420) )
  3 Comments
Adam
Adam on 10 Feb 2017
It is actually indexed as rows and columns which, confusingly, maps to y first and then x for an image you are looking at a plot of.
Ga Ree
Ga Ree on 13 Feb 2017
Alright! Thanks a lot Adam! It worked!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!