Adjust brightness and contrast
Show older comments
Hello,
How do I write a command in a script so that as soon as i run it and enter imread('image'), this command will automatically set the brightness and contrast to a predetermined level. The images im mainly focusing on are grayscale images.
thanks
Accepted Answer
More Answers (2)
Image Analyst
on 30 Jul 2014
If the "predetermined level" is just 0 to 255 so that it can display on a video monitor with the maximum possible dynamic range, just do
imshow(grayImage, []);
That will scale the min (whatever that is) to 0 and the max (whatever that happens to be) to 255. If you want specific gray levels other than 0-255, use imadjust() like Ben11 said.
3 Comments
jchris14
on 30 Jul 2014
Image Analyst
on 30 Jul 2014
Of course not. If you have A and B, you just do
B = A;
If A is a completely different image and you want to match their histograms, you use can do
C = imhistmatch(B, A);
aswathy pavithran
on 29 Oct 2019
thank you sir
Rodrigo Souza
on 28 Jan 2019
0 votes
Hi all,
I have put together three scripts/functions for calculating (mean and SD), matching or normalizing luminance of colored images (using HSV and CIE Lab color spaces).
They may be specially useful for pupillometry measures of infant research.
The scripts and their descriptions are available at my OSF page: https://osf.io/auzjy/
Hope it helps.
Categories
Find more on Image Preview and Device Configuration 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!