IDS peak ICV v1.0.0
Loading...
Searching...
No Matches
Region Class Referencefinal

#include <peak_icv/types/peak_icv_region.hpp>

Inheritance diagram for Region:
Collaboration diagram for Region:

Public Member Functions

 Region ()
 Creates an empty Region.
 
 Region (const std::vector< peak::common::Point > &points)
 Creates a region from a collection of points.
 
 Region (const peak::common::Rectangle &rect)
 Creates a region from a Rectangle.
 
 ~Region () override
 
 Region (const Region &other)
 
 Region (Region &&other) noexcept
 
Region & operator= (const Region &other)
 
Region & operator= (Region &&other) noexcept
 
bool operator== (const Region &rhs) const
 
bool operator!= (const Region &rhs) const
 
std::vector< peak::common::Point > GetPoints () const
 Returns the points from a region.
 
std::vector< Region > GetConnectedComponents () const
 Calculates the connected components of the region.
 
size_t GetArea () const
 Calculates the area of a region.
 
peak::common::PointF GetCenterOfGravity () const
 Calculates the center of gravity of a region.
 
Region Intersection (const Region &other) const
 Calculates the intersection of two regions.
 
Region Difference (const Region &other) const
 Calculates the difference of two regions.
 
Region Union (const Region &other) const
 Calculates the union of two regions.
 
Region Dilation (const Region &structuringElement) const
 Performs morphological dilation on the input region using the specified structuring element.
 
Region Erosion (const Region &structuringElement) const
 Performs morphological erosion on the input region using the specified structuring element.
 
Region Scale (const peak::common::Size &inputSize, const peak::common::Size &outputSize, const Interpolation &interpolation=Interpolation::NearestNeighbor) const
 Returns a scaled region.
 

Detailed Description

A region consists of a set of points in the image plane.

See also
Region
Warning
This function is still in development and not released.

Definition at line 36 of file peak_icv_region.hpp.

Constructor & Destructor Documentation

◆ Region() [1/5]

Region ( )
inline

Creates an empty Region.

Warning
This function is still in development and not released.

Definition at line 32 of file peak_icv_region.ipp.

◆ Region() [2/5]

Region ( const std::vector< peak::common::Point > & points)
inlineexplicit

Creates a region from a collection of points.

Warning
This function is still in development and not released.

Definition at line 39 of file peak_icv_region.ipp.

◆ Region() [3/5]

Region ( const peak::common::Rectangle & rect)
inlineexplicit

Creates a region from a Rectangle.

Warning
This function is still in development and not released.

Definition at line 50 of file peak_icv_region.ipp.

◆ ~Region()

~Region ( )
inlineoverride
Warning
This function is still in development and not released.

Definition at line 82 of file peak_icv_region.ipp.

◆ Region() [4/5]

Region ( const Region & other)
inline
Warning
This function is still in development and not released.

Definition at line 62 of file peak_icv_region.ipp.

◆ Region() [5/5]

Region ( Region && other)
inlinenoexcept
Warning
This function is still in development and not released.

Definition at line 73 of file peak_icv_region.ipp.

Member Function Documentation

◆ Difference()

Region Difference ( const Region & other) const
inline

Calculates the difference of two regions.

See also
Determining the difference
Returns
Returns the difference of two regions.
Warning
This function is still in development and not released.

Definition at line 243 of file peak_icv_region.ipp.

◆ Dilation()

Region Dilation ( const Region & structuringElement) const
inline

Performs morphological dilation on the input region using the specified structuring element.

The reference point of the structuring element is at (0, 0).

Returns
Returns the dilated region.
Warning
This function is still in development and not released.

Definition at line 265 of file peak_icv_region.ipp.

◆ Erosion()

Region Erosion ( const Region & structuringElement) const
inline

Performs morphological erosion on the input region using the specified structuring element.

The reference point of the structuring element is at (0, 0).

Returns
Returns the eroded region.
Warning
This function is still in development and not released.

Definition at line 276 of file peak_icv_region.ipp.

◆ GetArea()

size_t GetArea ( ) const
inline

Calculates the area of a region.

Returns
Returns the area of a region.
Warning
This function is still in development and not released.

Definition at line 181 of file peak_icv_region.ipp.

◆ GetCenterOfGravity()

peak::common::PointF GetCenterOfGravity ( ) const
inline

Calculates the center of gravity of a region.

Returns
Returns the center of gravity as a floating point.
Exceptions
MathErrorExceptionThe center of gravity could not be calculated.
Warning
This function is still in development and not released.

Definition at line 192 of file peak_icv_region.ipp.

◆ GetConnectedComponents()

std::vector< Region > GetConnectedComponents ( ) const
inline

Calculates the connected components of the region.

The 8-neighborhood is used to determine the components.

See also
Determining connected components
Returns
Returns the connected components of the region as a region vector.
Warning
This function is still in development and not released.

Definition at line 155 of file peak_icv_region.ipp.

◆ GetPoints()

std::vector< peak::common::Point > GetPoints ( ) const
inline

Returns the points from a region.

Warning
This function is still in development and not released.

Definition at line 128 of file peak_icv_region.ipp.

◆ Intersection()

Region Intersection ( const Region & other) const
inline

Calculates the intersection of two regions.

See also
Determining the intersection
Returns
Returns the intersection of two regions.
Warning
This function is still in development and not released.

Definition at line 232 of file peak_icv_region.ipp.

◆ operator!=()

bool operator!= ( const Region & rhs) const
inline
Warning
This function is still in development and not released.

Definition at line 218 of file peak_icv_region.ipp.

◆ operator=() [1/2]

Region & operator= ( const Region & other)
inline
Warning
This function is still in development and not released.

Definition at line 90 of file peak_icv_region.ipp.

◆ operator=() [2/2]

Region & operator= ( Region && other)
inlinenoexcept
Warning
This function is still in development and not released.

Definition at line 110 of file peak_icv_region.ipp.

◆ operator==()

bool operator== ( const Region & rhs) const
inline
Warning
This function is still in development and not released.

Definition at line 203 of file peak_icv_region.ipp.

◆ Scale()

Region Scale ( const peak::common::Size & inputSize,
const peak::common::Size & outputSize,
const Interpolation & interpolation = Interpolation::NearestNeighbor ) const
inline

Returns a scaled region.

The inputSize typically refers to the dimensions of the original image from which the region was derived (e.g. during segmentation). This is the coordinate space in which the region was initially defined. The size must be at least as large as the extent of the region.

The outputSize represents the dimensions of the target image where the region will be mapped or rendered after scaling or transformation.

Ensure that any coordinate or size transformations account for the difference between input and output dimensions to maintain spatial consistency.

Parameters
inputSizeThe size based on the original image.
outputSizeThe size of a corresponding image to which the original region is scaled.
interpolationThe interpolation method used to scale the image.
Returns
The scaled region.
Exceptions
NotPossibleExceptionThe region extent is greater than the given inputSize or the given outputSize is empty (i.e. width × height == 0).
Warning
This function is still in development and not released.

Definition at line 287 of file peak_icv_region.ipp.

◆ Union()

Region Union ( const Region & other) const
inline

Calculates the union of two regions.

See also
Determining the union
Returns
Returns the united region.
Warning
This function is still in development and not released.

Definition at line 254 of file peak_icv_region.ipp.