![]() |
Companion
1.0.0
Companion is an object recognition framework written with OpenCV.
|
#include <Line.h>
Public Member Functions | |
Line (cv::Point start, cv::Point end, cv::Scalar color=cv::Scalar(0.0, 255.0, 0.0, 255.0), int thickness=4) | |
virtual void | Draw (cv::Mat image) |
virtual void | Ratio (int cWidth, int cHeight, int nWidth, int nHeight) |
virtual cv::Rect | CutArea () |
virtual int | OriginX () |
virtual int | OriginY () |
virtual void | MoveOrigin (int x, int y) |
virtual void | Color (const cv::Scalar &color) |
virtual const cv::Scalar & | Color () const |
virtual void | Thickness (int thickness) |
virtual int | Thickness () const |
const cv::Point & | Start () const |
void | Start (const cv::Point &start) |
const cv::Point & | End () const |
void | End (const cv::Point &end) |
Class implementation for a drawable line.
Companion::Draw::Line::Line | ( | cv::Point | start, |
cv::Point | end, | ||
cv::Scalar | color = cv::Scalar(0.0, 255.0, 0.0, 255.0) , |
||
int | thickness = 4 |
||
) |
Constructor to create a drawable line.
start | Starting position of the line. |
end | Ending position of the line. |
color | Color of the line. |
thickness | Thickness of the line. |
|
virtual |
|
virtual |
|
virtual |
Get cut area around this line.
Implements Companion::Draw::Drawable.
|
virtual |
Draw this line to the given image.
image | Image on which to draw the object. |
Implements Companion::Draw::Drawable.
const cv::Point & Companion::Draw::Line::End | ( | ) | const |
Get endpoint of this line.
void Companion::Draw::Line::End | ( | const cv::Point & | end | ) |
Set a given endpoint for this line.
end | Endpoint to set for this line. |
|
virtual |
Move the line's origin.
x | Relative distance to move the origin on the x axis. |
y | Relative distance to move the origin on the y axis. |
Implements Companion::Draw::Drawable.
|
virtual |
Obtain the origin's x coordinate.
Implements Companion::Draw::Drawable.
|
virtual |
Obtain the origin's y coordinate.
Implements Companion::Draw::Drawable.
|
virtual |
Scale this line from the current image size to a new image size.
cWidth | Current image width. |
cHeight | Current image height. |
nWidth | New image width. |
nHeight | New image height. |
Implements Companion::Draw::Drawable.
const cv::Point & Companion::Draw::Line::Start | ( | ) | const |
Get starting point of this line.
void Companion::Draw::Line::Start | ( | const cv::Point & | start | ) |
Set a given starting point for this line.
start | Starting point to set for this line. |
|
virtual |
Set thickness of the line.
thickness | Line thickness. |
Implements Companion::Draw::Drawable.
|
virtual |
Get thickness of this line, if 0 no line will be drawn.
Implements Companion::Draw::Drawable.