48 template<
class Po
intType>
49 void inline DrawBB(IplImage *
image,
const std::vector<PointType>& points, CvScalar color, std::string label=
"")
51 if (points.size() < 2) {
54 PointType minimum = PointType(image->width, image->height);
55 PointType maximum = PointType(0, 0);
56 for (
int i = 0; i < (int)points.size(); ++i) {
57 PointType current = points.at(i);
58 if (current.x < minimum.x) minimum.x = current.x;
59 if (current.x > maximum.x) maximum.x = current.x;
60 if (current.y < minimum.y) minimum.y = current.y;
61 if (current.y > maximum.y) maximum.y = current.y;
63 cvLine(image, cvPoint((
int)minimum.x,(
int)minimum.y), cvPoint((
int)maximum.x,(
int)minimum.y), color);
64 cvLine(image, cvPoint((
int)maximum.x,(
int)minimum.y), cvPoint((
int)maximum.x,(
int)maximum.y), color);
65 cvLine(image, cvPoint((
int)maximum.x,(
int)maximum.y), cvPoint((
int)minimum.x,(
int)maximum.y), color);
66 cvLine(image, cvPoint((
int)minimum.x,(
int)maximum.y), cvPoint((
int)minimum.x,(
int)minimum.y), color);
69 cvInitFont(&font, 0, 0.5, 0.5, 0);
70 cvPutText(image, label.c_str(), cvPoint((
int)minimum.x+1,(
int)minimum.y+2), &
font, CV_RGB(255,255,0));
87 template<
class Po
intType>
88 void inline DrawLines(IplImage *image,
const std::vector<PointType>& points, CvScalar color,
bool loop=
true)
90 for(
unsigned i = 1; i < points.size(); ++i)
91 cvLine(image, cvPoint((
int)points[i-1].
x,(
int)points[i-1].
y), cvPoint((
int)points[i].
x,(
int)points[i].
y), color);
93 cvLine(image, cvPoint((
int)points[points.size()-1].x,(int)points[points.size()-1].y), cvPoint((
int)points[0].x,(int)points[0].y), color);
118 void ALVAR_EXPORT DrawCircles(IplImage* image,
const CvSeq* contour,
int radius, CvScalar color = CV_RGB(255,0,0));
125 void ALVAR_EXPORT DrawLines(IplImage* image,
const CvSeq* contour, CvScalar color = CV_RGB(255,0,0));
133 template<
class Po
intType>
134 void inline DrawPoints(IplImage *image,
const std::vector<PointType>& points, CvScalar color,
int radius=1)
136 for(
unsigned i = 0; i < points.size(); ++i)
137 cvCircle(image, cvPoint((
int)points[i].
x,(
int)points[i].
y), radius, color);
170 Camera *cam,
double gl_modelview[16],
void ALVAR_EXPORT DrawCircles(IplImage *image, const CvSeq *contour, int radius, CvScalar color=CV_RGB(255, 0, 0))
Draws circles to the contour points that are obtained by Labeling class.
This file implements a parametrized line.
This file implements a camera used for projecting points and computing homographies.
void ALVAR_EXPORT DrawTexture(IplImage *image, IplImage *texture, Camera *cam, double gl_modelview[16], PointDouble topleft, PointDouble botright)
Draws the texture generated by BuildHideTexture to given video frame. For better performance, use OpenGL instead. See SampleMarkerHide.cpp for example implementation.
void ALVAR_EXPORT DrawPoints(IplImage *image, const std::vector< CvPoint > &points, CvScalar color)
Draws a set of points.
TFSIMD_FORCE_INLINE const tfScalar & y() const
Simple Camera class for calculating distortions, orientation or projections with pre-calibrated camer...
void DrawBB(IplImage *image, const std::vector< PointType > &points, CvScalar color, std::string label="")
Draws the bounding box of a connected component (Blob).
Struct representing a line. The line is parametrized by its center and direction vector.
void ALVAR_EXPORT DrawLine(IplImage *image, const Line line, CvScalar color=CV_RGB(0, 255, 0))
Draws a line.
TFSIMD_FORCE_INLINE const tfScalar & x() const
This file implements generic utility functions and a serialization interface.
ALVAR_EXPORT Point< CvPoint2D64f > PointDouble
The default double point type.
void ALVAR_EXPORT BuildHideTexture(IplImage *image, IplImage *hide_texture, Camera *cam, double gl_modelview[16], PointDouble topleft, PointDouble botright)
This function is used to construct a texture image which is needed to hide a marker from the original...
void DrawLines(IplImage *image, const std::vector< PointType > &points, CvScalar color, bool loop=true)
Draws lines between consecutive points stored in vector (polyline).
void ALVAR_EXPORT DrawCVEllipse(IplImage *image, CvBox2D &ellipse, CvScalar color, bool fill=false, double par=0)
Draws OpenCV ellipse.
This file defines library export definitions, version numbers and build information.