This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

vision.GammaCorrector System object

Package: vision

Apply or remove gamma correction from images or video streams


The GammaCorrector object applies gamma correction to input images or video streams.

    Note:   Starting in R2016b, instead of using the step method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.


H = vision.GammaCorrector returns a System object, HGAMMACORR. This object applies or removes gamma correction from images or video streams.

H = vision.GammaCorrector(Name,Value) returns a gamma corrector object, H, with each specified property set to the specified value. You can specify additional name-value pair arguments in any order as (Name1, Value1,...,NameN,ValueN).

H = vision.GammaCorrector(GAMMA,Name,Value) returns a gamma corrector object, H, with the Gamma property set to GAMMA and other specified properties set to the specified values.

Code Generation Support
Supports MATLAB® Function block: Yes
System Objects in MATLAB Code Generation
Code Generation Support, Usage Notes, and Limitations.



Specify gamma correction or linearization

Specify the object's operation as one of Gamma | De-gamma. The default is Gamma.


Gamma value of output or input

When you set the Correction property to Gamma, this property gives the desired gamma value of the output video stream. When you set the Correction property to De-gamma, this property indicates the gamma value of the input video stream. You must set this property to a numeric scalar value greater than or equal to 1.

The default is 2.2.


Enable gamma curve to have linear portion near origin

Set this property to true to make the gamma curve have a linear portion near the origin.

The default is true.


I-axis value of the end of gamma correction linear segment

Specify the I-axis value of the end of the gamma correction linear segment as a scalar numeric value between 0 and 1. This property applies when you set the LinearSegment property to true.

The default is 0.018.


cloneCreate gamma corrector object with same property values
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs from step method
isLockedLocked status for input attributes and nontunable properties
release Allow property value and input characteristics changes
stepApply or remove gamma correction from input


Improve image contrast.

 hgamma = ...
 x = imread('pears.png');
 y = step(hgamma, x);

 imshow(x); title('Original Image');
 figure, imshow(y); 
 title('Enhanced Image after De-gamma Correction');


This object implements the algorithm, inputs, and outputs described on the Gamma Correction block reference page. The object properties correspond to the block parameters.

Introduced in R2012a

Was this topic helpful?