DUtilsCV::Drawing Class Reference

Drawing functions. More...

#include <Drawing.h>

List of all members.

Classes

class  Plot
 Allows to plot numeric data. More...

Static Public Member Functions

static void drawKeyPoints (cv::Mat &image, const std::vector< cv::KeyPoint > &keypoints, bool colorOctave=false, bool useCartesianAngle=false)
static void saveKeyPointImage (const std::string &filename, const cv::Mat &image, const std::vector< cv::KeyPoint > &keypoints)
static void drawCorrespondences (cv::Mat &image, const cv::Mat &im1, const cv::Mat &im2, const std::vector< cv::KeyPoint > &kp1, const std::vector< cv::KeyPoint > &kp2, const std::vector< int > &c1, const std::vector< int > &c2)
static void saveCorrespondenceImage (const std::string &filename, const cv::Mat &im1, const cv::Mat &im2, const std::vector< cv::KeyPoint > &kp1, const std::vector< cv::KeyPoint > &kp2, const std::vector< int > &c1, const std::vector< int > &c2)
static void drawReferenceSystem (cv::Mat &image, const cv::Mat &cTo, const cv::Mat &A, const cv::Mat &K=cv::Mat(), float length=0.1)
static void drawReferenceSystem (cv::Mat &image, const cv::Mat &cRo, const cv::Mat &cto, const cv::Mat &A, const cv::Mat &K=cv::Mat(), float length=0.1)
static void drawBox (cv::Mat &image, const cv::Mat &cRo, const cv::Mat &cto, float width, float height, const cv::Mat &A, const cv::Mat &K=cv::Mat(), std::vector< cv::Point2f > *box=NULL, const Plot::Style &style=Plot::Style('r', 2))
static void drawBox (cv::Mat &image, const cv::Mat &sHb, int cols, int rows, std::vector< cv::Point2f > *box=NULL, const Plot::Style &style=Plot::Style('r', 2))
template<class T >
static void plot (cv::Mat &image, const std::vector< T > &x, const std::vector< T > &y, int thickness=1, const cv::Scalar &color=cv::Scalar(0), const cv::Scalar &bgcolor=cv::Scalar(255, 255, 255))

Detailed Description

Drawing functions.


Member Function Documentation

void Drawing::drawBox ( cv::Mat &  image,
const cv::Mat &  sHb,
int  cols,
int  rows,
std::vector< cv::Point2f > *  box = NULL,
const Plot::Style style = Plot::Style('r', 2) 
) [static]

Draws a rectangle in the image from an homography

Parameters:
image image to draw
sHb homography from a orthonormal plane to the image
cols 
rows dimensions of the plane in pixels
box if given, the image coordinates of the box corners are returned here
void Drawing::drawBox ( cv::Mat &  image,
const cv::Mat &  cRo,
const cv::Mat &  cto,
float  width,
float  height,
const cv::Mat &  A,
const cv::Mat &  K = cv::Mat(),
std::vector< cv::Point2f > *  box = NULL,
const Plot::Style style = Plot::Style('r', 2) 
) [static]

Draws a rectangle in the image from its location in the 3D space

Parameters:
image image to draw
cRo rotation from camera to the center of the rectangle
cto translation from camera to the center of the rectangle
width 
height dimensions of the rectangle in metres
A intrinsic camera parameters
K distortion of the camera
box if given, the image coordinates of the box corners are returned here
void Drawing::drawCorrespondences ( cv::Mat &  image,
const cv::Mat &  im1,
const cv::Mat &  im2,
const std::vector< cv::KeyPoint > &  kp1,
const std::vector< cv::KeyPoint > &  kp2,
const std::vector< int > &  c1,
const std::vector< int > &  c2 
) [static]

Creates an image with correspondences

Parameters:
image return image
im1 
im2 
kp1 keypoints from im1
kp2 keypoints from im2
c1 indices of correspondences from kp1
c2 indices of correspondences from kp2
void Drawing::drawKeyPoints ( cv::Mat &  image,
const std::vector< cv::KeyPoint > &  keypoints,
bool  colorOctave = false,
bool  useCartesianAngle = false 
) [static]

Draws keypoints on an image

Parameters:
image 
keypoints 
useCartesianAngle if true, the angle of the keypoints is assumed to be in Cartesian axis. If false, the vision reference is used instead (X points right, Y points up)
colorOctave if true, the keypoint color codes the keypoint octave (1: red, 2: green, 3: blue, other: whie)
Note:
OpenCV SURF keypoints use Cartesian coordinates
OpenCV ORB keypoints use vision coordinates
void Drawing::drawReferenceSystem ( cv::Mat &  image,
const cv::Mat &  cRo,
const cv::Mat &  cto,
const cv::Mat &  A,
const cv::Mat &  K = cv::Mat(),
float  length = 0.1 
) [static]

Draws a reference system in the given image with axes x red, y green, z blue

Parameters:
image image to draw
cRo rotation from camera to the origin of the drawn reference
cto translation from camera to the origin of the drawn reference
A intrinsic camera parameters
K distortion of the camera
length length of axes
void Drawing::drawReferenceSystem ( cv::Mat &  image,
const cv::Mat &  cTo,
const cv::Mat &  A,
const cv::Mat &  K = cv::Mat(),
float  length = 0.1 
) [static]

Draws a reference system in the given image with axes x red, y green, z blue

Parameters:
image image to draw
cTo transformation from camera to the origin of the drawn reference
A intrinsic camera parameters
K distortion of the camera
length length of axes
template<class T >
static void DUtilsCV::Drawing::plot ( cv::Mat &  image,
const std::vector< T > &  x,
const std::vector< T > &  y,
int  thickness = 1,
const cv::Scalar &  color = cv::Scalar(0),
const cv::Scalar &  bgcolor = cv::Scalar(255, 255, 255) 
) [inline, static]

Creates an image with data plotted

Parameters:
image image in which create the plot
x x coordinates of points (any unit)
y y coordinates of points (any unit)
thickness thickness of lines
color line color
bgcolor background color
void Drawing::saveCorrespondenceImage ( const std::string &  filename,
const cv::Mat &  im1,
const cv::Mat &  im2,
const std::vector< cv::KeyPoint > &  kp1,
const std::vector< cv::KeyPoint > &  kp2,
const std::vector< int > &  c1,
const std::vector< int > &  c2 
) [static]

Creates and saves an image with correspondences

Parameters:
filename file to create
im1 
im2 
kp1 keypoints from im1
kp2 keypoints from im2
c1 indices of correspondences from kp1
c2 indices of correspondences from kp2
void Drawing::saveKeyPointImage ( const std::string &  filename,
const cv::Mat &  image,
const std::vector< cv::KeyPoint > &  keypoints 
) [static]

Draws and saves keypoints on an image

Parameters:
filename 
image 
keypoints 

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations
Generated on Thu Feb 7 19:22:00 2013 by  doxygen 1.6.3