21 #ifndef _BIAS_IMAGE_DRAW_H_
22 #define _BIAS_IMAGE_DRAW_H_
24 #include <bias_config.h>
26 #ifdef BIAS_HAVE_OPENCV
31 #include <Base/Image/ColourRGB.hh>
32 #include <Base/Image/Image.hh>
33 #include <Base/Geometry/HomgPoint2D.hh>
47 ImgPosition(
const int x,
const int y) { Pos_[0]=x; Pos_[1]=y; }
52 { BIASASSERT(i>=0&&i<2);
return Pos_[i]; }
55 { BIASASSERT(i>=0&&i<2);
return Pos_[i]; }
58 { Pos_[0]=pos[0]; Pos_[1]=pos[1];
return *
this; }
71 template <
class StorageType=
unsigned char>
76 static StorageType GetContrastValue(StorageType t);
88 const int minx,
const int miny,
89 const int maxx,
const int maxy,
90 const StorageType value[]);
95 const int minx,
const int miny,
96 const int maxx,
const int maxy,
97 const StorageType value[]);
101 const int minx,
const int miny,
102 const int maxx,
const int maxy,
103 const StorageType value);
107 const int minx,
const int miny,
108 const int maxx,
const int maxy);
112 const int minx,
const int miny,
113 const int maxx,
const int maxy,
114 const StorageType GreyValue);
118 const int minx,
const int miny,
119 const int maxx,
const int maxy,
120 const StorageType GreyValue);
129 const int y,
const int size,
130 const StorageType value[]);
134 const int y,
const int size,
135 const StorageType value);
138 const int y,
const int size,
139 const StorageType value);
144 const int size,
const StorageType value[])
145 {
return RectangleCenter(im, coo[0], coo[1], size, value); };
150 const int y,
const int size);
165 const unsigned int end[2],
166 const StorageType value[]);
170 const StorageType value[],
176 const StorageType value[]);
180 const unsigned int end[2],
181 const StorageType value);
185 const unsigned int end[2],
186 const StorageType value);
190 const unsigned int end[2]);
195 const unsigned int end[2]);
210 const unsigned int StartX,
211 const unsigned int StartY,
212 const unsigned int EndX,
213 const unsigned int EndY,
214 const StorageType color[],
215 const float thickness );
220 const unsigned int StartY,
const unsigned int EndX,
221 const unsigned int EndY,
222 const StorageType Value[]);
226 const unsigned int StartY,
const unsigned int EndX,
227 const unsigned int EndY,
228 const StorageType Value);
232 const unsigned int StartY,
const unsigned int EndX,
233 const unsigned int EndY);
237 const unsigned int StartY,
const unsigned int EndX,
238 const unsigned int EndY,
239 const StorageType Value);
243 const StorageType value[])
244 {
return Line(im, &coo[0], &coo[2], value); };
252 const StorageType value[]);
269 const int StartX,
const int StartY,
270 const int EndX,
const int EndY,
271 const StorageType Value[],
272 const float thickness = 1.0,
273 const float Opacity = 1.0);
287 const StorageType Value[],
288 const float Thickness = 1.0,
289 const float Opacity = 1.0);
302 const int StartX,
const int StartY,
303 const int EndX,
const int EndY,
304 const StorageType Value,
305 const float thickness = 1.0,
306 const float Opacity = 1.0);
319 const StorageType Value,
320 const float thickness = 1.0,
321 const float Opacity = 1.0);
326 const StorageType Value)
327 {
return InterpolatedLineGrey(im, coo[0], coo[1], coo[2],
338 const unsigned end[2],
const unsigned length,
339 const unsigned width,
340 const StorageType value[]);
348 unsigned int CenterY,
unsigned int Radius,
349 const StorageType Value[]=NULL);
353 unsigned int CenterY,
unsigned int Radius,
354 const StorageType Value[]);
365 unsigned int CenterY,
unsigned int Radius,
366 const StorageType Value[],
367 const float Thickness = 1.0,
368 const float Opacity = 1.0);
372 unsigned int CenterY,
unsigned int Radius,
373 const std::vector<StorageType>& Value,
374 const float Thickness = 1.0,
375 const float Opacity = 1.0){
376 StorageType* color =
new StorageType[Value.size()];
377 for(
unsigned int i=0; i<Value.size(); i++){
380 return InterpolatedCircleCenter(im, CenterX, CenterY, Radius, color, Thickness, Opacity);
394 const StorageType Value[],
395 const float Thickness = 1.0,
396 const float Opacity = 1.0);
405 double a[2],
double b[2],
406 const StorageType Value[]);
430 const std::string & message,
434 const int fontface=1,
435 const double hscale=1.0,
436 const double vscale=1.0,
437 const double shear=0,
438 const int thickness=1,
450 const std::string & message,
454 const double hscale=1.0,
455 const double vscale=1.0,
456 const double shear=0,
457 const int thickness=1,
464 const int startY,
const int endX,
const int endY,
467 const int thickness=1 );
474 const int & radius=3,
476 const int & thickness=1,
477 const int & linetype=8,
489 const int thickness=1,
490 const int linetype=8,
496 static void Rectangle(
503 const int thickness=1,
504 const int linetype=8,
517 const double & angle,
518 const double & start_angle=0,
519 const double & end_angle=360,
521 const int & thickness=1,
522 const int & linetype=8,
533 #endif // _BIAS_IMAGE_DRAW_H_
ImgPosition(const ImgPosition &pos)
class HomgPoint2D describes a point with 2 degrees of freedom in projective coordinates.
interface class used to ease handover in function calls
ImgPosition(const int x, const int y)
static int InterpolatedLineGrey(Image< StorageType > &im, unsigned int coo[4], const StorageType Value)
interface class used to ease handover in function calls
const int & operator[](const int i) const
static int InterpolatedCircleCenter(Image< StorageType > &im, unsigned int CenterX, unsigned int CenterY, unsigned int Radius, const std::vector< StorageType > &Value, const float Thickness=1.0, const float Opacity=1.0)
Convenience wrapper for InterpolatedCircleCenter().
static int Line(Image< StorageType > &im, unsigned int coo[4], const StorageType value[])
convenience wrapper
static int RectangleCenter(Image< StorageType > &im, const unsigned coo[2], const int size, const StorageType value[])
convenience wrapper
int & operator[](const int i)
Ellipse in 2D with dfifferent representations.
ImgPosition & operator=(const ImgPosition &pos)
The image template class for specific storage types.
drawing simple entities into the image like rectangles or lines As all functions are static they have...