Skip to content

area_holesAreaHolesAreaHolesarea_holesarea_holes🔗

Short description🔗

area_holesAreaHolesAreaHolesarea_holesarea_holes — Compute the area of holes of regions.

Signature🔗

area_holes( region Regions, out integer Area )void AreaHoles( const HObject& Regions, HTuple* Area )static void HOperatorSet.AreaHoles( HObject regions, out HTuple area )def area_holes( regions: HObject ) -> Sequence[int]

def area_holes_s( regions: HObject ) -> intHerror area_holes( const Hobject Regions, Hlong* Area )

Herror T_area_holes( const Hobject Regions, Htuple* Area )

HTuple HRegion::AreaHoles( ) const

HTuple HRegion.AreaHoles( )

Description🔗

The operator area_holesAreaHoles calculates the area of the holes in the input regions. The area is defined as the number of pixels contained in the holes. If a region has more than one hole the sum of the areas of all holes in this region are returned. The neighborhood type is set via set_system('neighborhood',<4/8>) (default: 8-neighborhood).

In the documentation of this chapter (Regions / Features), you can find an image illustrating regions which vary in the area of their holes.

If more than one region is passed the results are stored in tuples with the index of a value in the tuple corresponding to the index of the input region. In case of an empty region the area has the value 0.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

Regionsregionsregions (input_object) region(-array) → objectHObjectHRegionHObjectHobject

Region(s) to be examined.

Areaareaarea (output_control) integer(-array) → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Area(s) of holes of the region(s).

Example🔗

(HDevelop)


read_image(Image,'modules/modules_01')
threshold(Image,Region,50,250)
area_holes(Region,Area)

Result🔗

The operator area_holesAreaHoles returns 2 (H_MSG_TRUE) if all parameters are correct.

Combinations with other operators🔗

Combinations

Possible predecessors

thresholdThreshold, regiongrowingRegiongrowing, connectionConnection

See also

area_centerAreaCenter, fill_upFillUp

Module🔗

Foundation