Gamma correction gamma calibration and MATLAB implementation

Source: Internet
Author: User

Matlab built-in implementation: Imadjust
Gamma Correction
Gamma correction formula:. ^ (gamma) or. ^ (1/gamma)?

The nonlinear operation used to adjust the illumination intensity of the image is as follows:

Vout=avγin V_{\text{out}}=av_{\text{in}}^\gamma

Vin V_{\text{in}}: Nonnegative real values, such as image pixels, a A: a constant, usually with a value of 1, the input and output range is generally [0, 1];
Γ<1 \gamma: Light intensity is stronger, called Gamma compressionγ>1 \gamma > 1: Light intensity becomes weaker, called gamma expansion

function gammacorrection (name, a, gamma)
 r = imread (name);
 R=im2double (r);                
 R=rgb2gray (r);                % when the input is a grayscale image, delete the sentence;
 s = A * (R. ^ gamma);
 Subplot (1, 2, 1), Imshow (R), title (' Original ');
 Subplot (1, 2, 2), Imshow (s), title (sprintf (' Gamma:%0.1f ', gamma));
End



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.