How to automate image contrast adjustment using imcontrast or other ways?

5 views (last 30 days)
So I am trying to adjust the contrast of an entire directory of images in the most efficient manner possible. I do not know enough about image processing yet to know how to adjust the pixel values manually so I found imcontrast which seems like a great tool that will really allow the people using my program to have the control that they need. Really though, it is kind of overkill so I thought I would try and identify what imcontrast was actually doing. It looks like after some doc reading and google searching that it simply adjusts the "CLim" values and magically the contrast is adjusted.. That seems much to simple.. Just in case that was the case, I struggled trying to set the axes CLim values both in my script and through the "Property Inspector" to no affect whatsoever, so if anybody could provide an example of how to set the CLim values through a script that would be terrific.
More importantly, I was wondering if any of you awesome people had suggestions on how to automate the process. Every image in the directory needs more or less the same contrast adjustment..
Thanks for the help and I will be happy to answer follow-up questions if I was unclear about a part.
Thanks in advance!

Accepted Answer

Image Analyst
Image Analyst on 31 Oct 2012
Shaun, did you see under "See also" imadjust()? You can use imadjust() to programmatically fix up (linearly adjust) a whole bunch of images using code from the the FAQ to process the files. It should give a better appearance than histogram equalization, which always seems to give an unnatural unrealistic look because of the non-linear stretching.
  1 Comment
Shaun VanWeelden
Shaun VanWeelden on 31 Oct 2012
Good Call, I guess I should have broadened my horizons when searching! Any info about the whole Clim thing though? I am just curious as to what that actually does and how to adjust it.

Sign in to comment.

More Answers (1)

Harshit
Harshit on 31 Oct 2012
Hi Shaun, If you requires similar adjustment you can use histogram equalization in a loop where you can read all the images and apply it on each of them. It enhances the contrast by expanding the histogram. Here is wiki page : http://en.wikipedia.org/wiki/Histogram_equalization and histeq is the command. Regards, Harshit

Categories

Find more on Image Processing and Computer Vision in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!