#include <peak_icv/types/peak_icv_region.hpp>

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. The area is the number of pixels in the 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. | |
Represents a region defined by a set of points in the image plane.
The Region class models a geometric area within an image, represented as a collection of discrete points in 2D image coordinates. It serves as a logical grouping of image locations, which may be used for selection, analysis, or rendering purposes.
The Region class implements its own drawing logic via the IDrawable interface. When triggered by the Painter, it paints itself onto the target image by rendering only the points that fall within the image bounds.
Definition at line 53 of file peak_icv_region.hpp.
|
inline |
|
inlineexplicit |
Creates a region from a collection of points.
Definition at line 37 of file peak_icv_region.ipp.
|
inlineexplicit |
Creates a region from a Rectangle.
Definition at line 48 of file peak_icv_region.ipp.
|
inlineoverride |
Definition at line 80 of file peak_icv_region.ipp.
Definition at line 60 of file peak_icv_region.ipp.
Definition at line 71 of file peak_icv_region.ipp.
Calculates the difference of two regions.
Definition at line 249 of file peak_icv_region.ipp.
Performs morphological dilation on the input region using the specified structuring element.
The reference point of the structuring element is at (0, 0).
Definition at line 271 of file peak_icv_region.ipp.
Performs morphological erosion on the input region using the specified structuring element.
The reference point of the structuring element is at (0, 0).
Definition at line 282 of file peak_icv_region.ipp.
|
inline |
Calculates the area of a region. The area is the number of pixels in the region.
Definition at line 187 of file peak_icv_region.ipp.
|
inline |
Calculates the center of gravity of a region.
| MathErrorException | The center of gravity could not be calculated. |
Definition at line 198 of file peak_icv_region.ipp.
|
inline |
Calculates the connected components of the region.
The 8-neighborhood is used to determine the components.
Definition at line 153 of file peak_icv_region.ipp.
|
inline |
Returns the points from a region.
Definition at line 126 of file peak_icv_region.ipp.
Calculates the intersection of two regions.
Definition at line 238 of file peak_icv_region.ipp.
|
inline |
Definition at line 224 of file peak_icv_region.ipp.
Definition at line 88 of file peak_icv_region.ipp.
Definition at line 108 of file peak_icv_region.ipp.
|
inline |
Definition at line 209 of file peak_icv_region.ipp.
|
inline |
Returns a scaled region.
The inputSize typically refers to the dimensions of the original image in pixels 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 in pixels 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.
| inputSize | The size in pixels based on the original image. |
| outputSize | The size in pixels of a corresponding image to which the original region is scaled. |
| interpolation | The interpolation method used to scale the image. |
| NotPossibleException | The region extent is greater than the given inputSize or the given outputSize is empty (i.e. width × height == 0). |
Definition at line 293 of file peak_icv_region.ipp.
Calculates the union of two regions.
Definition at line 260 of file peak_icv_region.ipp.