8 #ifndef META_OCEAN_CV_SUB_REGION_H
9 #define META_OCEAN_CV_SUB_REGION_H
108 inline const Box2& boundingBox()
const;
128 inline bool isEmpty()
const;
134 inline const Frame& mask()
const;
180 explicit inline operator bool()
const;
191 uint8_t maskValue_ = 0x00u;
204 triangles_(subRegion.triangles_),
205 mask_(subRegion.mask_),
206 maskValue_(subRegion.maskValue_),
207 boundingBox_(subRegion.boundingBox_)
215 *
this = std::move(subRegion);
250 if (
this != &subRegion)
253 mask_ = std::move(subRegion.
mask_);
263 inline SubRegion::operator bool()
const
This class implement a sub-region either defined by 2D triangles or defined by a binary mask.
Definition: SubRegion.h:32
SubRegion operator*(const Scalar factor) const
Increases or decreases a sub-region by application of a scalar multiplication factor.
SubRegion(const Scalar left, const Scalar top, const Scalar width, const Scalar height)
Creates a rectangular sub-region which will be handled (internally) as two triangles with one common ...
const Box2 & boundingBox() const
Returns the bounding box of this sub-region.
Definition: SubRegion.h:218
Frame mask_
A binary frame defining the sub-region per pixel.
Definition: SubRegion.h:188
Vectors2 filterPoints(const Vectors2 &points) const
Filters a set of given image points so that all resulting points ly inside this sub-region.
const Frame & mask() const
Returns the binary sub-region mask, if any.
Definition: SubRegion.h:228
SubRegion(Frame &&mask, const PixelBoundingBox &boundingBox=PixelBoundingBox(), const uint8_t maskValue=0x00)
Creates a sub-region object by a given binary mask.
const Triangles2 & triangles() const
Returns the 2D triangles of this sub-region, if any.
Definition: SubRegion.h:233
SubRegion(const PixelBoundingBox &boundingBox)
Creates a rectangular sub-region which will be handled (internally) as two triangles with one common ...
Box2 boundingBox_
Bounding box of this sub-region.
Definition: SubRegion.h:194
SubRegion(const Frame &mask, const PixelBoundingBox &boundingBox=PixelBoundingBox(), const uint8_t maskValue=0x00)
Creates a sub-region object by a given binary mask.
SubRegion(const Triangle2 *triangles, const size_t size)
Creates a sub-region object by a given set of 2D triangles.
Triangles2 triangles_
A set of 2D triangles defining the sub-region.
Definition: SubRegion.h:185
SubRegion(const Box2 &boundingBox)
Creates a rectangular sub-region which will be handled (internally) as two triangles with one common ...
bool isEmpty() const
Returns whether this sub-region is empty.
Definition: SubRegion.h:223
SubRegion & operator=(const SubRegion &subRegion)
Assign operator.
Definition: SubRegion.h:238
SubRegion(const Triangles2 &triangles)
Creates a sub-region object by a given set of 2D triangles.
SubRegion()
Creates an empty sub-region.
Definition: SubRegion.h:197
SubRegion operator*(const SquareMatrix3 &homography) const
Transforms a sub-region by application of a homography that transforms points in the initial frame to...
bool isInside(const Vector2 &point) const
Returns whether a given point lies inside this sub-region.
Scalar size() const
Returns the number of pixels that are covered by this region.
uint8_t maskValue_
The pixel value defining the sub-region.
Definition: SubRegion.h:191
This class implements Ocean's image class.
Definition: Frame.h:1792
bool isValid() const
Returns whether this frame is valid.
Definition: Frame.h:4448
This class implements a 2D triangle with Cartesian coordinates.
Definition: Triangle2.h:81
PixelBoundingBoxT< unsigned int > PixelBoundingBox
Definition of the default PixelBoundingBox object with data type allowing only positive coordinate va...
Definition: PixelBoundingBox.h:21
float Scalar
Definition of a scalar type.
Definition: Math.h:128
std::vector< Triangle2 > Triangles2
Definition of a vector holding 2D triangles.
Definition: Triangle2.h:57
std::vector< Vector2 > Vectors2
Definition of a vector holding Vector2 objects.
Definition: Vector2.h:64
BoxT2< Scalar > Box2
Definition of the Box2 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION either with single or...
Definition: Box2.h:22
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15