Documentation

vision.GammaCorrector System object

Package: vision

Apply or remove gamma correction from images or video streams

Description

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

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.

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

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

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

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.

Was this topic helpful?