Ocean
|
This class implement a sub-region either defined by 2D triangles or defined by a binary mask. More...
Public Member Functions | |
SubRegion () | |
Creates an empty sub-region. More... | |
SubRegion (const SubRegion &subRegion) | |
Copy constructor. More... | |
SubRegion (SubRegion &&subRegion) noexcept | |
Move constructor. More... | |
SubRegion (const Triangles2 &triangles) | |
Creates a sub-region object by a given set of 2D triangles. More... | |
SubRegion (const Triangle2 *triangles, const size_t size) | |
Creates a sub-region object by a given set of 2D triangles. More... | |
SubRegion (const Frame &mask, const PixelBoundingBox &boundingBox=PixelBoundingBox(), const uint8_t maskValue=0x00) | |
Creates a sub-region object by a given binary mask. More... | |
SubRegion (Frame &&mask, const PixelBoundingBox &boundingBox=PixelBoundingBox(), const uint8_t maskValue=0x00) | |
Creates a sub-region object by a given binary mask. More... | |
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 edge. More... | |
SubRegion (const Box2 &boundingBox) | |
Creates a rectangular sub-region which will be handled (internally) as two triangles with one common edge. More... | |
SubRegion (const PixelBoundingBox &boundingBox) | |
Creates a rectangular sub-region which will be handled (internally) as two triangles with one common edge. More... | |
const Box2 & | boundingBox () const |
Returns the bounding box of this sub-region. More... | |
bool | isInside (const Vector2 &point) const |
Returns whether a given point lies inside this sub-region. More... | |
Vectors2 | filterPoints (const Vectors2 &points) const |
Filters a set of given image points so that all resulting points ly inside this sub-region. More... | |
bool | isEmpty () const |
Returns whether this sub-region is empty. More... | |
const Frame & | mask () const |
Returns the binary sub-region mask, if any. More... | |
const Triangles2 & | triangles () const |
Returns the 2D triangles of this sub-region, if any. More... | |
Scalar | size () const |
Returns the number of pixels that are covered by this region. More... | |
SubRegion & | operator= (const SubRegion &subRegion) |
Assign operator. More... | |
SubRegion & | operator= (SubRegion &&subRegion) noexcept |
Move operator. More... | |
SubRegion | operator* (const Scalar factor) const |
Increases or decreases a sub-region by application of a scalar multiplication factor. More... | |
SubRegion | operator* (const SquareMatrix3 &homography) const |
Transforms a sub-region by application of a homography that transforms points in the initial frame to points in the new frame. More... | |
operator bool () const | |
Returns whether this sub-region is not empty. More... | |
Private Attributes | |
Triangles2 | triangles_ |
A set of 2D triangles defining the sub-region. More... | |
Frame | mask_ |
A binary frame defining the sub-region per pixel. More... | |
uint8_t | maskValue_ = 0x00u |
The pixel value defining the sub-region. More... | |
Box2 | boundingBox_ |
Bounding box of this sub-region. More... | |
This class implement a sub-region either defined by 2D triangles or defined by a binary mask.
|
inline |
Creates an empty sub-region.
|
inline |
Copy constructor.
subRegion | Sub-region object to be copied |
|
inlinenoexcept |
Move constructor.
subRegion | Sub-region object to be moved |
|
explicit |
Creates a sub-region object by a given set of 2D triangles.
triangles | 2D triangles defining the sub-region |
Ocean::CV::SubRegion::SubRegion | ( | const Triangle2 * | triangles, |
const size_t | size | ||
) |
Creates a sub-region object by a given set of 2D triangles.
triangles | 2D triangles defining the sub-region |
size | The number of given triangles |
|
explicit |
Creates a sub-region object by a given binary mask.
mask | Binary mask defining the sub-region |
boundingBox | Optional bounding box of the sub-region |
maskValue | The mask value defining the valid pixels |
|
explicit |
Creates a sub-region object by a given binary mask.
mask | Binary mask defining the sub-region |
boundingBox | Optional bounding box of the sub-region |
maskValue | The mask value defining the valid pixels |
Ocean::CV::SubRegion::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 edge.
left | Horizontal start position of the sub-region |
top | Vertical start position of the sub-region |
width | The width of the sub-region, with range (0, infinity) |
height | The height of the sub-region, with range (0, infinity) |
|
explicit |
Creates a rectangular sub-region which will be handled (internally) as two triangles with one common edge.
If the given bounding box is invalid the new sub-region will be a default sub-region.
boundingBox | Bounding box that will defined the sub-region |
|
explicit |
Creates a rectangular sub-region which will be handled (internally) as two triangles with one common edge.
If the given bounding box is invalid the new sub-region will be a default sub-region.
boundingBox | Bounding box that will defined the sub-region |
|
inline |
Returns the bounding box of this sub-region.
Filters a set of given image points so that all resulting points ly inside this sub-region.
points | The set of image points which will be filtered |
|
inline |
Returns whether this sub-region is empty.
bool Ocean::CV::SubRegion::isInside | ( | const Vector2 & | point | ) | const |
Returns whether a given point lies inside this sub-region.
point | Point to be checked |
|
inline |
Returns the binary sub-region mask, if any.
|
inlineexplicit |
Returns whether this sub-region is not empty.
Increases or decreases a sub-region by application of a scalar multiplication factor.
factor | The multiplication factor defining the new sub-region, with range [0, infinity) |
SubRegion Ocean::CV::SubRegion::operator* | ( | const SquareMatrix3 & | homography | ) | const |
Transforms a sub-region by application of a homography that transforms points in the initial frame to points in the new frame.
homography | The homography transforming points defined in the coordinate system of the initial frame into points defined in the coordinate system of the new frame. |
Assign operator.
subRegion | Sub-region object to be assigned |
Move operator.
subRegion | Sub-region object to be moved |
Scalar Ocean::CV::SubRegion::size | ( | ) | const |
Returns the number of pixels that are covered by this region.
|
inline |
Returns the 2D triangles of this sub-region, if any.
|
private |
Bounding box of this sub-region.
|
private |
A binary frame defining the sub-region per pixel.
|
private |
The pixel value defining the sub-region.
|
private |
A set of 2D triangles defining the sub-region.