Apply or remove gamma correction
visionhdl.GammaCorrector
applies or removes gamma
correction on a stream of pixels. Gamma correction adjusts linear pixel values so that the
modified values fit a curve. The de-gamma operation performs the opposite operation to obtain
linear pixel values.
To apply or remove gamma correction:
Create the visionhdl.GammaCorrector
object and set its properties.
Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects?.
returns
a System object™ that applies default gamma correction on a stream of pixels.corrector
= visionhdl.GammaCorrector
returns a gamma correction System object, corrector
= visionhdl.GammaCorrector(Name
,Value
)corrector
, with properties set using one or more
name-value pairs. Enclose each property name in single quotes.
corrector = visionhdl.GammaCorrector('LinearSegment',false)
creates a gamma correction object that does not use a linear segment in the gamma curve.
returns a gamma correction System object with the Correction
property set to corrector
= visionhdl.GammaCorrector(operation
,gammaValue
,Name
,Value
)operation
, the Gamma property set to
gammaValue
, and additional options specified by one or more
name-value pairs.
[
returns the intensity value of a pixel after gamma correction, and the control signals
associated with the pixel. The input, pixelOut
,ctrlOut
] = corrector(pixelIn
,ctrlIn
)pixelIn
, and output,
pixelOut
, are scalar values representing a single pixel.
This object uses a streaming pixel interface with a structure
for frame control signals. This interface enables the object to operate independently of image
size and format, and to connect with other Vision HDL Toolbox™ objects. The object accepts and returns a scalar pixel value and control signals
as a structure containing five signals. The control signals indicate the validity of each pixel
and its location in the frame. To convert a pixel matrix into a pixel stream and control
signals, use the visionhdl.FrameToPixels
object. For a full
description of the interface, see Streaming Pixel Interface.
To use an object function, specify the
System object as the first input argument. For
example, to release system resources of a System object named obj
, use
this syntax:
release(obj)
visionhdl.FrameToPixels
| vision.GammaCorrector
(Computer Vision Toolbox)imadjust
(Image Processing Toolbox)