Documentation

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

Apply or remove gamma correction from images or video streams

Description

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.

Construction

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.

Properties

Correction

Specify gamma correction or linearization

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

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.

LinearSegment

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.

BreakPoint

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.

Methods

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

Create System object with same property values

getNumInputs

Expected number of inputs to a System object

getNumOutputs

Expected number of outputs of a System object

isLocked

Check locked states of a System object (logical)

release

Allow System object property value changes

Examples

Improve image contrast.

 hgamma = ...
   vision.GammaCorrector(2.0,'Correction','De-gamma');
 x = imread('pears.png');
 y = step(hgamma, x);

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

Algorithms

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