Back to Adaptive Vision Library website

You are here: Start » Function Reference » Region Relations » SortRegions

SortRegions


Header:AVL.h
Namespace:avl

Changes the order of regions from the input array accordingly to an ascending/descending sequence of their computed feature values.

Syntax

C++
C#
 
void avl::SortRegions
(
	const atl::Array<avl::Region>& inRegions,
	avl::RegionFeature::Type inFeature,
	avl::SortingOrder::Type inSortingOrder,
	atl::Array<avl::Region>& outSortedRegions,
	atl::Optional<atl::Array<float>&> outSortedValues = atl::NIL
)

Parameters

Name Type Default Description
inRegions const Array<Region>& Input regions
inFeature RegionFeature::Type Region feature value to be computed
inSortingOrder SortingOrder::Type Sorting order
outSortedRegions Array<Region>& Regions sorted according to the computed feature values
outSortedValues Optional<Array<float>&> NIL Computed feature values

Optional Outputs

The computation of following outputs can be switched off by passing value atl::NIL to these parameters: outSortedValues.

Read more about Optional Outputs.

Description

The filter sorts the array of input regions according to the selected feature values computed for each of them.

Examples

SortRegions performed with inFeature = Area. Input regions are on the left. On the right is the result.

See Also

  • ClassifyRegions – Splits an array of regions according to the selected feature and range.
  • GetMaximumRegion – Returns the region from the input array that corresponds to the largest computed feature value.
  • GetMinimumRegion – Returns the region from the input array that corresponds to the smallest computed feature value.
  • SortArray – Changes the order of the input array elements accordingly to an ascending/descending sequence of the value array.