43 #include <visp/vpConfig.h>
44 #ifndef DOXYGEN_SHOULD_SKIP_THIS
49 #include <visp/vpPlotGraph.h>
50 #include <visp/vpMath.h>
51 #include <visp/vpMeterPixelConversion.h>
52 #include <visp/vpPixelMeterConversion.h>
53 #include <visp/vpPose.h>
55 #include <visp/vpDisplayOpenCV.h>
56 #include <visp/vpDisplayX.h>
57 #include <visp/vpDisplayGDI.h>
59 #include <visp/vpMath.h>
61 #if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)
63 vpPlotGraph::vpPlotGraph()
67 gridColor.setColor(200,200,200);
84 scaleInitialized =
false;
102 vpPlotGraph::~vpPlotGraph()
104 if (curveList != NULL)
112 vpPlotGraph::initGraph (
unsigned int nbCurve)
114 curveList =
new vpPlotCurve[nbCurve];
119 for (
unsigned int i = 0; i < curveNbr; i++)
121 (curveList+i)->color = colors[i%6];
122 (curveList+i)->curveStyle = line;
123 (curveList+i)->pointListx.clear();
124 (curveList+i)->pointListy.clear();
125 strcpy((curveList+i)->legend,
"");
130 vpPlotGraph::initSize (
vpImagePoint topLeft,
unsigned int width,
unsigned int height,
unsigned int margei,
unsigned int margej)
132 this->topLeft = topLeft;
134 this->height = height;
135 graphZone.setTopLeft(topLeft);
136 graphZone.setWidth(width);
137 graphZone.setHeight(height);
140 this->dWidth = width-margej-10;
141 this->dHeight = height-2*margei;
142 dGraphZone.setTopLeft(dTopLeft);
143 dGraphZone.setWidth(dWidth+1);
144 dGraphZone.setHeight(dHeight+1);
147 dGraphZone3D.setTopLeft(dTopLeft3D);
148 dGraphZone3D.setWidth(dWidth+1);
149 dGraphZone3D.setHeight(dHeight+1);
151 if (this->dWidth > this->dHeight)
154 w_xsize = this->dWidth/this->dHeight;
157 w_yval = w_ysize/2.0;
158 w_xval = w_xsize/2.0;
159 w_zval = w_zsize/2.0;
161 else if (this->dWidth == this->dHeight)
171 else if (this->dWidth < this->dHeight)
174 w_ysize = this->dHeight/this->dWidth;
177 w_yval = w_ysize/2.0;
178 w_xval = w_xsize/2.0;
179 w_zval = w_zsize/2.0;
186 cMf.buildFrom(0,0,cMo[2][3],0,0,0);
191 vpPlotGraph::findPose()
202 iP[2].
set_ij(dHeight-1,dWidth-1);
203 iP[3].
set_ij(dHeight-1,0);
209 for (
unsigned int i=0 ; i < 4 ; i++)
222 vpPlotGraph::computeGraphParameters()
224 zoomx = dWidth/(xmax-xmin);
225 zoomy = dHeight/(ymax-ymin);
226 xorg = dTopLeft.
get_j() - (xmin*zoomx);
227 yorg = dTopLeft.get_i() + (ymax*zoomy);
231 vpPlotGraph::setCurveColor(
const unsigned int curveNum,
const vpColor color)
233 (curveList+curveNum)->color = color;
237 vpPlotGraph::setTitle (
const char *title)
239 strcpy(this->title, title);
244 vpPlotGraph::setUnitX (
const char *unitx)
246 strcpy(this->unitx, unitx);
251 vpPlotGraph::setUnitY (
const char *unity)
253 strcpy(this->unity, unity);
258 vpPlotGraph::setUnitZ (
const char *unitz)
260 strcpy(this->unitz, unitz);
265 vpPlotGraph::setLegend (
const unsigned int curveNum,
const char *legend)
267 strcpy((curveList+curveNum)->legend,legend);
272 vpPlotGraph::setCurveThickness(
const unsigned int curveNum,
const unsigned int thickness)
274 (curveList+curveNum)->thickness = thickness;
278 laFonctionSansNom (
const double delta)
310 computeGraphParameters();
312 xdelt = (xmax-xmin)/nbDivisionx;
313 ydelt = (ymax-ymin)/nbDivisiony;
319 power = laFonctionSansNom(xdelt);
320 for(t=xmin;t<=xmax;t=t+xdelt)
322 double x = xorg+(zoomx*t);
328 if (t+xdelt <= xmax+1e-10)
332 ttemp = t*pow(10.0,power);
334 sprintf(valeur,
"%.2f", ttemp);
335 #if defined VISP_HAVE_X11
337 #elif defined (VISP_HAVE_GDI) || defined (VISP_HAVE_OPENCV)
344 sprintf(valeur,
"x10e%d", -power);
345 #if defined VISP_HAVE_X11
347 #elif defined (VISP_HAVE_GDI) || defined (VISP_HAVE_OPENCV)
352 power = laFonctionSansNom(ydelt);
353 for(t=ymin;t<=ymax;t=t+ydelt)
355 double y = yorg-(zoomy*t);
363 ttemp = t*pow(10.0,power);
366 sprintf(valeur,
"%.2f", ttemp);
367 #if defined VISP_HAVE_X11
369 #elif defined (VISP_HAVE_GDI) || defined (VISP_HAVE_OPENCV)
375 sprintf(valeur,
"x10e%d", -power);
376 #if defined VISP_HAVE_X11
378 #elif defined (VISP_HAVE_GDI) || defined (VISP_HAVE_OPENCV)
400 #
if defined(VISP_HAVE_X11) || defined (VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)
405 unsigned int offsetx = vpMath::minimum<unsigned int>((
unsigned int)strlen(unitx), dWidth);
407 #if defined VISP_HAVE_X11
410 #elif defined (VISP_HAVE_GDI) || defined (VISP_HAVE_OPENCV)
419 double size = (double)strlen(title);
423 dTopLeft.get_j()+dWidth/2.0-4*size),
431 unsigned int offsetj = 0;
432 for (
unsigned int i = 0; i < curveNbr; i++) {
433 unsigned int offset = epsj * strlen((curveList+i)->legend);
436 if (offsetj > dWidth) offsetj = dWidth;
438 for (
unsigned int i = 0; i < curveNbr; i++) {
441 dTopLeft.get_j()+dWidth-offsetj),
442 (curveList+i)->legend,
443 (curveList+i)->color);
448 vpPlotGraph::rescalex(
unsigned int side,
double extremity)
453 xmin = (3*extremity-xmax)/2;
456 xmax = (3*extremity-xmin)/2;
460 xdelt = (xmax-xmin)/(
double)nbDivisionx;
464 vpPlotGraph::rescaley(
unsigned int side,
double extremity)
469 ymin = (3*extremity-ymax)/2;
472 ymax = (3*extremity-ymin)/2;
476 ydelt = (ymax-ymin)/(
double)nbDivisiony;
480 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)
488 this->nbDivisionx = nbDivx;
489 this->nbDivisiony = nbDivy;
490 computeGraphParameters();
494 scaleInitialized =
true;
499 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)
509 this->nbDivisionx = nbDivx;
510 this->nbDivisiony = nbDivy;
511 this->nbDivisionz = nbDivz;
512 computeGraphParameters();
516 scaleInitialized =
true;
522 if (!scaleInitialized)
544 scaleInitialized =
true;
545 computeGraphParameters();
549 if (std::fabs(y) <= std::numeric_limits<double>::epsilon())
550 scaleInitialized =
false;
562 double i = yorg-(zoomy*y);
563 double j = xorg+(zoomx*x);
569 if (x > xmax) rescalex(1,x);
570 else if(x < xmin) rescalex(0,x);
572 if (y > ymax) rescaley(1,y);
573 else if(y < ymin) rescaley(0,y);
575 computeGraphParameters();
584 (curveList+curveNb)->plotPoint(I, iP, x, y);
585 #if (!defined VISP_HAVE_X11 && defined FLUSH_ON_PLOT)
596 for (
unsigned int i = 0; i < curveNbr; i++)
597 (curveList+i)->plotList(I,xorg,yorg,zoomx,zoomy);
612 double x = (iP.
get_j()-xorg)/zoomx;
613 double y = (yorg-iP.
get_i())/zoomy;
617 sprintf(valeur,
" x: %f", x);
619 sprintf(valeur,
" y: %f", y);
629 vpPlotGraph::resetPointList(
const unsigned int curveNum)
631 (curveList+curveNum)->pointListx.clear();
632 (curveList+curveNum)->pointListy.clear();
633 (curveList+curveNum)->pointListz.clear();
634 (curveList+curveNum)->nbPoint = 0;
647 if (!iP1In || !iP2In)
649 double dTopLeft_i = dTopLeft3D.get_i();
650 double dTopLeft_j = dTopLeft3D.get_j();
651 double dBottomRight_i = dTopLeft_i+dHeight;
652 double dBottomRight_j = dTopLeft_j+dWidth;
659 if (!iP1In && !iP2In)
661 if (iP1.
get_i() < dTopLeft_i && iP2.
get_i() < dTopLeft_i)
663 if (iP1.
get_i() > dBottomRight_i && iP2.
get_i() > dBottomRight_i)
665 if (iP1.
get_j() < dTopLeft_j || iP1.
get_j() > dBottomRight_j)
667 if (iP1.
get_i() < dTopLeft_i) iP1.
set_i(dTopLeft_i);
668 else iP1.
set_i(dBottomRight_i);
669 if (iP2.
get_i() < dTopLeft_i) iP2.
set_i(dTopLeft_i);
670 else iP2.
set_i(dBottomRight_i);
674 if (iP1.
get_j() < dTopLeft_j) iP1.
set_j(dTopLeft_j);
675 if (iP1.
get_j() > dBottomRight_j) iP1.
set_j(dBottomRight_j);
676 if (iP1.
get_i() < dTopLeft_i) iP1.
set_i(dTopLeft_i);
677 if (iP1.
get_i() > dBottomRight_i) iP1.
set_i(dBottomRight_i);
682 if (iP2.
get_j() < dTopLeft_j) iP2.
set_j(dTopLeft_j);
683 if (iP2.
get_j() > dBottomRight_j) iP2.
set_j(dBottomRight_j);
684 if (iP2.
get_i() < dTopLeft_i) iP2.
set_i(dTopLeft_i);
685 if (iP2.
get_i() > dBottomRight_i) iP2.
set_i(dBottomRight_i);
692 if (!iP1In && !iP2In)
694 if (iP1.
get_j() < dTopLeft_j && iP2.
get_j() < dTopLeft_j)
696 if (iP1.
get_j() > dBottomRight_j && iP2.
get_j() > dBottomRight_j)
698 if (iP1.
get_i() < dTopLeft_i || iP1.
get_i() > dBottomRight_i)
700 if (iP1.
get_j() < dTopLeft_j) iP1.
set_j(dTopLeft_j);
701 else iP1.
set_j(dBottomRight_j);
702 if (iP2.
get_j() < dTopLeft_j) iP2.
set_j(dTopLeft_j);
703 else iP2.
set_j(dBottomRight_j);
707 if (iP1.
get_j() < dTopLeft_j) iP1.
set_j(dTopLeft_j);
708 if (iP1.
get_j() > dBottomRight_j) iP1.
set_j(dBottomRight_j);
709 if (iP1.
get_i() < dTopLeft_i) iP1.
set_i(dTopLeft_i);
710 if (iP1.
get_i() > dBottomRight_i) iP1.
set_i(dBottomRight_i);
715 if (iP2.
get_j() < dTopLeft_j) iP2.
set_j(dTopLeft_j);
716 if (iP2.
get_j() > dBottomRight_j) iP2.
set_j(dBottomRight_j);
717 if (iP2.
get_i() < dTopLeft_i) iP2.
set_i(dTopLeft_i);
718 if (iP2.
get_i() > dBottomRight_i) iP2.
set_i(dBottomRight_i);
727 double jtop = (dTopLeft_i-b)/a;
728 double jlow = (dBottomRight_i-b)/a;
730 double ileft = dTopLeft_j*a+b;
731 double iright = (dBottomRight_j)*a+b;
736 if(jtop >= dTopLeft_j && jtop <= dBottomRight_j)
738 iP[n].
set_ij(dTopLeft_i,jtop);
741 if(jlow >= dTopLeft_j && jlow <= dBottomRight_j)
743 iP[n].
set_ij(dBottomRight_i,jlow);
746 if(ileft >= dTopLeft_i && ileft <= dBottomRight_i && n <2)
748 iP[n].
set_ij(ileft,dTopLeft_j);
751 if(iright >= dTopLeft_i && iright <= dBottomRight_i && n <2)
753 iP[n].
set_ij(iright,dBottomRight_j);
760 if (!iP1In && !iP2In)
769 iP1 = iP[0]; iP2 = iP[1];
773 iP1 = iP[1]; iP2 = iP[0];
783 iP1 = iP[0];iP2 = iP[1];
787 iP1 = iP[1];iP2 = iP[0];
797 if (fabs(iP[0].get_j()-iP2.
get_j()) > 5)
811 if (fabs(iP[0].get_i()-iP2.
get_i()) > 5)
834 if (fabs(iP[0].get_j()-iP1.
get_j()) > 5)
848 if (fabs(iP[0].get_i()-iP1.
get_i()) > 5)
874 if (iP.
get_i() < dTopLeft3D.get_i())
875 iP.
set_i(dTopLeft3D.get_i());
876 else if (iP.
get_i() > dTopLeft3D.get_i()+dHeight)
877 iP.
set_i(dTopLeft3D.get_i()+dHeight-1);
878 if (iP.
get_j() <dTopLeft3D.get_j())
879 iP.
set_j(dTopLeft3D.get_j());
880 else if (iP.
get_j() > dTopLeft3D.get_j()+dWidth)
881 iP.
set_i(dTopLeft3D.get_j()+dWidth-1);
888 vpPlotGraph::computeGraphParameters3D()
890 zoomx_3D = w_xsize/(xmax-xmin);
891 zoomy_3D = w_ysize/(ymax-ymin);
892 zoomz_3D = w_zsize/(zmax-zmin);
893 ptXorg = w_xval - zoomx_3D*xmax;
894 ptYorg = w_yval + zoomy_3D*ymin;
895 ptZorg = w_zval - zoomz_3D*zmax;
917 computeGraphParameters3D();
919 xdelt = (xmax-xmin)/nbDivisionx;
920 ydelt = (ymax-ymin)/nbDivisiony;
921 zdelt = (zmax-zmin)/nbDivisionz;
932 for (
unsigned int i = 0; i < 6; i++)
938 iP[i] = iP[i] + dTopLeft3D;
952 power = laFonctionSansNom(xdelt);
955 if (std::fabs(iP[0].get_j()-iP[1].get_j()) >
956 vpMath::maximum(std::fabs(iP[0].get_j()), std::fabs(iP[1].get_j()))* std::numeric_limits<double>::epsilon())
957 pente = fabs((iP[0].get_i()-iP[1].get_i())/(iP[0].get_j()-iP[1].get_j()));
960 unsigned int count = 1;
961 for(t=xmin;t<=xmax;t=t+xdelt)
963 double x = ptXorg+(zoomx_3D*t);
969 iPunit = iPunit + dTopLeft3D;
971 getGrid3DPoint(pente,iPunit,ip1,ip2,ip3);
973 if(check3Dline(ip1,ip2))
980 ttemp = t*pow(10.0,power);
982 sprintf(valeur,
"%.1f", ttemp);
991 sprintf(valeur,
"x10e%d", -power);
992 if(check3Dpoint(ip4))
996 power = laFonctionSansNom(ydelt);
999 if (std::fabs(iP[2].get_j()-iP[3].get_j()) >
1000 vpMath::maximum(std::fabs(iP[2].get_j()), std::fabs(iP[3].get_j()))* std::numeric_limits<double>::epsilon())
1001 pente = fabs((iP[2].get_i()-iP[3].get_i())/(iP[2].get_j()-iP[3].get_j()));
1004 for(t=ymin;t<=ymax;t=t+ydelt)
1006 double y = ptYorg-(zoomy_3D*t);
1009 double u=0.0, v=0.0;
1012 iPunit = iPunit + dTopLeft3D;
1014 getGrid3DPoint(pente,iPunit,ip1,ip2,ip3);
1016 if(check3Dline(ip1,ip2))
1023 ttemp = t*pow(10.0,power);
1025 sprintf(valeur,
"%.1f", ttemp);
1034 sprintf(valeur,
"x10e%d", -power);
1035 if(check3Dpoint(ip4))
1039 power = laFonctionSansNom(zdelt);
1042 if (std::fabs(iP[4].get_j()-iP[5].get_j()) >
1043 vpMath::maximum(std::fabs(iP[4].get_j()), std::fabs(iP[5].get_j()))* std::numeric_limits<double>::epsilon())
1044 pente = fabs((iP[4].get_i()-iP[5].get_i())/(iP[4].get_j()-iP[5].get_j()));
1047 for(t=zmin;t<=zmax;t=t+zdelt)
1049 double z = ptZorg+(zoomz_3D*t);
1052 double u=0.0, v=0.0;
1055 iPunit = iPunit + dTopLeft3D;
1057 getGrid3DPoint(pente,iPunit,ip1,ip2,ip3);
1059 if(check3Dline(ip1,ip2))
1066 ttemp = t*pow(10.0,power);
1068 sprintf(valeur,
"%.1f", ttemp);
1077 sprintf(valeur,
"x10e%d", -power);
1078 if(check3Dpoint(ip4))
1084 if (check3Dline(iP[0],iP[1]))
1089 vpImagePoint iPunit(iP[1].get_i(),iP[1].get_j()-10*epsj);
1090 check3Dpoint (iPunit);
1094 if (check3Dline(iP[3],iP[2]))
1099 vpImagePoint iPunit(iP[2].get_i(),iP[2].get_j()-10*epsj);
1100 check3Dpoint (iPunit);
1104 if (check3Dline(iP[4],iP[5]))
1109 vpImagePoint iPunit(iP[5].get_i(),iP[5].get_j()-10*epsj);
1110 check3Dpoint (iPunit);
1122 vpPlotGraph::plot (
vpImage<unsigned char> &I,
const unsigned int curveNb,
const double x,
const double y,
const double z)
1124 if (!scaleInitialized)
1156 scaleInitialized =
true;
1157 computeGraphParameters3D();
1161 if (std::fabs(y) <= std::numeric_limits<double>::epsilon() || std::fabs(z) <= std::numeric_limits<double>::epsilon())
1162 scaleInitialized =
false;
1173 bool changed =
false;
1174 if (x > xmax) {rescalex(1,x); changed =
true;}
1175 else if(x < xmin) {rescalex(0,x);changed =
true;}
1177 if (y > ymax) {rescaley(1,y);changed =
true;}
1178 else if(y < ymin) {rescaley(0,y);changed =
true;}
1180 if (z > zmax) {rescalez(1,z);changed =
true;}
1181 else if(z < zmin) {rescalez(0,z);changed =
true;}
1183 if (changed || move(I))
1185 computeGraphParameters3D();
1190 pointPlot.
setWorldCoordinates(ptXorg+(zoomx_3D*x),ptYorg-(zoomy_3D*y),ptZorg+(zoomz_3D*z));
1191 pointPlot.
track(cMo);
1192 double u=0.0, v=0.0;
1196 iP = iP + dTopLeft3D;
1198 (curveList+curveNb)->pointListx.end();
1199 (curveList+curveNb)->pointListy.end();
1200 (curveList+curveNb)->pointListz.end();
1201 if((curveList+curveNb)->nbPoint)
1203 if (check3Dline((curveList+curveNb)->lastPoint,iP))
1204 vpDisplay::displayLine(I,(curveList+curveNb)->lastPoint, iP, (curveList+curveNb)->color, (curveList+curveNb)->thickness);
1206 #if( defined VISP_HAVE_X11 || defined VISP_HAVE_GDI )
1212 if (iP.get_i() <= (curveList+curveNb)->lastPoint.get_i()) {top = iP.get_i()-5; height = (curveList+curveNb)->lastPoint.get_i() - top+10;}
1213 else {top = (curveList+curveNb)->lastPoint.get_i()-5; height = iP.get_i() - top+10;}
1214 if (iP.get_j() <= (curveList+curveNb)->lastPoint.get_j()) {left = iP.get_j()-5; width = (curveList+curveNb)->lastPoint.get_j() - left+10;}
1215 else {left = (curveList+curveNb)->lastPoint.get_j()-5; width = iP.get_j() - left+10;}
1219 (curveList+curveNb)->lastPoint = iP;
1220 (curveList+curveNb)->pointListx.push_back(x);
1221 (curveList+curveNb)->pointListy.push_back(y);
1222 (curveList+curveNb)->pointListz.push_back(z);
1223 (curveList+curveNb)->nbPoint++;
1226 #if( !defined VISP_HAVE_X11 && defined FLUSH_ON_PLOT)
1237 for (
unsigned int i = 0; i < curveNbr; i++)
1239 std::list<double>::const_iterator it_ptListx = (curveList+i)->pointListx.begin();
1240 std::list<double>::const_iterator it_ptListy = (curveList+i)->pointListy.begin();
1241 std::list<double>::const_iterator it_ptListz = (curveList+i)->pointListz.begin();
1247 while (k < (curveList+i)->nbPoint)
1252 pointPlot.
setWorldCoordinates(ptXorg+(zoomx_3D*x),ptYorg-(zoomy_3D*y),ptZorg+(zoomz_3D*z));
1253 pointPlot.
track(cMo);
1254 double u=0.0, v=0.0;
1257 iP = iP + dTopLeft3D;
1262 if (check3Dline((curveList+i)->lastPoint,iP))
1267 (curveList+i)->lastPoint = iP;
1281 vpPlotGraph::rescalez(
unsigned int side,
double extremity)
1286 zmin = (3*extremity-zmax)/2;
1289 zmax = (3*extremity-zmin)/2;
1293 zdelt = (zmax-zmin)/(
double)nbDivisionz;
1299 bool changed =
false;
1303 if (std::fabs(displacement[2][3]) > std::numeric_limits<double>::epsilon())
1304 cMf = cMf*displacement;
1307 cMo = cMf* displacement * fMo;
1316 bool clicked =
false;
1317 bool clickedUp =
false;
1354 if (!(blockedr || blockedz))
1370 double diffi = iP.
get_i() - old_iPr.get_i();
1371 double diffj = iP.
get_j() - old_iPr.get_j();
1373 anglei = diffi*360/width;
1374 anglej = diffj*360/width;
1379 if (blockedr) old_iPr = iP;
1383 double diffi = iP.
get_i() - old_iPz.get_i();
1384 mov.buildFrom(0,0,diffi*0.01,0,0,0);
1388 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