Back to Adaptive Vision Library website

You are here: Start » Function Reference » Image » Image Pixel Statistics » ImageAverageHSx

ImageAverageHSx


Header: AVL.h
Namespace: avl
Module: FoundationLite

Computes the average of the HSV, HSL or HSI image pixel values.

Syntax

C++
C#
 
void avl::ImageAverageHSx
(
	const avl::Image& inRgbImage,
	atl::Optional<const avl::Region&> inRoi,
	avl::HSxColorModel::Type inColorModel,
	atl::Optional<int> inMinSaturation,
	int& outHAverage,
	int& outSAverage,
	int& outBAverage
)

Parameters

Name Type Range Default Description
inRgbImage const Image&
inRoi Optional<const Region&> NIL Range of pixels to be processed
inColorModel HSxColorModel::Type Selected color model
inMinSaturation Optional<int> 0 - 255 0
outHAverage int& Output hue average
outSAverage int& Output saturation average
outBAverage int& Output brightness average

Requirements

For input inRgbImage only pixel formats are supported: 3⨯uint8.

Read more about pixel formats in Image documentation.

Description

The filter finds average values of the HSV, HSL or HSI color space image from the RGB image inRgbImage within specific region inRoi.

The calculations take into account only these pixels which have saturation a greater than inMinSaturation.

Filter returns average values of a hue, saturation and brightness.

Errors

List of possible exceptions:

Error type Description
DomainError Region exceeds an input image in ImageAverageHSx.
DomainError Not supported inRgbImage pixel format in ImageAverageHSx.