Back to Aurora Vision Library website

You are here: Start » Function Reference » Image » Image Point Transforms » SubtractFromImage

SubtractFromImage


Header: AVL.h
Namespace: avl
Module: FoundationLite

Subtracts a scalar value from each pixel.

Syntax

C++
C#
 
void avl::SubtractFromImage
(
	const avl::Image& inImage,
	atl::Optional<const avl::Region&> inRoi,
	float inValue,
	avl::Image& outImage
)

Parameters

Name Type Default Description
Input value inImage const Image& Input image
Input value inRoi Optional<const Region&> NIL Range of pixels to be processed
Input value inValue float 50.0f Value to be subtracted
Output value outImage Image& Output image

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 operation decreases the brightness of the inImage by subtracting a fixed value from each of its pixels.

\forall_{i,j} \text{\textbf{OutImage} }_{i,j} = \text{\textbf{InImage} }_{i,j} - \text{\textbf{inValue} }

Whenever the resulting value exceeds the range of pixel values, it is clipped to the nearest proper value.

Examples

The SubtractFromImage performed on the sample image with inValue = 50.0.

Hardware Acceleration

This operation is optimized for SSE2 technology for pixels of types: UINT8, SINT8, SINT16, REAL.

This operation is optimized for NEON technology for pixels of types: UINT8, SINT8, UINT16, SINT16, SINT32, REAL.

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 SubtractFromImage.

See Also

  • AddToImage – Adds a scalar value to each pixel.