This is machine translation

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

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

vision.GammaCorrector System object

Apply or remove gamma correction from images or video streams


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


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.



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.


stepApply or remove gamma correction from input
Common to All System Objects

Create System object with same property values


Expected number of inputs to a System object


Expected number of outputs of a System object


Check locked states of a System object (logical)


Allow System object property value changes


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.

Extended Capabilities

Introduced in R2012a