40#include <visp3/core/vpFont.h>
41#include <visp3/core/vpImageDraw.h>
42#include <visp3/io/vpImageIo.h>
44int main(
int argc,
char *argv[])
46#ifdef ENABLE_VISP_NAMESPACE
52 for (
int i = 1;
i < argc;
i++) {
53 if (std::string(argv[i]) ==
"--save") {
56 else if (std::string(argv[i]) ==
"--mono") {
59 else if (std::string(argv[i]) ==
"--help" || std::string(argv[i]) ==
"-h") {
60 std::cout <<
"\nUsage: " << argv[0] <<
" [--save] [--mono (GENERIC_MONOSPACE font)] [--help] [-h]\n" << std::endl;
64 std::cout <<
"Save: " << save << std::endl;
66 const std::string
visp =
"ViSP: Open source Visual Servoing Platform";
81 vpFont font(32, font_family);
96 vpFont font2(26, font_family);
177 vpRect rectangle(iP1, iP2);
180 std::vector<vpImagePoint> polygon;
195 std::string
filename =
"canvas_color.png";
196 std::cout <<
"Save " <<
filename << std::endl;
205 unsigned char color = 255;
215 vpFont font(32, font_family);
216 font.drawText(I,
"Test...", iP1, color);
220 font.drawText(I,
"...tse", iP1, color);
224 font.drawText(I,
"&é(-è_çà)", iP1, color);
228 font.drawText(I,
"Test...", iP1, 0, 255);
230 vpFont font2(20, font_family);
233 font2.drawText(I,
visp, textPos, 255);
310 vpRect rectangle(iP1, iP2);
313 std::vector<vpImagePoint> polygon;
328 std::string
filename =
"canvas_gray.png";
329 std::cout <<
"Save " <<
filename << std::endl;
Generic class defining intrinsic camera parameters.
static const vpColor white
static const vpColor cyan
static const vpColor none
static const vpColor orange
static const vpColor darkRed
static const vpColor blue
static const vpColor darkGreen
static const vpColor yellow
static const vpColor black
static const vpColor green
Font drawing functions for image.
Implementation of an homogeneous matrix and operations on such kind of matrices.
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 void drawRectangle(vpImage< unsigned char > &I, const vpRect &rectangle, unsigned char color, bool fill=false, unsigned int thickness=1)
static void drawCircle(vpImage< unsigned char > &I, const vpImageCircle &circle, unsigned char color, unsigned int thickness=1)
static void drawLine(vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, unsigned char color, unsigned int thickness=1)
static void drawPoint(vpImage< unsigned char > &I, const vpImagePoint &ip, 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))
static void drawPolygon(vpImage< unsigned char > &I, const std::vector< vpImagePoint > &vip, unsigned char color, unsigned int thickness=1, bool closed=true)
static void drawCross(vpImage< unsigned char > &I, const vpImagePoint &ip, unsigned int size, unsigned char color, unsigned int thickness=1)
static void drawDottedLine(vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, unsigned char color, unsigned int thickness=1)
static void write(const vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition of the vpImage class member functions.
Defines a rectangle in the plane.
Implementation of a rotation matrix and operations on such kind of matrices.
Implementation of a rotation vector as Euler angle minimal representation.
Class that consider the case of a translation vector.