You are here: Start » Image » Image Pixel Statistics » ImageAverage
ImageAverage
Header: | AVL.h |
---|---|
Namespace: | avl |
Computes the average of the image pixel values.
Syntax
void avl::ImageAverage ( const avl::Image& inImage, atl::Optional<const avl::Region&> inRoi, avl::Pixel& outAverageColor, atl::Optional<float&> outAverageValue = atl::NIL )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
inImage | const Image& | Input image | ||
inRoi | Optional<const Region&> | NIL | Range of pixels to be processed | |
outAverageColor | Pixel& | Average of each channel | ||
outAverageValue | Optional<float&> | NIL | Average of the entire image |
Optional Outputs
The computation of following outputs can be switched off by passing value atl::NIL
to these parameters: outAverageValue.
Read more about Optional Outputs.
Description
The function calculates average of pixel values in the inImage.
Average values of pixels calculated for each channel are returned in outAverageColor, while calculated for the region of interest - in outAverageValue. If region of interest isn't specified, average is calculated for the entire image.
Hints
- Connect inImage with the output of your image acquisition filter.
Examples
Remarks
Minimal image size requirement
The input image shouldn't be empty.
Minimal region of interest size requirement
The input region of interest shouldn't be empty.
Hardware Acceleration
This operation supports automatic parallelization for multicore and multiprocessor systems.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Empty image on input in ImageAverage. |
DomainError | Empty region of interest on input in ImageAverage. |
DomainError | Region exceeds an input image in ImageAverage. |
See Also
- ImageAverageHSx – Computes the average of the HSV, HSL or HSI image pixel values.
- ImageMaximum – Finds the location and the value of the brightest pixel.
- ImageMinimum – Finds the location and the value of the darkest pixel.
- ImageSum – Computes the sum of the image pixel values.