37#include <visp3/core/vpConfig.h>
38#ifndef DOXYGEN_SHOULD_SKIP_THIS
40#include <visp3/core/vpMath.h>
41#include <visp3/core/vpMeterPixelConversion.h>
42#include <visp3/core/vpPixelMeterConversion.h>
43#include <visp3/gui/vpPlotGraph.h>
46#include <visp3/gui/vpDisplayD3D.h>
47#include <visp3/gui/vpDisplayGDI.h>
48#include <visp3/gui/vpDisplayGTK.h>
49#include <visp3/gui/vpDisplayOpenCV.h>
50#include <visp3/gui/vpDisplayX.h>
56#if defined(VISP_HAVE_DISPLAY)
58int laFonctionSansNom(
double delta);
61vpPlotGraph::vpPlotGraph()
62 : xorg(0.), yorg(0.), zoomx(1.), zoomy(1.), xmax(10), ymax(10), xmin(0), ymin(-10), xdelt(1), ydelt(1), gridx(true),
63 gridy(true), gridColor(), curveNbr(1), curveList(NULL), scaleInitialized(false), firstPoint(true), nbDivisionx(10),
64 nbDivisiony(10), topLeft(), width(0), height(0), graphZone(), dTopLeft(), dWidth(0), dHeight(0), dGraphZone(),
65 dTopLeft3D(), dGraphZone3D(), cam(), cMo(), cMf(), w_xval(0), w_xsize(0), w_yval(0), w_ysize(0), w_zval(0),
66 w_zsize(0), ptXorg(0), ptYorg(0), ptZorg(0), zoomx_3D(1.), zoomy_3D(1.), zoomz_3D(1.), nbDivisionz(10), zorg(1.),
67 zoomz(1.), zmax(10), zmin(-10), zdelt(1), old_iPr(), old_iPz(), blockedr(false), blockedz(false), blocked(false),
68 epsi(5), epsj(6), dispUnit(false), dispTitle(false), dispLegend(false), gridThickness(1)
70 gridColor.setColor(200, 200, 200);
78vpPlotGraph::~vpPlotGraph()
80 if (curveList != NULL) {
86void vpPlotGraph::initGraph(
unsigned int nbCurve)
88 curveList =
new vpPlotCurve[nbCurve];
93 for (
unsigned int i = 0; i < curveNbr; i++) {
94 (curveList + i)->color = colors[i % 6];
95 (curveList + i)->curveStyle = vpPlotCurve::line;
96 (curveList + i)->pointListx.clear();
97 (curveList + i)->pointListy.clear();
98 (curveList + i)->legend.clear();
102void vpPlotGraph::initSize(
vpImagePoint top_left,
unsigned int w,
unsigned int h,
unsigned int margei,
105 this->topLeft = top_left;
108 graphZone.setTopLeft(topLeft);
109 graphZone.setWidth(width);
110 graphZone.setHeight(height);
112 this->dTopLeft =
vpImagePoint(topLeft.get_i() + margei, topLeft.get_j() + margej);
113 this->dWidth = width - margej - 10;
114 this->dHeight = height - 2 * margei;
115 dGraphZone.setTopLeft(dTopLeft);
116 dGraphZone.setWidth(dWidth + 1);
117 dGraphZone.setHeight(dHeight + 1);
119 this->dTopLeft3D =
vpImagePoint(topLeft.get_i() + margei, topLeft.get_j() + 10);
120 dGraphZone3D.setTopLeft(dTopLeft3D);
121 dGraphZone3D.setWidth(dWidth + 1);
122 dGraphZone3D.setHeight(dHeight + 1);
124 if (this->dWidth > this->dHeight) {
126 w_xsize = this->dWidth / this->dHeight;
129 w_yval = w_ysize / 2.0;
130 w_xval = w_xsize / 2.0;
131 w_zval = w_zsize / 2.0;
133 else if (this->dWidth == this->dHeight) {
142 else if (this->dWidth < this->dHeight) {
144 w_ysize = this->dHeight / this->dWidth;
147 w_yval = w_ysize / 2.0;
148 w_xval = w_xsize / 2.0;
149 w_zval = w_zsize / 2.0;
152 cam.initPersProjWithoutDistortion(1000, 1000, this->dWidth / 2.0, this->dHeight / 2.0);
156 cMf.buildFrom(0, 0, cMo[2][3], 0, 0, 0);
159void vpPlotGraph::findPose()
169 iP[1].
set_ij(0, dWidth - 1);
170 iP[2].
set_ij(dHeight - 1, dWidth - 1);
171 iP[3].
set_ij(dHeight - 1, 0);
179 for (
unsigned int i = 0; i < 4; i++) {
192 for (
unsigned int i = 0; i < 4; i++) {
201void vpPlotGraph::computeGraphParameters()
203 zoomx = dWidth / (xmax - xmin);
204 zoomy = dHeight / (ymax - ymin);
205 xorg = dTopLeft.get_j() - (xmin * zoomx);
206 yorg = dTopLeft.get_i() + (ymax * zoomy);
209void vpPlotGraph::setCurveColor(
unsigned int curveNum,
const vpColor &color) { (curveList + curveNum)->color = color; }
211void vpPlotGraph::setTitle(
const std::string &title_)
217void vpPlotGraph::setUnitX(
const std::string &unit_x)
223void vpPlotGraph::setUnitY(
const std::string &unit_y)
229void vpPlotGraph::setUnitZ(
const std::string &unit_z)
235void vpPlotGraph::setLegend(
unsigned int curveNum,
const std::string &newlegend)
237 (curveList + curveNum)->legend = newlegend;
241void vpPlotGraph::setCurveThickness(
unsigned int curveNum,
unsigned int thickness)
243 (curveList + curveNum)->thickness = thickness;
246int laFonctionSansNom(
double delta)
273 computeGraphParameters();
275 xdelt = (xmax - xmin) / nbDivisionx;
276 ydelt = (ymax - ymin) / nbDivisiony;
281 power = laFonctionSansNom(xdelt);
282 for (t = xmin; t <= xmax; t = t + xdelt) {
283 double x = xorg + (zoomx * t);
286 gridColor, gridThickness);
290 if (t + xdelt <= xmax + 1e-10) {
293 ttemp = t * pow(10.0, power);
296 std::stringstream valeur;
299#if defined(VISP_HAVE_X11)
301#elif defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
307 std::stringstream ss;
310#if defined(VISP_HAVE_X11)
313#elif defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
319 power = laFonctionSansNom(ydelt);
320 for (t = ymin; t <= ymax; t = t + ydelt) {
321 double y = yorg - (zoomy * t);
324 gridColor, gridThickness);
330 ttemp = t * pow(10.0, power);
334 std::stringstream valeur;
337#if defined(VISP_HAVE_X11)
339#elif defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
344 std::stringstream ss;
347#if defined(VISP_HAVE_X11)
350#elif defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
358 vpColor::black, 4 * gridThickness, 2 * gridThickness, gridThickness);
361 vpColor::black, 4 * gridThickness, 2 * gridThickness, gridThickness);
374#
if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || \
375 defined(VISP_HAVE_GTK)
382#if defined(VISP_HAVE_X11)
386#elif defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
395 double size = (double)title.size();
404 for (
unsigned int i = 0; i < curveNbr; i++) {
405 size_t offset = epsj * (curveList + i)->legend.size();
408 if (offsetj > dWidth)
411 for (
unsigned int i = 0; i < curveNbr; i++) {
413 (curveList + i)->legend.c_str(), (curveList + i)->color);
417void vpPlotGraph::rescalex(
unsigned int side,
double extremity)
421 xmin = (3 * extremity - xmax) / 2;
424 xmax = (3 * extremity - xmin) / 2;
428 xdelt = (xmax - xmin) / (
double)nbDivisionx;
431void vpPlotGraph::rescaley(
unsigned int side,
double extremity)
435 ymin = (3 * extremity - ymax) / 2;
438 ymax = (3 * extremity - ymin) / 2;
442 ydelt = (ymax - ymin) / (
double)nbDivisiony;
445void vpPlotGraph::initScale(
vpImage<unsigned char> &I,
double x_min,
double x_max,
int nbDivx,
double y_min,
446 double y_max,
int nbDivy,
bool gx,
bool gy)
454 this->nbDivisionx = nbDivx;
455 this->nbDivisiony = nbDivy;
456 computeGraphParameters();
460 scaleInitialized =
true;
463void vpPlotGraph::initScale(
vpImage<unsigned char> &I,
double x_min,
double x_max,
int nbDivx,
double y_min,
464 double y_max,
int nbDivy,
double z_min,
double z_max,
int nbDivz,
bool gx,
bool gy)
474 this->nbDivisionx = nbDivx;
475 this->nbDivisiony = nbDivy;
476 this->nbDivisionz = nbDivz;
477 computeGraphParameters();
481 scaleInitialized =
true;
486 if (!scaleInitialized) {
503 scaleInitialized =
true;
504 computeGraphParameters();
508 if (std::fabs(y) <= std::numeric_limits<double>::epsilon())
509 scaleInitialized =
false;
520 double i = yorg - (zoomy * y);
521 double j = xorg + (zoomx * x);
536 computeGraphParameters();
539 i = yorg - (zoomy * y);
540 j = xorg + (zoomx * x);
545 (curveList + curveNb)->plotPoint(I, iP, x, y);
546#if (!defined VISP_HAVE_X11 && defined FLUSH_ON_PLOT)
556 for (
unsigned int i = 0; i < curveNbr; i++)
557 (curveList + i)->plotList(I, xorg, yorg, zoomx, zoomy);
566 double x = (iP.
get_j() - xorg) / zoomx;
567 double y = (yorg - iP.
get_i()) / zoomy;
570 std::stringstream ss_x;
575 std::stringstream ss_y;
587void vpPlotGraph::resetPointList(
unsigned int curveNum)
589 (curveList + curveNum)->pointListx.clear();
590 (curveList + curveNum)->pointListy.clear();
591 (curveList + curveNum)->pointListz.clear();
592 (curveList + curveNum)->nbPoint = 0;
603 if (!iP1In || !iP2In) {
604 double dTopLeft_i = dTopLeft3D.get_i();
605 double dTopLeft_j = dTopLeft3D.get_j();
606 double dBottomRight_i = dTopLeft_i + dHeight;
607 double dBottomRight_j = dTopLeft_j + dWidth;
613 if (!iP1In && !iP2In) {
614 if (iP1.
get_i() < dTopLeft_i && iP2.
get_i() < dTopLeft_i)
616 if (iP1.
get_i() > dBottomRight_i && iP2.
get_i() > dBottomRight_i)
618 if (iP1.
get_j() < dTopLeft_j || iP1.
get_j() > dBottomRight_j)
620 if (iP1.
get_i() < dTopLeft_i)
621 iP1.
set_i(dTopLeft_i);
623 iP1.
set_i(dBottomRight_i);
624 if (iP2.
get_i() < dTopLeft_i)
625 iP2.
set_i(dTopLeft_i);
627 iP2.
set_i(dBottomRight_i);
630 if (iP1.
get_j() < dTopLeft_j)
631 iP1.
set_j(dTopLeft_j);
632 if (iP1.
get_j() > dBottomRight_j)
633 iP1.
set_j(dBottomRight_j);
634 if (iP1.
get_i() < dTopLeft_i)
635 iP1.
set_i(dTopLeft_i);
636 if (iP1.
get_i() > dBottomRight_i)
637 iP1.
set_i(dBottomRight_i);
641 if (iP2.
get_j() < dTopLeft_j)
642 iP2.
set_j(dTopLeft_j);
643 if (iP2.
get_j() > dBottomRight_j)
644 iP2.
set_j(dBottomRight_j);
645 if (iP2.
get_i() < dTopLeft_i)
646 iP2.
set_i(dTopLeft_i);
647 if (iP2.
get_i() > dBottomRight_i)
648 iP2.
set_i(dBottomRight_i);
653 else if (fabs(iP2.
get_i() - iP1.
get_i()) <= 2) {
654 if (!iP1In && !iP2In) {
655 if (iP1.
get_j() < dTopLeft_j && iP2.
get_j() < dTopLeft_j)
657 if (iP1.
get_j() > dBottomRight_j && iP2.
get_j() > dBottomRight_j)
659 if (iP1.
get_i() < dTopLeft_i || iP1.
get_i() > dBottomRight_i)
661 if (iP1.
get_j() < dTopLeft_j)
662 iP1.
set_j(dTopLeft_j);
664 iP1.
set_j(dBottomRight_j);
665 if (iP2.
get_j() < dTopLeft_j)
666 iP2.
set_j(dTopLeft_j);
668 iP2.
set_j(dBottomRight_j);
671 if (iP1.
get_j() < dTopLeft_j)
672 iP1.
set_j(dTopLeft_j);
673 if (iP1.
get_j() > dBottomRight_j)
674 iP1.
set_j(dBottomRight_j);
675 if (iP1.
get_i() < dTopLeft_i)
676 iP1.
set_i(dTopLeft_i);
677 if (iP1.
get_i() > dBottomRight_i)
678 iP1.
set_i(dBottomRight_i);
682 if (iP2.
get_j() < dTopLeft_j)
683 iP2.
set_j(dTopLeft_j);
684 if (iP2.
get_j() > dBottomRight_j)
685 iP2.
set_j(dBottomRight_j);
686 if (iP2.
get_i() < dTopLeft_i)
687 iP2.
set_i(dTopLeft_i);
688 if (iP2.
get_i() > dBottomRight_i)
689 iP2.
set_i(dBottomRight_i);
698 double jtop = (dTopLeft_i - b) / a;
699 double jlow = (dBottomRight_i - b) / a;
701 double ileft = dTopLeft_j * a + b;
702 double iright = (dBottomRight_j)*a + b;
707 if (jtop >= dTopLeft_j && jtop <= dBottomRight_j) {
708 iP[n].
set_ij(dTopLeft_i, jtop);
711 if (jlow >= dTopLeft_j && jlow <= dBottomRight_j) {
712 iP[n].
set_ij(dBottomRight_i, jlow);
715 if (ileft >= dTopLeft_i && ileft <= dBottomRight_i && n < 2) {
716 iP[n].
set_ij(ileft, dTopLeft_j);
719 if (iright >= dTopLeft_i && iright <= dBottomRight_i && n < 2) {
720 iP[n].
set_ij(iright, dBottomRight_j);
727 if (!iP1In && !iP2In) {
732 if (sign ==
vpMath::sign(iP[0].get_j() - iP[1].get_j())) {
745 if (sign ==
vpMath::sign(iP[0].get_i() - iP[1].get_i())) {
759 if (fabs(iP[0].get_j() - iP2.
get_j()) > 5) {
774 if (fabs(iP[0].get_i() - iP2.
get_i()) > 5) {
796 if (fabs(iP[0].get_j() - iP1.
get_j()) > 5) {
811 if (fabs(iP[0].get_i() - iP1.
get_i()) > 5) {
836 if (iP.
get_i() < dTopLeft3D.get_i())
837 iP.
set_i(dTopLeft3D.get_i());
838 else if (iP.
get_i() > dTopLeft3D.get_i() + dHeight)
839 iP.
set_i(dTopLeft3D.get_i() + dHeight - 1);
840 if (iP.
get_j() < dTopLeft3D.get_j())
841 iP.
set_j(dTopLeft3D.get_j());
842 else if (iP.
get_j() > dTopLeft3D.get_j() + dWidth)
843 iP.
set_j(dTopLeft3D.get_j() + dWidth - 1);
849void vpPlotGraph::computeGraphParameters3D()
851 zoomx_3D = w_xsize / (xmax - xmin);
852 zoomy_3D = w_ysize / (ymax - ymin);
853 zoomz_3D = w_zsize / (zmax - zmin);
854 ptXorg = w_xval - zoomx_3D * xmax;
855 ptYorg = w_yval + zoomy_3D * ymin;
856 ptZorg = w_zval - zoomz_3D * zmax;
875 computeGraphParameters3D();
877 xdelt = (xmax - xmin) / nbDivisionx;
878 ydelt = (ymax - ymin) / nbDivisiony;
879 zdelt = (zmax - zmin) / nbDivisionz;
890 for (
unsigned int i = 0; i < 6; i++) {
892 double u = 0.0, v = 0.0;
895 iP[i] = iP[i] + dTopLeft3D;
908 power = laFonctionSansNom(xdelt);
911 if (std::fabs(iP[0].get_j() - iP[1].get_j()) >
912 vpMath::maximum(std::fabs(iP[0].get_j()), std::fabs(iP[1].get_j())) * std::numeric_limits<double>::epsilon())
913 pente = fabs((iP[0].get_i() - iP[1].get_i()) / (iP[0].get_j() - iP[1].get_j()));
917 unsigned int count = 1;
918 for (t = xmin; t <= xmax; t = t + xdelt) {
919 double x = ptXorg + (zoomx_3D * t);
922 double u = 0.0, v = 0.0;
925 iPunit = iPunit + dTopLeft3D;
927 getGrid3DPoint(pente, iPunit, ip1, ip2, ip3);
929 if (check3Dline(ip1, ip2)) {
931 if (count % 2 == 1) {
934 ttemp = t * pow(10.0, power);
937 std::stringstream ss;
947 std::stringstream ss;
950 if (check3Dpoint(ip4))
954 power = laFonctionSansNom(ydelt);
957 if (std::fabs(iP[2].get_j() - iP[3].get_j()) >
958 vpMath::maximum(std::fabs(iP[2].get_j()), std::fabs(iP[3].get_j())) * std::numeric_limits<double>::epsilon())
959 pente = fabs((iP[2].get_i() - iP[3].get_i()) / (iP[2].get_j() - iP[3].get_j()));
963 for (t = ymin; t <= ymax; t = t + ydelt) {
964 double y = ptYorg - (zoomy_3D * t);
967 double u = 0.0, v = 0.0;
970 iPunit = iPunit + dTopLeft3D;
972 getGrid3DPoint(pente, iPunit, ip1, ip2, ip3);
974 if (check3Dline(ip1, ip2)) {
976 if (count % 2 == 1) {
979 ttemp = t * pow(10.0, power);
982 std::stringstream ss;
992 std::stringstream ss;
995 if (check3Dpoint(ip4))
999 power = laFonctionSansNom(zdelt);
1002 if (std::fabs(iP[4].get_j() - iP[5].get_j()) >
1003 vpMath::maximum(std::fabs(iP[4].get_j()), std::fabs(iP[5].get_j())) * std::numeric_limits<double>::epsilon())
1004 pente = fabs((iP[4].get_i() - iP[5].get_i()) / (iP[4].get_j() - iP[5].get_j()));
1008 for (t = zmin; t <= zmax; t = t + zdelt) {
1009 double z = ptZorg + (zoomz_3D * t);
1012 double u = 0.0, v = 0.0;
1015 iPunit = iPunit + dTopLeft3D;
1017 getGrid3DPoint(pente, iPunit, ip1, ip2, ip3);
1019 if (check3Dline(ip1, ip2)) {
1021 if (count % 2 == 1) {
1024 ttemp = t * pow(10.0, power);
1027 std::stringstream ss;
1037 std::stringstream ss;
1040 if (check3Dpoint(ip4))
1045 if (check3Dline(iP[0], iP[1])) {
1048 iPunit.
set_ij(iP[1].get_i(), iP[1].get_j() - 10 * epsj);
1049 check3Dpoint(iPunit);
1053 if (check3Dline(iP[3], iP[2])) {
1056 iPunit.
set_ij(iP[2].get_i(), iP[2].get_j() - 10 * epsj);
1057 check3Dpoint(iPunit);
1061 if (check3Dline(iP[4], iP[5])) {
1064 iPunit.
set_ij(iP[5].get_i(), iP[5].get_j() - 10 * epsj);
1065 check3Dpoint(iPunit);
1079 if (!scaleInitialized) {
1104 scaleInitialized =
true;
1105 computeGraphParameters3D();
1109 if (std::fabs(y) <= std::numeric_limits<double>::epsilon() ||
1110 std::fabs(z) <= std::numeric_limits<double>::epsilon())
1111 scaleInitialized =
false;
1121 bool changed =
false;
1126 else if (x < xmin) {
1135 else if (y < ymin) {
1144 else if (z < zmin) {
1151 if (changed || move(I, button)) {
1152 computeGraphParameters3D();
1157 pointPlot.
setWorldCoordinates(ptXorg + (zoomx_3D * x), ptYorg - (zoomy_3D * y), ptZorg + (zoomz_3D * z));
1158 pointPlot.
track(cMo);
1159 double u = 0.0, v = 0.0;
1163 iP = iP + dTopLeft3D;
1165 if ((curveList + curveNb)->nbPoint) {
1166 if (check3Dline((curveList + curveNb)->lastPoint, iP))
1168 (curveList + curveNb)->thickness);
1170#if (defined VISP_HAVE_X11 || defined VISP_HAVE_GDI)
1176 if (iP.
get_i() <= (curveList + curveNb)->lastPoint.get_i()) {
1177 top = iP.
get_i() - 5;
1178 height_ = (curveList + curveNb)->lastPoint.get_i() - top + 10;
1181 top = (curveList + curveNb)->lastPoint.get_i() - 5;
1182 height_ = iP.
get_i() - top + 10;
1184 if (iP.
get_j() <= (curveList + curveNb)->lastPoint.get_j()) {
1185 left = iP.
get_j() - 5;
1186 width_ = (curveList + curveNb)->lastPoint.get_j() - left + 10;
1189 left = (curveList + curveNb)->lastPoint.get_j() - 5;
1190 width_ = iP.
get_j() - left + 10;
1195 (curveList + curveNb)->lastPoint = iP;
1196 (curveList + curveNb)->pointListx.push_back(x);
1197 (curveList + curveNb)->pointListy.push_back(y);
1198 (curveList + curveNb)->pointListz.push_back(z);
1199 (curveList + curveNb)->nbPoint++;
1201#if (!defined VISP_HAVE_X11 && defined FLUSH_ON_PLOT)
1212 for (
unsigned int i = 0; i < curveNbr; i++) {
1213 std::list<double>::const_iterator it_ptListx = (curveList + i)->pointListx.begin();
1214 std::list<double>::const_iterator it_ptListy = (curveList + i)->pointListy.begin();
1215 std::list<double>::const_iterator it_ptListz = (curveList + i)->pointListz.begin();
1220 while (k < (curveList + i)->nbPoint) {
1221 double x = *it_ptListx;
1222 double y = *it_ptListy;
1223 double z = *it_ptListz;
1224 pointPlot.
setWorldCoordinates(ptXorg + (zoomx_3D * x), ptYorg - (zoomy_3D * y), ptZorg + (zoomz_3D * z));
1225 pointPlot.
track(cMo);
1226 double u = 0.0, v = 0.0;
1229 iP = iP + dTopLeft3D;
1233 if (check3Dline((curveList + i)->lastPoint, iP))
1238 (curveList + i)->lastPoint = iP;
1249void vpPlotGraph::rescalez(
unsigned int side,
double extremity)
1253 zmin = (3 * extremity - zmax) / 2;
1256 zmax = (3 * extremity - zmin) / 2;
1260 zdelt = (zmax - zmin) / (
double)nbDivisionz;
1269 bool changed =
false;
1273 if (std::fabs(displacement[2][3]) > std::numeric_limits<double>::epsilon())
1274 cMf = cMf * displacement;
1277 cMo = cMf * displacement * fMo;
1286 bool clicked =
false;
1287 bool clickedUp =
false;
1313 else if (clickedUp) {
1322 if (!(blockedr || blockedz)) {
1334 double diffi = iP.
get_i() - old_iPr.get_i();
1335 double diffj = iP.
get_j() - old_iPr.get_j();
1337 double anglei = diffi * 360 / width_;
1338 double anglej = diffj * 360 / width_;
1347 double diffi = iP.
get_i() - old_iPz.get_i();
1348 mov.buildFrom(0, 0, diffi * 0.01, 0, 0, 0);
1358#elif !defined(VISP_BUILD_SHARED_LIBS)
1361void dummy_vpPlotGraph() { };
Class to define RGB colors available for display functionalities.
static const vpColor black
static const vpColor cyan
static const vpColor orange
static const vpColor blue
static const vpColor purple
static const vpColor green
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void displayROI(const vpImage< unsigned char > &I, const vpRect &roi)
static void displayLine(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1, bool segment=true)
static void flushROI(const vpImage< unsigned char > &I, const vpRect &roi)
static bool getClickUp(const vpImage< unsigned char > &I, vpImagePoint &ip, vpMouseButton::vpMouseButtonType &button, bool blocking=true)
static void displayArrow(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color=vpColor::white, unsigned int w=4, unsigned int h=2, unsigned int thickness=1)
static void displayDotLine(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)
static bool getPointerPosition(const vpImage< unsigned char > &I, vpImagePoint &ip)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
void track(const vpHomogeneousMatrix &cMo)
Implementation of an homogeneous matrix and operations on such kind of matrices.
vpHomogeneousMatrix inverse() const
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
static double distance(const vpImagePoint &iP1, const vpImagePoint &iP2)
bool inRectangle(const vpRect &rect) const
void set_ij(double ii, double jj)
void set_uv(double u, double v)
Definition of the vpImage class member functions.
unsigned int getWidth() const
unsigned int getHeight() const
static double rad(double deg)
static Type maximum(const Type &a, const Type &b)
static Type minimum(const Type &a, const Type &b)
static int sign(double x)
static _Tp saturate(unsigned char v)
static void convertPoint(const vpCameraParameters &cam, const double &x, const double &y, double &u, double &v)
static void convertPoint(const vpCameraParameters &cam, const double &u, const double &v, double &x, double &y)
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
void set_x(double x)
Set the point x coordinate in the image plane.
double get_y() const
Get the point y coordinate in the image plane.
void set_oY(double oY)
Set the point oY coordinate in the object frame.
double get_x() const
Get the point x coordinate in the image plane.
void set_oZ(double oZ)
Set the point oZ coordinate in the object frame.
void set_oX(double oX)
Set the point oX coordinate in the object frame.
void setWorldCoordinates(double oX, double oY, double oZ)
void set_y(double y)
Set the point y coordinate in the image plane.
Class used for pose computation from N points (pose from point only). Some of the algorithms implemen...
void addPoint(const vpPoint &P)
@ DEMENTHON_LAGRANGE_VIRTUAL_VS
bool computePose(vpPoseMethodType method, vpHomogeneousMatrix &cMo, bool(*func)(const vpHomogeneousMatrix &)=NULL)
Defines a rectangle in the plane.
VISP_EXPORT void sleepMs(double t)