Back to Aurora Vision Library Lite website

You are here: Start » All Functions » Image Point Transforms » AvsFilter_CorrectGamma

AvsFilter_CorrectGamma


This is Filter Equivalent. This function may be present in generated code, but should not be used in hand-written code. CreateGammaCorrectionLut and ApplyPixelLut should be used instead.

Header: AVL.h
Namespace: avs

Performs gamma correction.

Applications: Image enhancement for human perception. For computer vision consider LogarithmImage.

Syntax

void avs::AvsFilter_CorrectGamma
(
	AvsFilters_ImagePointTransformsState& ioState,
	const avl::Image& inImage,
	atl::Optional<const avl::Region&> inRoi,
	float inValue,
	avl::Image& outImage
)

Parameters

Name Type Range Default Description
Input will be modified ioState AvsFilters_ImagePointTransformsState& Object used to maintain state of the function.
Input value inImage const Image& Input image
Input value inRoi Optional<const Region&> NIL Range of pixels to be processed
Input value inValue float 0.01 - 8.0 2.0f Gamma coefficient, where 1.0 is neutral
Output value outImage Image& Output image

Requirements

For input inImage only pixel formats are supported: int8, uint8, int16, uint16, int32.

Read more about pixel formats in Image documentation.

In-place Processing

This function supports in-place data processing - you can pass the same reference to inImage and outImage

Read more about In-place Computation.

Description

The gamma correction is a standard nonlinear transformation of pixel brightness that was developed as a tool for the compensation of CRT display input-output characteristic. The operation scales brightness of each inImage pixel to the 0.0 - 1.0 range, exponentiates it to the power of inValue, and then scales the result back to the pixel values range.

Examples

The CorrectGamma performed on the sample image with inValue = 2.0 (left image) and inValue = 0.5 (right image).

Hardware Acceleration

This operation supports automatic parallelization for multicore and multiprocessor systems.

Errors

List of possible exceptions:

Error type Description
DomainError Region exceeds an input image in CorrectGamma.
DomainError Not supported inImage pixel format in AvsFilter_CorrectGamma. Supported formats: Int8, UInt8, Int16, UInt16, Int32.

See Also

  • RescalePixels – Applies linear transformation to pixel values.