Back to Adaptive Vision Library website

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

# ClassifyRegions

Splits an array of regions according to the selected feature and range.

### Syntax

C++
C#

void avl::ClassifyRegions
(
const atl::Array<avl::Region>& inRegions,
avl::RegionFeature::Type inFeature,
atl::Optional<float> inMinimum,
atl::Optional<float> inMaximum,
atl::Optional<atl::Array<avl::Region>&> outAccepted,
atl::Optional<atl::Array<avl::Region>&> outRejected = atl::NIL,
atl::Optional<atl::Array<avl::Region>&> outBelow = atl::NIL,
atl::Optional<atl::Array<avl::Region>&> outAbove = atl::NIL,
atl::Optional<atl::Array<float>&> outValues = atl::NIL
)


### Parameters

Name Type Default Description
inRegions const Array<Region>& Input regions
inFeature RegionFeature::Type Region feature value to be computed
inMinimum Optional<float> NIL Lowest value of the range
inMaximum Optional<float> NIL Highest value of the range
outAccepted Optional<Array<Region>&> Regions with feature values matching the range
outRejected Optional<Array<Region>&> NIL Regions with feature values outside the range
outBelow Optional<Array<Region>&> NIL Regions with feature values lower than inMinimum
outAbove Optional<Array<Region>&> NIL Regions with feature values higher than inMaximum
outValues 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: outAccepted, outRejected, outBelow, outAbove, outValues.

### Description

The filter accepts an array of regions and splits it into output arrays, depending on how each of the computed feature values fits the (inMinimum, inMaximum) range.

• Regions corresponding to feature values lower than inMinimum are passed onto outBelow and outRejected.
• Regions corresponding to feature values that fit closed range (inMinimum, inMaximum) are passed onto outAccepted.
• Regions corresponding to feature values higher than inMaximum are passed onto outAbove and outRejected.

In the special case of inMinimum being greater than inMaximum, first matching condition is applied, which means that objects corresponding to values higher than inMaximum and lower than inMinimum are passed onto outBelow.

To learn about possible features to classify regions, one should see RegionFeature documentation. To know details about particular feature, corresponding filter article should be read.

### Hints

• Pass an array of regions to the inRegions input.
• Using the inFeature input select a feature that well separates the interesting objects.
• Set the range of inMinimum and inMaximum to define the accepted objects. Refer to the outValues output to see the feature values for all input objects.

### Examples

ClassifyRegions performed with Elongation selected as the region feature and inMaximum = 10. The blue regions are from outAccepted output, the orange ones from outRejected.