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

8 次查看(过去 30 天)
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!

采纳的回答

Image Analyst
Image Analyst 2012-10-31
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 个评论
Shaun VanWeelden
Shaun VanWeelden 2012-10-31
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.

请先登录,再进行评论。

更多回答(1 个)

Harshit
Harshit 2012-10-31
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

类别

Help CenterFile Exchange 中查找有关 Image Processing and Computer Vision 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by