Back to Aurora Vision Library Lite website

You are here: Start » Image » Image Conversions » AddChannels

AddChannels


Header: AVL.h
Namespace: avl

Creates a monochromatic image by summing the values of the input image channels.

Syntax

void avl::AddChannels
(
	const avl::Image& inImage,
	atl::Optional<const avl::Region&> inRoi,
	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
Output value outImage Image& output mono image

Description

This operation sums values of the given inImage image channels to obtain a monochromatic image.

Examples

Image with one channel on the input of the filter (on the left) doesn't affect the image - see the image on the right.

Input RGB image (on the left) converted to single-channel image (on the right) with pixel values obtained from summing values of input image channels. For example, if a pixel from input image in each R, G and B channel has values {255, 0, 0}, corresponding pixel in the output image will have value {255} (because 255 + 0 + 0 = 255).

Hardware Acceleration

This operation is optimized for AVX2 technology for pixels of types: 2xUINT8, 3xUINT8, 4xUINT8, 2xUINT16, 3xUINT16, 4xUINT16.

This operation is optimized for SSSE3 technology for pixels of types: 2xUINT8, 3xUINT8, 4xUINT8, 2xUINT16, 3xUINT16, 4xUINT16.

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

See Also

  • AddChannels_Saturation – Creates a monochromatic image by summing the values of the input image channels with saturation.
  • AverageChannels – Creates a monochromatic image by averaging the input image channels.