About regions🔗
A region is defined as a set of pixels. The pixels of a region do not need to be connected. This means that even an arbitrary collection of pixels can be handled as a single region. Region processing is suitable, for example, to apply a blob analysis within images or to define a region of interest (ROI) for following subpixel-precise operations.
Tip
To learn more about the basic concept of regions in HALCON, also see the example program halcon_basic_concepts.hdev.
In the following, the available features are illustrated, together with the operators that allow you to access them.
-
'area'-
Area of the object

-
'row'- Row index of the center
-
'column'- Column index of the center
-
'row1'- Row index of upper left corner
-
'column1'- Column index of upper left corner
'row2'- Row index of lower right corner
-
'column2'- Column index of lower right corner
-
'width'-
Width of the region (parallel to the coordinate axis)

-
'height'-
Height of the region (parallel to the coordinate axis)

-
'circularity'-
Circularity
Operator:circularity
'compactness'-
Compactness
Operator:compactness
'contlength'-
Total length of contour
Operator:contlength
-
'convexity'-
Convexity
Operator:convexity
-
'rectangularity'-
Rectangularity
Operator:rectangularity
-
'ra'-
Main radius of the equivalent ellipse
Operator:elliptic_axis
-
'rb'-
Secondary radius of the equivalent ellipse
Operator:elliptic_axis
-
'phi'-
Orientation of the equivalent ellipse
Operator:elliptic_axis
-
'anisometry'-
Anisometry
Operator:eccentricity
-
'bulkiness'-
Bulkiness
Operator:eccentricity
-
'struct_factor'-
Structure Factor
Operator:eccentricity
-
'outer_radius'-
Radius of smallest surrounding circle
Operator:smallest_circle
-
'inner_radius'-
Radius of largest inner circle
Operator:inner_circle
-
'inner_width'-
Width of the largest axis-parallel rectangle that fits into the region
Operator:inner_rectangle1
-
'inner_height'-
Height of the largest axis-parallel rectangle that fits into the region
Operator:inner_rectangle1
-
'dist_mean'-
Mean distance from the region border to the center
Operatorroundness
-
'dist_deviation'-
Deviation of the distance from the region border to the center
Operator:roundness
-
'roundness'-
Roundness
Operator:roundness
-
'num_sides'-
Number of polygon sides
Operator:roundness
-
'connect_num'-
Number of connection components
Operator:connect_and_holes
-
'holes_num'-
Number of holes
Operator:connect_and_holes
-
'area_holes'-
Area of the holes of the object
Operator:area_holes
-
'max_diameter'-
Maximum diameter of the region
Operator:diameter_region
-
'orientation'-
Orientation of the region
Operator:orientation_region
-
'euler_number'-
Euler number
Operator:euler_number
-
'rect2_phi'-
Orientation of the smallest surrounding rectangle
Operatorsmallest_rectangle2
-
'rect2_len1'-
Half the length of the smallest surrounding rectangle
Operator:smallest_rectangle2
-
'rect2_len2'-
Half the width of the smallest surrounding rectangle
Operator:smallest_rectangle2
-
'moments_m11'- Geometric moments of the region
Operator:moments_region_2nd -
'moments_m20'- Geometric moments of the region
Operator:moments_region_2nd -
'moments_m02'- Geometric moments of the region
Operator:moments_region_2nd -
'moments_ia'- Geometric moments of the region
Operator:moments_region_2nd -
'moments_ib'- Geometric moments of the region
Operator:moments_region_2nd -
'moments_m11_invar'- Geometric moments of the region
Operator:moments_region_2nd_invar -
'moments_m20_invar'- Geometric moments of the region
Operator:moments_region_2nd_invar -
'moments_m02_invar'- Geometric moments of the region
Operator:moments_region_2nd_invar -
'moments_phi1'- Geometric moments of the region
Operator:moments_region_2nd_rel_invar -
'moments_phi2'- Geometric moments of the region
Operator:moments_region_2nd_rel_invar -
'moments_m21'- Geometric moments of the region
Operator:moments_region_3rd -
'moments_m12'- Geometric moments of the region
Operator:moments_region_3rd -
'moments_m03'- Geometric moments of the region
Operator:moments_region_3rd -
'moments_m30'- Geometric moments of the region
Operator:moments_region_3rd -
'moments_m21_invar'- Geometric moments of the region
Operator:moments_region_3rd_invar -
'moments_m12_invar'- Geometric moments of the region
Operator:moments_region_3rd_invar -
'moments_m03_invar'- Geometric moments of the region
Operator:moments_region_3rd_invar -
'moments_m30_invar'- Geometric moments of the region
Operator:moments_region_3rd_invar -
'moments_i1'- Geometric moments of the region
Operator:moments_region_central -
'moments_i2'- Geometric moments of the region
Operator:moments_region_central -
'moments_i3'- Geometric moments of the region
Operator:moments_region_central -
'moments_i4'- Geometric moments of the region
Operator:moments_region_central -
'moments_psi1'- Geometric moments of the region
Operator:moments_region_central_invar -
'moments_psi2'- Geometric moments of the region
Operator:moments_region_central_invar -
'moments_psi3'- Geometric moments of the region
Operator:moments_region_central_invar -
'moments_psi4'- Geometric moments of the region
Operator:moments_region_central_invar