Companion  1.0.0
Companion is an object recognition framework written with OpenCV.
Public Member Functions | List of all members
Companion::Draw::Frame Class Reference

#include <Frame.h>

Inheritance diagram for Companion::Draw::Frame:
Inheritance graph
[legend]
Collaboration diagram for Companion::Draw::Frame:
Collaboration graph
[legend]

Public Member Functions

 Frame (cv::Point topLeft, cv::Point topRight, cv::Point bottomLeft, cv::Point bottomRight, cv::Scalar color=cv::Scalar(0.0, 255.0, 0.0, 255.0), int thickness=4)
 
virtual ~Frame ()=default
 
virtual void Draw (cv::Mat image)
 
virtual void Ratio (int cWidth, int cHeight, int nWidth, int nHeight)
 
virtual int OriginX ()
 
virtual int OriginY ()
 
virtual void MoveOrigin (int x, int y)
 
virtual void Color (const cv::Scalar &color)
 
virtual cv::Rect CutArea ()
 
virtual const cv::Scalar & Color () const
 
virtual int Thickness () const
 
virtual void Thickness (int thickness)
 
void TopLeft (const cv::Point &topLeft)
 
void TopRight (const cv::Point &topRight)
 
void BottomLeft (const cv::Point &bottomLeft)
 
void BottomRight (const cv::Point &bottomRight)
 
const cv::Point & TopLeft () const
 
const cv::Point & TopRight () const
 
const cv::Point & BottomLeft () const
 
const cv::Point & BottomRight () const
 

Detailed Description

Implementation class for a drawable frame.

Author
Andreas Sekulski, Dimitri Kotlovsky

Constructor & Destructor Documentation

◆ Frame()

Companion::Draw::Frame::Frame ( cv::Point  topLeft,
cv::Point  topRight,
cv::Point  bottomLeft,
cv::Point  bottomRight,
cv::Scalar  color = cv::Scalar(0.0, 255.0, 0.0, 255.0),
int  thickness = 4 
)

Constructor to create a drawable frame.

Parameters
topLeftTop left position.
topRightTop right position.
bottomLeftBottom left position.
bottomRightBottom right position.
colorColor of the frame.
thicknessThickness of the frame.

◆ ~Frame()

virtual Companion::Draw::Frame::~Frame ( )
virtualdefault

Destructor.

Member Function Documentation

◆ BottomLeft() [1/2]

void Companion::Draw::Frame::BottomLeft ( const cv::Point &  bottomLeft)

Set bottom left corner of the frame.

Parameters
bottomLeftBottom left corner.

◆ BottomLeft() [2/2]

const cv::Point & Companion::Draw::Frame::BottomLeft ( ) const

Get bottom left corner of the frame.

Returns
Bottom left corner.

◆ BottomRight() [1/2]

void Companion::Draw::Frame::BottomRight ( const cv::Point &  bottomRight)

Set bottom right corner of the frame.

Parameters
bottomRightBottom right corner.

◆ BottomRight() [2/2]

const cv::Point & Companion::Draw::Frame::BottomRight ( ) const

Get bottom right corner of the frame.

Returns
Bottom right corner.

◆ Color() [1/2]

void Companion::Draw::Frame::Color ( const cv::Scalar &  color)
virtual

Set frame color.

Parameters
colorFrame color to set.

Implements Companion::Draw::Drawable.

◆ Color() [2/2]

const cv::Scalar & Companion::Draw::Frame::Color ( ) const
virtual

Get the color of the frame.

Returns
Frame color.

Implements Companion::Draw::Drawable.

◆ CutArea()

cv::Rect Companion::Draw::Frame::CutArea ( )
virtual

Get cut area around this frame.

Returns
Cut area around this frame as a cv::Rect.

Implements Companion::Draw::Drawable.

◆ Draw()

void Companion::Draw::Frame::Draw ( cv::Mat  image)
virtual

Draw this frame to the given image.

Parameters
imageImage on which to draw the object.

Implements Companion::Draw::Drawable.

◆ MoveOrigin()

void Companion::Draw::Frame::MoveOrigin ( int  x,
int  y 
)
virtual

Move the frame's origin.

Parameters
xRelative distance to move the origin on the x axis.
yRelative distance to move the origin on the y axis.

Implements Companion::Draw::Drawable.

◆ OriginX()

int Companion::Draw::Frame::OriginX ( )
virtual

Obtain the origin's x coordinate.

Returns
X coordinate of the frames's origin.

Implements Companion::Draw::Drawable.

◆ OriginY()

int Companion::Draw::Frame::OriginY ( )
virtual

Obtain the origin's y coordinate.

Returns
Y coordinate of the frames's origin.

Implements Companion::Draw::Drawable.

◆ Ratio()

void Companion::Draw::Frame::Ratio ( int  cWidth,
int  cHeight,
int  nWidth,
int  nHeight 
)
virtual

Scale this frame from the current image size to a new image size.

Parameters
cWidthCurrent image width.
cHeightCurrent image height.
nWidthNew image width.
nHeightNew image height.

Implements Companion::Draw::Drawable.

◆ Thickness() [1/2]

int Companion::Draw::Frame::Thickness ( ) const
virtual

Get thickness of the frame, if 0 no frame will be drawn.

Returns
Frame thickness.

Implements Companion::Draw::Drawable.

◆ Thickness() [2/2]

void Companion::Draw::Frame::Thickness ( int  thickness)
virtual

Set thickness of the frame.

Parameters
thicknessFrame thickness.

Implements Companion::Draw::Drawable.

◆ TopLeft() [1/2]

void Companion::Draw::Frame::TopLeft ( const cv::Point &  topLeft)

Set top left corner of the frame.

Parameters
topLeftTop left corner.

◆ TopLeft() [2/2]

const cv::Point & Companion::Draw::Frame::TopLeft ( ) const

Get top left corner of the frame.

Returns
Top left corner.

◆ TopRight() [1/2]

void Companion::Draw::Frame::TopRight ( const cv::Point &  topRight)

Set top right corner of the frame.

Parameters
topRightTop right corner.

◆ TopRight() [2/2]

const cv::Point & Companion::Draw::Frame::TopRight ( ) const

Get top right corner of the frame.

Returns
Top right corner.

The documentation for this class was generated from the following files: