43 #include <visp/vpConfig.h>
44 #ifndef DOXYGEN_SHOULD_SKIP_THIS
46 #include <visp/vpPlotGraph.h>
47 #include <visp/vpMath.h>
48 #include <visp/vpMeterPixelConversion.h>
49 #include <visp/vpPixelMeterConversion.h>
50 #include <visp/vpPose.h>
52 #include <visp/vpDisplayOpenCV.h>
53 #include <visp/vpDisplayX.h>
54 #include <visp/vpDisplayGDI.h>
55 #include <visp/vpDisplayGTK.h>
56 #include <visp/vpDisplayD3D.h>
59 #include <visp/vpMath.h>
62 #if defined(VISP_HAVE_DISPLAY)
64 vpPlotGraph::vpPlotGraph()
68 gridColor.setColor(200,200,200);
85 scaleInitialized =
false;
105 vpPlotGraph::~vpPlotGraph()
107 if (curveList != NULL)
115 vpPlotGraph::initGraph (
unsigned int nbCurve)
117 curveList =
new vpPlotCurve[nbCurve];
122 for (
unsigned int i = 0; i < curveNbr; i++)
124 (curveList+i)->color = colors[i%6];
125 (curveList+i)->curveStyle = line;
126 (curveList+i)->pointListx.clear();
127 (curveList+i)->pointListy.clear();
128 strcpy((curveList+i)->legend,
"");
133 vpPlotGraph::initSize (
vpImagePoint topLeft,
unsigned int width,
unsigned int height,
unsigned int margei,
unsigned int margej)
135 this->topLeft = topLeft;
137 this->height = height;
138 graphZone.setTopLeft(topLeft);
139 graphZone.setWidth(width);
140 graphZone.setHeight(height);
143 this->dWidth = width-margej-10;
144 this->dHeight = height-2*margei;
145 dGraphZone.setTopLeft(dTopLeft);
146 dGraphZone.setWidth(dWidth+1);
147 dGraphZone.setHeight(dHeight+1);
150 dGraphZone3D.setTopLeft(dTopLeft3D);
151 dGraphZone3D.setWidth(dWidth+1);
152 dGraphZone3D.setHeight(dHeight+1);
154 if (this->dWidth > this->dHeight)
157 w_xsize = this->dWidth/this->dHeight;
160 w_yval = w_ysize/2.0;
161 w_xval = w_xsize/2.0;
162 w_zval = w_zsize/2.0;
164 else if (this->dWidth == this->dHeight)
174 else if (this->dWidth < this->dHeight)
177 w_ysize = this->dHeight/this->dWidth;
180 w_yval = w_ysize/2.0;
181 w_xval = w_xsize/2.0;
182 w_zval = w_zsize/2.0;
189 cMf.buildFrom(0,0,cMo[2][3],0,0,0);
194 vpPlotGraph::findPose()
205 iP[2].
set_ij(dHeight-1,dWidth-1);
206 iP[3].
set_ij(dHeight-1,0);
212 for (
unsigned int i=0 ; i < 4 ; i++)
225 vpPlotGraph::computeGraphParameters()
227 zoomx = dWidth/(xmax-xmin);
228 zoomy = dHeight/(ymax-ymin);
229 xorg = dTopLeft.
get_j() - (xmin*zoomx);
230 yorg = dTopLeft.get_i() + (ymax*zoomy);
234 vpPlotGraph::setCurveColor(
const unsigned int curveNum,
const vpColor color)
236 (curveList+curveNum)->color = color;
240 vpPlotGraph::setTitle (
const char *title)
242 strcpy(this->title, title);
247 vpPlotGraph::setUnitX (
const char *unitx)
249 strcpy(this->unitx, unitx);
254 vpPlotGraph::setUnitY (
const char *unity)
256 strcpy(this->unity, unity);
261 vpPlotGraph::setUnitZ (
const char *unitz)
263 strcpy(this->unitz, unitz);
268 vpPlotGraph::setLegend (
const unsigned int curveNum,
const char *legend)
270 strcpy((curveList+curveNum)->legend,legend);
275 vpPlotGraph::setCurveThickness(
const unsigned int curveNum,
const unsigned int thickness)
277 (curveList+curveNum)->thickness = thickness;
281 laFonctionSansNom (
const double delta)
313 computeGraphParameters();
315 xdelt = (xmax-xmin)/nbDivisionx;
316 ydelt = (ymax-ymin)/nbDivisiony;
322 power = laFonctionSansNom(xdelt);
323 for(t=xmin;t<=xmax;t=t+xdelt)
325 double x = xorg+(zoomx*t);
331 if (t+xdelt <= xmax+1e-10)
335 ttemp = t*pow(10.0,power);
337 sprintf(valeur,
"%.2f", ttemp);
338 #if defined VISP_HAVE_X11
340 #elif defined (VISP_HAVE_GDI) || defined (VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
347 sprintf(valeur,
"x10e%d", -power);
348 #if defined VISP_HAVE_X11
350 #elif defined (VISP_HAVE_GDI) || defined (VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
355 power = laFonctionSansNom(ydelt);
356 for(t=ymin;t<=ymax;t=t+ydelt)
358 double y = yorg-(zoomy*t);
366 ttemp = t*pow(10.0,power);
369 sprintf(valeur,
"%.2f", ttemp);
370 #if defined VISP_HAVE_X11
372 #elif defined (VISP_HAVE_GDI) || defined (VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
378 sprintf(valeur,
"x10e%d", -power);
379 #if defined VISP_HAVE_X11
381 #elif defined (VISP_HAVE_GDI) || defined (VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
403 #
if defined(VISP_HAVE_X11) || defined (VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
408 unsigned int offsetx = vpMath::minimum<unsigned int>((
unsigned int)strlen(unitx), dWidth);
410 #if defined VISP_HAVE_X11
413 #elif defined (VISP_HAVE_GDI) || defined (VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
422 double size = (double)strlen(title);
426 dTopLeft.get_j()+dWidth/2.0-4*size),
435 for (
unsigned int i = 0; i < curveNbr; i++) {
436 size_t offset = epsj * strlen((curveList+i)->legend);
439 if (offsetj > dWidth) offsetj = dWidth;
441 for (
unsigned int i = 0; i < curveNbr; i++) {
444 dTopLeft.get_j()+dWidth-offsetj),
445 (curveList+i)->legend,
446 (curveList+i)->color);
451 vpPlotGraph::rescalex(
unsigned int side,
double extremity)
456 xmin = (3*extremity-xmax)/2;
459 xmax = (3*extremity-xmin)/2;
463 xdelt = (xmax-xmin)/(
double)nbDivisionx;
467 vpPlotGraph::rescaley(
unsigned int side,
double extremity)
472 ymin = (3*extremity-ymax)/2;
475 ymax = (3*extremity-ymin)/2;
479 ydelt = (ymax-ymin)/(
double)nbDivisiony;
483 vpPlotGraph::initScale(
vpImage<unsigned char> &I,
const double xmin,
const double xmax,
const int nbDivx,
const double ymin,
const double ymax,
const int nbDivy,
const bool gx,
const bool gy)
491 this->nbDivisionx = nbDivx;
492 this->nbDivisiony = nbDivy;
493 computeGraphParameters();
497 scaleInitialized =
true;
502 vpPlotGraph::initScale(
vpImage<unsigned char> &I,
const double xmin,
const double xmax,
const int nbDivx,
const double ymin,
const double ymax,
const int nbDivy,
const double zmin,
const double zmax,
const int nbDivz,
const bool gx,
const bool gy)
512 this->nbDivisionx = nbDivx;
513 this->nbDivisiony = nbDivy;
514 this->nbDivisionz = nbDivz;
515 computeGraphParameters();
519 scaleInitialized =
true;
525 if (!scaleInitialized)
547 scaleInitialized =
true;
548 computeGraphParameters();
552 if (std::fabs(y) <= std::numeric_limits<double>::epsilon())
553 scaleInitialized =
false;
565 double i = yorg-(zoomy*y);
566 double j = xorg+(zoomx*x);
572 if (x > xmax) rescalex(1,x);
573 else if(x < xmin) rescalex(0,x);
575 if (y > ymax) rescaley(1,y);
576 else if(y < ymin) rescaley(0,y);
578 computeGraphParameters();
587 (curveList+curveNb)->plotPoint(I, iP, x, y);
588 #if (!defined VISP_HAVE_X11 && defined FLUSH_ON_PLOT)
599 for (
unsigned int i = 0; i < curveNbr; i++)
600 (curveList+i)->plotList(I,xorg,yorg,zoomx,zoomy);
615 double x = (iP.
get_j()-xorg)/zoomx;
616 double y = (yorg-iP.
get_i())/zoomy;
620 sprintf(valeur,
" x: %f", x);
622 sprintf(valeur,
" y: %f", y);
632 vpPlotGraph::resetPointList(
const unsigned int curveNum)
634 (curveList+curveNum)->pointListx.clear();
635 (curveList+curveNum)->pointListy.clear();
636 (curveList+curveNum)->pointListz.clear();
637 (curveList+curveNum)->nbPoint = 0;
650 if (!iP1In || !iP2In)
652 double dTopLeft_i = dTopLeft3D.get_i();
653 double dTopLeft_j = dTopLeft3D.get_j();
654 double dBottomRight_i = dTopLeft_i+dHeight;
655 double dBottomRight_j = dTopLeft_j+dWidth;
662 if (!iP1In && !iP2In)
664 if (iP1.
get_i() < dTopLeft_i && iP2.
get_i() < dTopLeft_i)
666 if (iP1.
get_i() > dBottomRight_i && iP2.
get_i() > dBottomRight_i)
668 if (iP1.
get_j() < dTopLeft_j || iP1.
get_j() > dBottomRight_j)
670 if (iP1.
get_i() < dTopLeft_i) iP1.
set_i(dTopLeft_i);
671 else iP1.
set_i(dBottomRight_i);
672 if (iP2.
get_i() < dTopLeft_i) iP2.
set_i(dTopLeft_i);
673 else iP2.
set_i(dBottomRight_i);
677 if (iP1.
get_j() < dTopLeft_j) iP1.
set_j(dTopLeft_j);
678 if (iP1.
get_j() > dBottomRight_j) iP1.
set_j(dBottomRight_j);
679 if (iP1.
get_i() < dTopLeft_i) iP1.
set_i(dTopLeft_i);
680 if (iP1.
get_i() > dBottomRight_i) iP1.
set_i(dBottomRight_i);
685 if (iP2.
get_j() < dTopLeft_j) iP2.
set_j(dTopLeft_j);
686 if (iP2.
get_j() > dBottomRight_j) iP2.
set_j(dBottomRight_j);
687 if (iP2.
get_i() < dTopLeft_i) iP2.
set_i(dTopLeft_i);
688 if (iP2.
get_i() > dBottomRight_i) iP2.
set_i(dBottomRight_i);
695 if (!iP1In && !iP2In)
697 if (iP1.
get_j() < dTopLeft_j && iP2.
get_j() < dTopLeft_j)
699 if (iP1.
get_j() > dBottomRight_j && iP2.
get_j() > dBottomRight_j)
701 if (iP1.
get_i() < dTopLeft_i || iP1.
get_i() > dBottomRight_i)
703 if (iP1.
get_j() < dTopLeft_j) iP1.
set_j(dTopLeft_j);
704 else iP1.
set_j(dBottomRight_j);
705 if (iP2.
get_j() < dTopLeft_j) iP2.
set_j(dTopLeft_j);
706 else iP2.
set_j(dBottomRight_j);
710 if (iP1.
get_j() < dTopLeft_j) iP1.
set_j(dTopLeft_j);
711 if (iP1.
get_j() > dBottomRight_j) iP1.
set_j(dBottomRight_j);
712 if (iP1.
get_i() < dTopLeft_i) iP1.
set_i(dTopLeft_i);
713 if (iP1.
get_i() > dBottomRight_i) iP1.
set_i(dBottomRight_i);
718 if (iP2.
get_j() < dTopLeft_j) iP2.
set_j(dTopLeft_j);
719 if (iP2.
get_j() > dBottomRight_j) iP2.
set_j(dBottomRight_j);
720 if (iP2.
get_i() < dTopLeft_i) iP2.
set_i(dTopLeft_i);
721 if (iP2.
get_i() > dBottomRight_i) iP2.
set_i(dBottomRight_i);
730 double jtop = (dTopLeft_i-b)/a;
731 double jlow = (dBottomRight_i-b)/a;
733 double ileft = dTopLeft_j*a+b;
734 double iright = (dBottomRight_j)*a+b;
739 if(jtop >= dTopLeft_j && jtop <= dBottomRight_j)
741 iP[n].
set_ij(dTopLeft_i,jtop);
744 if(jlow >= dTopLeft_j && jlow <= dBottomRight_j)
746 iP[n].
set_ij(dBottomRight_i,jlow);
749 if(ileft >= dTopLeft_i && ileft <= dBottomRight_i && n <2)
751 iP[n].
set_ij(ileft,dTopLeft_j);
754 if(iright >= dTopLeft_i && iright <= dBottomRight_i && n <2)
756 iP[n].
set_ij(iright,dBottomRight_j);
763 if (!iP1In && !iP2In)
772 iP1 = iP[0]; iP2 = iP[1];
776 iP1 = iP[1]; iP2 = iP[0];
786 iP1 = iP[0];iP2 = iP[1];
790 iP1 = iP[1];iP2 = iP[0];
800 if (fabs(iP[0].get_j()-iP2.
get_j()) > 5)
814 if (fabs(iP[0].get_i()-iP2.
get_i()) > 5)
837 if (fabs(iP[0].get_j()-iP1.
get_j()) > 5)
851 if (fabs(iP[0].get_i()-iP1.
get_i()) > 5)
877 if (iP.
get_i() < dTopLeft3D.get_i())
878 iP.
set_i(dTopLeft3D.get_i());
879 else if (iP.
get_i() > dTopLeft3D.get_i()+dHeight)
880 iP.
set_i(dTopLeft3D.get_i()+dHeight-1);
881 if (iP.
get_j() <dTopLeft3D.get_j())
882 iP.
set_j(dTopLeft3D.get_j());
883 else if (iP.
get_j() > dTopLeft3D.get_j()+dWidth)
884 iP.
set_i(dTopLeft3D.get_j()+dWidth-1);
891 vpPlotGraph::computeGraphParameters3D()
893 zoomx_3D = w_xsize/(xmax-xmin);
894 zoomy_3D = w_ysize/(ymax-ymin);
895 zoomz_3D = w_zsize/(zmax-zmin);
896 ptXorg = w_xval - zoomx_3D*xmax;
897 ptYorg = w_yval + zoomy_3D*ymin;
898 ptZorg = w_zval - zoomz_3D*zmax;
920 computeGraphParameters3D();
922 xdelt = (xmax-xmin)/nbDivisionx;
923 ydelt = (ymax-ymin)/nbDivisiony;
924 zdelt = (zmax-zmin)/nbDivisionz;
935 for (
unsigned int i = 0; i < 6; i++)
941 iP[i] = iP[i] + dTopLeft3D;
955 power = laFonctionSansNom(xdelt);
958 if (std::fabs(iP[0].get_j()-iP[1].get_j()) >
959 vpMath::maximum(std::fabs(iP[0].get_j()), std::fabs(iP[1].get_j()))* std::numeric_limits<double>::epsilon())
960 pente = fabs((iP[0].get_i()-iP[1].get_i())/(iP[0].get_j()-iP[1].get_j()));
963 unsigned int count = 1;
964 for(t=xmin;t<=xmax;t=t+xdelt)
966 double x = ptXorg+(zoomx_3D*t);
972 iPunit = iPunit + dTopLeft3D;
974 getGrid3DPoint(pente,iPunit,ip1,ip2,ip3);
976 if(check3Dline(ip1,ip2))
983 ttemp = t*pow(10.0,power);
985 sprintf(valeur,
"%.1f", ttemp);
994 sprintf(valeur,
"x10e%d", -power);
995 if(check3Dpoint(ip4))
999 power = laFonctionSansNom(ydelt);
1002 if (std::fabs(iP[2].get_j()-iP[3].get_j()) >
1003 vpMath::maximum(std::fabs(iP[2].get_j()), std::fabs(iP[3].get_j()))* std::numeric_limits<double>::epsilon())
1004 pente = fabs((iP[2].get_i()-iP[3].get_i())/(iP[2].get_j()-iP[3].get_j()));
1007 for(t=ymin;t<=ymax;t=t+ydelt)
1009 double y = ptYorg-(zoomy_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))
1026 ttemp = t*pow(10.0,power);
1028 sprintf(valeur,
"%.1f", ttemp);
1037 sprintf(valeur,
"x10e%d", -power);
1038 if(check3Dpoint(ip4))
1042 power = laFonctionSansNom(zdelt);
1045 if (std::fabs(iP[4].get_j()-iP[5].get_j()) >
1046 vpMath::maximum(std::fabs(iP[4].get_j()), std::fabs(iP[5].get_j()))* std::numeric_limits<double>::epsilon())
1047 pente = fabs((iP[4].get_i()-iP[5].get_i())/(iP[4].get_j()-iP[5].get_j()));
1050 for(t=zmin;t<=zmax;t=t+zdelt)
1052 double z = ptZorg+(zoomz_3D*t);
1055 double u=0.0, v=0.0;
1058 iPunit = iPunit + dTopLeft3D;
1060 getGrid3DPoint(pente,iPunit,ip1,ip2,ip3);
1062 if(check3Dline(ip1,ip2))
1069 ttemp = t*pow(10.0,power);
1071 sprintf(valeur,
"%.1f", ttemp);
1080 sprintf(valeur,
"x10e%d", -power);
1081 if(check3Dpoint(ip4))
1087 if (check3Dline(iP[0],iP[1]))
1092 vpImagePoint iPunit(iP[1].get_i(),iP[1].get_j()-10*epsj);
1093 check3Dpoint (iPunit);
1097 if (check3Dline(iP[3],iP[2]))
1102 vpImagePoint iPunit(iP[2].get_i(),iP[2].get_j()-10*epsj);
1103 check3Dpoint (iPunit);
1107 if (check3Dline(iP[4],iP[5]))
1112 vpImagePoint iPunit(iP[5].get_i(),iP[5].get_j()-10*epsj);
1113 check3Dpoint (iPunit);
1125 vpPlotGraph::plot (
vpImage<unsigned char> &I,
const unsigned int curveNb,
const double x,
const double y,
const double z)
1127 if (!scaleInitialized)
1159 scaleInitialized =
true;
1160 computeGraphParameters3D();
1164 if (std::fabs(y) <= std::numeric_limits<double>::epsilon() || std::fabs(z) <= std::numeric_limits<double>::epsilon())
1165 scaleInitialized =
false;
1176 bool changed =
false;
1177 if (x > xmax) {rescalex(1,x); changed =
true;}
1178 else if(x < xmin) {rescalex(0,x);changed =
true;}
1180 if (y > ymax) {rescaley(1,y);changed =
true;}
1181 else if(y < ymin) {rescaley(0,y);changed =
true;}
1183 if (z > zmax) {rescalez(1,z);changed =
true;}
1184 else if(z < zmin) {rescalez(0,z);changed =
true;}
1186 if (changed || move(I))
1188 computeGraphParameters3D();
1193 pointPlot.
setWorldCoordinates(ptXorg+(zoomx_3D*x),ptYorg-(zoomy_3D*y),ptZorg+(zoomz_3D*z));
1194 pointPlot.
track(cMo);
1195 double u=0.0, v=0.0;
1199 iP = iP + dTopLeft3D;
1201 (curveList+curveNb)->pointListx.end();
1202 (curveList+curveNb)->pointListy.end();
1203 (curveList+curveNb)->pointListz.end();
1204 if((curveList+curveNb)->nbPoint)
1206 if (check3Dline((curveList+curveNb)->lastPoint,iP))
1207 vpDisplay::displayLine(I,(curveList+curveNb)->lastPoint, iP, (curveList+curveNb)->color, (curveList+curveNb)->thickness);
1209 #if( defined VISP_HAVE_X11 || defined VISP_HAVE_GDI )
1215 if (iP.get_i() <= (curveList+curveNb)->lastPoint.get_i()) {top = iP.get_i()-5; height = (curveList+curveNb)->lastPoint.get_i() - top+10;}
1216 else {top = (curveList+curveNb)->lastPoint.get_i()-5; height = iP.get_i() - top+10;}
1217 if (iP.get_j() <= (curveList+curveNb)->lastPoint.get_j()) {left = iP.get_j()-5; width = (curveList+curveNb)->lastPoint.get_j() - left+10;}
1218 else {left = (curveList+curveNb)->lastPoint.get_j()-5; width = iP.get_j() - left+10;}
1222 (curveList+curveNb)->lastPoint = iP;
1223 (curveList+curveNb)->pointListx.push_back(x);
1224 (curveList+curveNb)->pointListy.push_back(y);
1225 (curveList+curveNb)->pointListz.push_back(z);
1226 (curveList+curveNb)->nbPoint++;
1229 #if( !defined VISP_HAVE_X11 && defined FLUSH_ON_PLOT)
1240 for (
unsigned int i = 0; i < curveNbr; i++)
1242 std::list<double>::const_iterator it_ptListx = (curveList+i)->pointListx.begin();
1243 std::list<double>::const_iterator it_ptListy = (curveList+i)->pointListy.begin();
1244 std::list<double>::const_iterator it_ptListz = (curveList+i)->pointListz.begin();
1250 while (k < (curveList+i)->nbPoint)
1255 pointPlot.
setWorldCoordinates(ptXorg+(zoomx_3D*x),ptYorg-(zoomy_3D*y),ptZorg+(zoomz_3D*z));
1256 pointPlot.
track(cMo);
1257 double u=0.0, v=0.0;
1260 iP = iP + dTopLeft3D;
1265 if (check3Dline((curveList+i)->lastPoint,iP))
1270 (curveList+i)->lastPoint = iP;
1284 vpPlotGraph::rescalez(
unsigned int side,
double extremity)
1289 zmin = (3*extremity-zmax)/2;
1292 zmax = (3*extremity-zmin)/2;
1296 zdelt = (zmax-zmin)/(
double)nbDivisionz;
1302 bool changed =
false;
1306 if (std::fabs(displacement[2][3]) > std::numeric_limits<double>::epsilon())
1307 cMf = cMf*displacement;
1310 cMo = cMf* displacement * fMo;
1319 bool clicked =
false;
1320 bool clickedUp =
false;
1357 if (!(blockedr || blockedz))
1373 double diffi = iP.
get_i() - old_iPr.get_i();
1374 double diffj = iP.
get_j() - old_iPr.get_j();
1376 anglei = diffi*360/width;
1377 anglej = diffj*360/width;
1382 if (blockedr) old_iPr = iP;
1386 double diffi = iP.
get_i() - old_iPz.get_i();
1387 mov.buildFrom(0,0,diffi*0.01,0,0,0);
1391 if (blockedz) old_iPz = iP;
void set_j(const double j)
bool inRectangle(const vpRect &rect) const
virtual void displayArrow(const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color=vpColor::white, unsigned int w=4, unsigned int h=2, unsigned int thickness=1)=0
unsigned int getWidth() const
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
static const vpColor black
static void convertPoint(const vpCameraParameters &cam, const double &x, const double &y, double &u, double &v)
Point coordinates conversion from normalized coordinates in meter to pixel coordinates ...
Class to define colors available for display functionnalities.
void set_i(const double i)
virtual bool getClickUp(vpImagePoint &ip, vpMouseButton::vpMouseButtonType &button, bool blocking=true)=0
void set_x(const double x)
Set the point x coordinate in the image plane.
void track(const vpHomogeneousMatrix &cMo)
static void convertPoint(const vpCameraParameters &cam, const double &u, const double &v, double &x, double &y)
Point coordinates conversion from pixel coordinates to normalized coordinates in meter...
double get_y() const
Get the point y coordinate in the image plane.
static const vpColor green
void set_oX(const double X)
Set the point X coordinate in the object frame.
Class that defines what is a point.
static Type maximum(const Type &a, const Type &b)
static const vpColor orange
void initPersProjWithoutDistortion(const double px, const double py, const double u0, const double v0)
static const vpColor cyan
void set_oZ(const double Z)
Set the point Z coordinate in the object frame.
virtual bool getPointerPosition(vpImagePoint &ip)=0
void set_ij(const double i, const double j)
Class used for pose computation from N points (pose from point only).
void set_y(const double y)
Set the point y coordinate in the image plane.
double get_x() const
Get the point x coordinate in the image plane.
static Type minimum(const Type &a, const Type &b)
static double rad(double deg)
virtual void displayDotLine(const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)=0
virtual void displayCharString(const vpImagePoint &ip, const char *text, const vpColor &color=vpColor::green)=0
vpHomogeneousMatrix inverse() const
unsigned int getHeight() const
void set_uv(const double u, const double v)
Defines a rectangle in the plane.
static void flushROI(const vpImage< unsigned char > &I, const vpRect &roi)
void computePose(vpPoseMethodType methode, vpHomogeneousMatrix &cMo)
compute the pose for a given method
static void displayROI(const vpImage< unsigned char > &I, const vpRect &roi)
virtual bool getClick(bool blocking=true)=0
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
virtual void displayLine(const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)=0
static int sign(double x)
void addPoint(const vpPoint &P)
Add a new point in this array.
static const vpColor purple
static double distance(const vpImagePoint &iP1, const vpImagePoint &iP2)
static const vpColor blue
void setWorldCoordinates(const double ox, const double oy, const double oz)
Set the point world coordinates. We mean here the coordinates of the point in the object frame...
void set_oY(const double Y)
Set the point Y coordinate in the object frame.
void clearPoint()
suppress all the point in the array of point