Back to Adaptive Vision Library website

You are here: Start » Function Reference » Region » Region Features » RegionNumberOfHoles

RegionNumberOfHoles


Header: AVL.h
Namespace: avl
Module: FoundationBasic

Computes the number of holes in a region.

Syntax

C++
C#
 
void avl::RegionNumberOfHoles
(
	const avl::Region& inRegion,
	avl::RegionConnectivity::Type inConnectivity,
	int inMinHoleArea,
	atl::Optional<int> inMaxHoleArea,
	int& outNumberOfHoles
)

Parameters

Name Type Range Default Description
inRegion const Region& Input region
inConnectivity RegionConnectivity::Type Region connectivity semantics
inMinHoleArea int 0 - 1 Minimal area of a hole
inMaxHoleArea Optional<int> 0 - NIL Maximal area of a hole
outNumberOfHoles int&

Description

The operation computes the number of region holes. Holes of a region are those connected areas of pixels not belonging to the region, that do not touch the boundary of the region frame.

Examples

The number of holes in the sample (left) region equals to 3. The holes are presented on the right image.

See Also

  • FillRegionHoles – Adds pixels to the input region so that it contains no holes.