 |
Visual Servoing Platform
version 3.3.0
|
Test for vpImageDraw class.
#include <iostream>
#include <visp3/core/vpImageDraw.h>
#include <visp3/core/vpFont.h>
#include <visp3/io/vpImageIo.h>
int main(int argc ,char *argv[])
{
bool save = false;
for (int i = 1; i < argc; i++) {
if (std::string(argv[i]) == "--save") {
save = true;
}
else if (std::string(argv[i]) == "--help" || std::string(argv[i]) == "-h") {
std::cout << "\nUsage: " << argv[0]
<< " [--save] [--help] [-h]\n"
<< std::endl;
return 0;
}
}
std::cout << "Save: " << save << std::endl;
{
int w = 60;
int h = 50;
std::vector<vpImagePoint> polygon;
polygon.clear();
if (save) {
std::string filename = "canvas_color.png";
std::cout << "Save " << filename << std::endl;
}
}
{
unsigned char color = 255;
font.
drawText(I,
"Test...", iP1, color);
font.
drawText(I,
"Test...", iP1, 0, 255);
int w = 60;
int h = 50;
std::vector<vpImagePoint> polygon;
polygon.clear();
if (save) {
std::string filename = "canvas_gray.png";
std::cout << "Save " << filename << std::endl;
}
}
return EXIT_SUCCESS;
}
static void drawCircle(vpImage< unsigned char > &I, const vpImagePoint ¢er, unsigned int radius, unsigned char color, unsigned int thickness=1)
static const vpColor orange
Generic class defining intrinsic camera parameters.
static void drawArrow(vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, unsigned char color, unsigned int w=4, unsigned int h=2, unsigned int thickness=1)
static const vpColor yellow
static void drawDottedLine(vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, unsigned char color, unsigned int thickness=1)
static void drawFrame(vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, double size, unsigned char color, unsigned int thickness=1, const vpImagePoint &offset=vpImagePoint(0, 0))
Class that consider the case of a translation vector.
static void drawPoint(vpImage< unsigned char > &I, const vpImagePoint &ip, unsigned char color, unsigned int thickness=1)
static const vpColor cyan
static void write(const vpImage< unsigned char > &I, const std::string &filename)
static const vpColor green
Implementation of a rotation matrix and operations on such kind of matrices.
static void drawCross(vpImage< unsigned char > &I, const vpImagePoint &ip, unsigned int size, unsigned char color, unsigned int thickness=1)
static const vpColor black
static void drawPolygon(vpImage< unsigned char > &I, const std::vector< vpImagePoint > &vip, unsigned char color, unsigned int thickness=1, bool closed=true)
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
static const vpColor none
Font drawing functions for image.
static const vpColor white
bool drawText(vpImage< unsigned char > &I, const std::string &text, const vpImagePoint &position, unsigned char color) const
static const vpColor blue
Implementation of an homogeneous matrix and operations on such kind of matrices.
Implementation of a rotation vector as Euler angle minimal representation.
static void drawRectangle(vpImage< unsigned char > &I, const vpRect &rectangle, unsigned char color, bool fill=false, unsigned int thickness=1)
Defines a rectangle in the plane.
static void drawLine(vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, unsigned char color, unsigned int thickness=1)