Visual Servoing Platform  version 3.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
vpMbtDistanceKltCylinder.cpp
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2017 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
9  * See the file LICENSE.txt at the root directory of this source
10  * distribution for additional information about the GNU GPL.
11  *
12  * For using ViSP with software that can not be combined with the GNU
13  * GPL, please contact Inria about acquiring a ViSP Professional
14  * Edition License.
15  *
16  * See http://visp.inria.fr for more information.
17  *
18  * This software was developed at:
19  * Inria Rennes - Bretagne Atlantique
20  * Campus Universitaire de Beaulieu
21  * 35042 Rennes Cedex
22  * France
23  *
24  * If you have questions regarding the use of this file, please contact
25  * Inria at visp@inria.fr
26  *
27  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29  *
30  * Description:
31  * Klt cylinder, containing points of interest.
32  *
33  * Authors:
34  * Aurelien Yol
35  *
36  *****************************************************************************/
37 
38 #include <visp3/mbt/vpMbtDistanceKltCylinder.h>
39 #include <visp3/mbt/vpMbtDistanceKltPoints.h>
40 #include <visp3/core/vpPolygon.h>
41 
42 
43 #if defined(VISP_HAVE_MODULE_KLT) && (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100))
44 
45 #if defined(__APPLE__) && defined(__MACH__) // Apple OSX and iOS (Darwin)
46 # include <TargetConditionals.h> // To detect OSX or IOS using TARGET_OS_IPHONE or TARGET_OS_IOS macro
47 #endif
48 
54  : c0Mo(), p1Ext(), p2Ext(), cylinder(), circle1(), circle2(),
55  initPoints(), initPoints3D(), curPoints(), curPointsInd(),
56  nbPointsCur(0), nbPointsInit(0), minNbPoint(4), enoughPoints(false),
57  cam(), isTrackedKltCylinder(true), listIndicesCylinderBBox(), hiddenface(NULL), useScanLine(false)
58 {
59 }
60 
66 {}
67 
68 
69 
70 void
71 vpMbtDistanceKltCylinder::buildFrom(const vpPoint &p1, const vpPoint &p2, const double &r)
72 {
73  p1Ext = p1;
74  p2Ext = p2;
75 
76  vpColVector ABC(3);
77  vpColVector V1(3);
78  vpColVector V2(3);
79 
80  V1[0] = p1.get_oX();
81  V1[1] = p1.get_oY();
82  V1[2] = p1.get_oZ();
83  V2[0] = p2.get_oX();
84  V2[1] = p2.get_oY();
85  V2[2] = p2.get_oZ();
86 
87  // Get the axis of the cylinder
88  ABC = V1-V2;
89 
90  // Build our extremity circles
91  circle1.setWorldCoordinates(ABC[0],ABC[1],ABC[2],p1.get_oX(),p1.get_oY(),p1.get_oZ(),r);
92  circle2.setWorldCoordinates(ABC[0],ABC[1],ABC[2],p2.get_oX(),p2.get_oY(),p2.get_oZ(),r);
93 
94  // Build our cylinder
95  cylinder.setWorldCoordinates(ABC[0],ABC[1],ABC[2],(p1.get_oX()+p2.get_oX())/2.0,(p1.get_oY()+p2.get_oY())/2.0,(p1.get_oZ()+p2.get_oZ())/2.0,r);
96 }
97 
106 void
108 {
109  c0Mo = cMo;
110  cylinder.changeFrame(cMo);
111 
112  // extract ids of the points in the face
113  nbPointsInit = 0;
114  nbPointsCur = 0;
115  initPoints = std::map<int, vpImagePoint>();
116  initPoints3D = std::map<int, vpPoint>();
117  curPoints = std::map<int, vpImagePoint>();
118  curPointsInd = std::map<int, int>();
119 
120  for (unsigned int i = 0; i < static_cast<unsigned int>(_tracker.getNbFeatures()); i ++){
121  long id;
122  float x_tmp, y_tmp;
123  _tracker.getFeature((int)i, id, x_tmp, y_tmp);
124 
125  bool add = false;
126 
127  if(useScanLine)
128  {
129  if((unsigned int)y_tmp < hiddenface->getMbScanLineRenderer().getPrimitiveIDs().getHeight() &&
130  (unsigned int)x_tmp < hiddenface->getMbScanLineRenderer().getPrimitiveIDs().getWidth())
131  {
132  for(unsigned int kc = 0 ; kc < listIndicesCylinderBBox.size() ; kc++)
133  if(hiddenface->getMbScanLineRenderer().getPrimitiveIDs()[(unsigned int)y_tmp][(unsigned int)x_tmp] == listIndicesCylinderBBox[kc])
134  {
135  add = true;
136  break;
137  }
138  }
139  }
140  else
141  {
142  std::vector<vpImagePoint> roi;
143  for(unsigned int kc = 0 ; kc < listIndicesCylinderBBox.size() ; kc++)
144  {
145  hiddenface->getPolygon()[(size_t) listIndicesCylinderBBox[kc]]->getRoiClipped(cam, roi);
146  if(vpPolygon::isInside(roi, y_tmp, x_tmp))
147  {
148  add = true;
149  break;
150  }
151  roi.clear();
152  }
153  }
154 
155  if(add){
156 
157  double xm=0, ym=0;
158  vpPixelMeterConversion::convertPoint(cam, x_tmp, y_tmp, xm, ym);
159  double Z = computeZ(xm,ym);
160  if(!vpMath::isNaN(Z)){
161 #if TARGET_OS_IPHONE
162  initPoints[(int)id] = vpImagePoint(y_tmp, x_tmp);
163  curPoints[(int)id] = vpImagePoint(y_tmp, x_tmp);
164  curPointsInd[(int)id] = (int)i;
165 #else
166  initPoints[id] = vpImagePoint(y_tmp, x_tmp);
167  curPoints[id] = vpImagePoint(y_tmp, x_tmp);
168  curPointsInd[id] = (int)i;
169 #endif
170  nbPointsInit++;
171  nbPointsCur++;
172 
173  vpPoint p;
174  p.setWorldCoordinates(xm * Z, ym * Z, Z);
175 #if TARGET_OS_IPHONE
176  initPoints3D[(int)id] = p;
177 #else
178  initPoints3D[id] = p;
179 #endif
180  //std::cout << "Computed Z for : " << xm << "," << ym << " : " << computeZ(xm,ym) << std::endl;
181  }
182  }
183  }
184 
185  if(nbPointsCur >= minNbPoint) enoughPoints = true;
186  else enoughPoints = false;
187 
188  //std::cout << "Nb detected points in cylinder : " << nbPointsCur << std::endl;
189 }
190 
198 unsigned int
200 {
201  long id;
202  float x, y;
203  nbPointsCur = 0;
204  curPoints = std::map<int, vpImagePoint>();
205  curPointsInd = std::map<int, int>();
206 
207  for (unsigned int i = 0; i < static_cast<unsigned int>(_tracker.getNbFeatures()); i++){
208  _tracker.getFeature((int)i, id, x, y);
209  if(isTrackedFeature((int)id)){
210 #if TARGET_OS_IPHONE
211  curPoints[(int)id] = vpImagePoint(static_cast<double>(y),static_cast<double>(x));
212  curPointsInd[(int)id] = (int)i;
213 #else
214  curPoints[id] = vpImagePoint(static_cast<double>(y),static_cast<double>(x));
215  curPointsInd[id] = (int)i;
216 #endif
217  nbPointsCur++;
218  }
219  }
220 
221  if(nbPointsCur >= minNbPoint) enoughPoints = true;
222  else enoughPoints = false;
223 
224  return nbPointsCur;
225 }
226 
234 void
235 vpMbtDistanceKltCylinder::removeOutliers(const vpColVector& _w, const double &threshold_outlier)
236 {
237  std::map<int, vpImagePoint> tmp;
238  std::map<int, int> tmp2;
239  unsigned int nbSupp = 0;
240  unsigned int k = 0;
241 
242  nbPointsCur = 0;
243  std::map<int, vpImagePoint>::const_iterator iter = curPoints.begin();
244  for( ; iter != curPoints.end(); iter++){
245  if(_w[k] > threshold_outlier && _w[k+1] > threshold_outlier){
246 // if(_w[k] > threshold_outlier || _w[k+1] > threshold_outlier){
247  tmp[iter->first] = vpImagePoint(iter->second.get_i(), iter->second.get_j());
248  tmp2[iter->first] = curPointsInd[iter->first];
249  nbPointsCur++;
250  }
251  else{
252  nbSupp++;
253  initPoints.erase(iter->first);
254  }
255 
256  k+=2;
257  }
258 
259  if(nbSupp != 0){
260  curPoints = std::map<int, vpImagePoint>();
261  curPointsInd = std::map<int, int>();
262 
263  curPoints = tmp;
264  curPointsInd = tmp2;
265  if(nbPointsCur >= minNbPoint) enoughPoints = true;
266  else enoughPoints = false;
267  }
268 }
269 
281 void
283 {
284  unsigned int index_ = 0;
285 
286  cylinder.changeFrame(_cMc0 * c0Mo);
287 
288  std::map<int, vpImagePoint>::const_iterator iter = curPoints.begin();
289  for( ; iter != curPoints.end(); iter++){
290  int id(iter->first);
291  double i_cur(iter->second.get_i()), j_cur(iter->second.get_j());
292 
293  double x_cur(0), y_cur(0);
294  vpPixelMeterConversion::convertPoint(cam, j_cur, i_cur, x_cur, y_cur);
295 
296  vpPoint p0 = initPoints3D[id];
297  p0.changeFrame(_cMc0);
298  p0.project();
299 
300  double x0_transform(p0.get_x()), y0_transform(p0.get_y()) ;
301 
302  double Z = computeZ(x_cur, y_cur);
303 
304  if(vpMath::isNaN(Z) || Z < std::numeric_limits<double>::epsilon()){
305 // std::cout << "Z is Nan : " << A << " , " << B << " , " << C << " | " << Z << " | " << x_cur << " , " << y_cur << std::endl;
306 // std::cout << std::sqrt(B*B - A*C) << " , " << B*B - A*C << std::endl;
307 
308  _J[2*index_][0] = 0;
309  _J[2*index_][1] = 0;
310  _J[2*index_][2] = 0;
311  _J[2*index_][3] = 0;
312  _J[2*index_][4] = 0;
313  _J[2*index_][5] = 0;
314 
315  _J[2*index_+1][0] = 0;
316  _J[2*index_+1][1] = 0;
317  _J[2*index_+1][2] = 0;
318  _J[2*index_+1][3] = 0;
319  _J[2*index_+1][4] = 0;
320  _J[2*index_+1][5] = 0;
321 
322  _R[2*index_] = (x0_transform - x_cur);
323  _R[2*index_+1] = (y0_transform - y_cur);
324  index_++;
325  }
326  else
327  {
328  double invZ = 1.0/Z;
329 
330  _J[2*index_][0] = - invZ;
331  _J[2*index_][1] = 0;
332  _J[2*index_][2] = x_cur * invZ;
333  _J[2*index_][3] = x_cur * y_cur;
334  _J[2*index_][4] = -(1+x_cur*x_cur);
335  _J[2*index_][5] = y_cur;
336 
337  _J[2*index_+1][0] = 0;
338  _J[2*index_+1][1] = - invZ;
339  _J[2*index_+1][2] = y_cur * invZ;
340  _J[2*index_+1][3] = (1+y_cur*y_cur);
341  _J[2*index_+1][4] = - y_cur * x_cur;
342  _J[2*index_+1][5] = - x_cur;
343 
344  _R[2*index_] = (x0_transform - x_cur);
345  _R[2*index_+1] = (y0_transform - y_cur);
346  index_++;
347  }
348  }
349 }
350 
358 bool
359 vpMbtDistanceKltCylinder::isTrackedFeature(const int _id)
360 {
361  std::map<int, vpImagePoint>::iterator iter = initPoints.find(_id);
362  if(iter != initPoints.end())
363  return true;
364 
365  return false;
366 }
367 
376 void
378 #if (VISP_HAVE_OPENCV_VERSION >= 0x020408)
379  cv::Mat &mask,
380 #else
381  IplImage* mask,
382 #endif
383  unsigned char nb, unsigned int shiftBorder)
384 {
385 #if (VISP_HAVE_OPENCV_VERSION >= 0x020408)
386  int width = mask.cols;
387  int height = mask.rows;
388 #else
389  int width = mask->width;
390  int height = mask->height;
391 #endif
392 
393  for(unsigned int kc = 0 ; kc < listIndicesCylinderBBox.size() ; kc++)
394  {
395  if((*hiddenface)[(unsigned int) listIndicesCylinderBBox[kc]]->isVisible() &&
396  (*hiddenface)[(unsigned int) listIndicesCylinderBBox[kc]]->getNbPoint() > 2)
397  {
398  int i_min, i_max, j_min, j_max;
399  std::vector<vpImagePoint> roi;
400  (*hiddenface)[(unsigned int) listIndicesCylinderBBox[kc]]->getRoiClipped(cam, roi);
401  vpPolygon3D::getMinMaxRoi(roi, i_min, i_max, j_min,j_max);
402 
403  /* check image boundaries */
404  if(i_min > height){ //underflow
405  i_min = 0;
406  }
407  if(i_max > height){
408  i_max = height;
409  }
410  if(j_min > width){ //underflow
411  j_min = 0;
412  }
413  if(j_max > width){
414  j_max = width;
415  }
416 
417  double shiftBorder_d = (double) shiftBorder;
418  #if (VISP_HAVE_OPENCV_VERSION >= 0x020408)
419  for(int i=i_min; i< i_max; i++){
420  double i_d = (double) i;
421  for(int j=j_min; j< j_max; j++){
422  double j_d = (double) j;
423  if(shiftBorder != 0){
424  if( vpPolygon::isInside(roi, i_d, j_d)
425  && vpPolygon::isInside(roi, i_d+shiftBorder_d, j_d+shiftBorder_d)
426  && vpPolygon::isInside(roi, i_d-shiftBorder_d, j_d+shiftBorder_d)
427  && vpPolygon::isInside(roi, i_d+shiftBorder_d, j_d-shiftBorder_d)
428  && vpPolygon::isInside(roi, i_d-shiftBorder_d, j_d-shiftBorder_d) ){
429  mask.at<unsigned char>(i,j) = nb;
430  }
431  }
432  else{
433  if(vpPolygon::isInside(roi, i, j)){
434  mask.at<unsigned char>(i,j) = nb;
435  }
436  }
437  }
438  }
439  #else
440  unsigned char* ptrData = (unsigned char*)mask->imageData + i_min*mask->widthStep+j_min;
441  for(int i=i_min; i< i_max; i++){
442  double i_d = (double) i;
443  for(int j=j_min; j< j_max; j++){
444  double j_d = (double) j;
445  if(shiftBorder != 0){
446  if( vpPolygon::isInside(roi, i_d, j_d)
447  && vpPolygon::isInside(roi, i_d+shiftBorder_d, j_d+shiftBorder_d)
448  && vpPolygon::isInside(roi, i_d-shiftBorder_d, j_d+shiftBorder_d)
449  && vpPolygon::isInside(roi, i_d+shiftBorder_d, j_d-shiftBorder_d)
450  && vpPolygon::isInside(roi, i_d-shiftBorder_d, j_d-shiftBorder_d) ){
451  *(ptrData++) = nb;
452  }
453  else{
454  ptrData++;
455  }
456  }
457  else{
458  if(vpPolygon::isInside(roi, i, j)){
459  *(ptrData++) = nb;
460  }
461  else{
462  ptrData++;
463  }
464  }
465  }
466  ptrData += mask->widthStep - j_max + j_min;
467  }
468  #endif
469  }
470  }
471 }
472 
478 void
480 {
481  std::map<int, vpImagePoint>::const_iterator iter = curPoints.begin();
482  for( ; iter != curPoints.end(); iter++){
483  int id(iter->first);
484  vpImagePoint iP;
485  iP.set_i(static_cast<double>(iter->second.get_i()));
486  iP.set_j(static_cast<double>(iter->second.get_j()));
487 
489 
490  iP.set_i( vpMath::round( iP.get_i() + 7 ) );
491  iP.set_j( vpMath::round( iP.get_j() + 7 ) );
492  char ide[10];
493  sprintf(ide, "%ld", static_cast<long int>(id));
494  vpDisplay::displayText(_I, iP, ide, vpColor::red);
495  }
496 }
497 
503 void
505 {
506  std::map<int, vpImagePoint>::const_iterator iter = curPoints.begin();
507  for( ; iter != curPoints.end(); iter++){
508  int id(iter->first);
509  vpImagePoint iP;
510  iP.set_i(static_cast<double>(iter->second.get_i()));
511  iP.set_j(static_cast<double>(iter->second.get_j()));
512 
514 
515  iP.set_i( vpMath::round( iP.get_i() + 7 ) );
516  iP.set_j( vpMath::round( iP.get_j() + 7 ) );
517  char ide[10];
518  sprintf(ide, "%ld", static_cast<long int>(id));
519  vpDisplay::displayText(_I, iP, ide, vpColor::red);
520  }
521 }
522 
523 void
525  const vpColor col, const unsigned int thickness, const bool /*displayFullModel*/)
526 {
527  //if(isvisible || displayFullModel)
528  {
529  // Perspective projection
530  circle1.changeFrame(cMo);
531  circle2.changeFrame(cMo);
532  cylinder.changeFrame(cMo);
533 
534  try{
535  circle1.projection();
536  }
537  catch(...){std::cout<<"Problem projection circle 1";}
538  try{
539  circle2.projection();
540  }
541  catch(...){std::cout<<"Problem projection circle 2";}
542 
543  cylinder.projection();
544 
545  double rho1,theta1;
546  double rho2,theta2;
547 
548  // Meters to pixels conversion
549  vpMeterPixelConversion::convertLine(camera,cylinder.getRho1(),cylinder.getTheta1(),rho1,theta1);
550  vpMeterPixelConversion::convertLine(camera,cylinder.getRho2(),cylinder.getTheta2(),rho2,theta2);
551 
552  // Determine intersections between circles and limbos
553  double i11,i12,i21,i22,j11,j12,j21,j22;
554 
555  vpCircle::computeIntersectionPoint(circle1, cam, rho1, theta1, i11, j11);
556  vpCircle::computeIntersectionPoint(circle2, cam, rho1, theta1, i12, j12);
557 
558  vpCircle::computeIntersectionPoint(circle1, cam, rho2, theta2, i21, j21);
559  vpCircle::computeIntersectionPoint(circle2, cam, rho2, theta2, i22, j22);
560 
561  // Create the image points
562  vpImagePoint ip11,ip12,ip21,ip22;
563  ip11.set_ij(i11,j11);
564  ip12.set_ij(i12,j12);
565  ip21.set_ij(i21,j21);
566  ip22.set_ij(i22,j22);
567 
568  // Display
569  vpDisplay::displayLine(I,ip11,ip12,col, thickness);
570  vpDisplay::displayLine(I,ip21,ip22,col, thickness);
571  }
572 }
573 
574 void
576  const vpColor col, const unsigned int thickness, const bool /*displayFullModel*/)
577 {
578  //if(isvisible || displayFullModel)
579  {
580  // Perspective projection
581  circle1.changeFrame(cMo);
582  circle2.changeFrame(cMo);
583  cylinder.changeFrame(cMo);
584 
585  try{
586  circle1.projection();
587  }
588  catch(...){std::cout<<"Problem projection circle 1";}
589  try{
590  circle2.projection();
591  }
592  catch(...){std::cout<<"Problem projection circle 2";}
593 
594  cylinder.projection();
595 
596  double rho1,theta1;
597  double rho2,theta2;
598 
599  // Meters to pixels conversion
600  vpMeterPixelConversion::convertLine(camera,cylinder.getRho1(),cylinder.getTheta1(),rho1,theta1);
601  vpMeterPixelConversion::convertLine(camera,cylinder.getRho2(),cylinder.getTheta2(),rho2,theta2);
602 
603  // Determine intersections between circles and limbos
604  double i11,i12,i21,i22,j11,j12,j21,j22;
605 
606  vpCircle::computeIntersectionPoint(circle1, camera, rho1, theta1, i11, j11);
607  vpCircle::computeIntersectionPoint(circle2, camera, rho1, theta1, i12, j12);
608 
609  vpCircle::computeIntersectionPoint(circle1, camera, rho2, theta2, i21, j21);
610  vpCircle::computeIntersectionPoint(circle2, camera, rho2, theta2, i22, j22);
611 
612  // Create the image points
613  vpImagePoint ip11,ip12,ip21,ip22;
614  ip11.set_ij(i11,j11);
615  ip12.set_ij(i12,j12);
616  ip21.set_ij(i21,j21);
617  ip22.set_ij(i22,j22);
618 
619  // Display
620  vpDisplay::displayLine(I,ip11,ip12,col, thickness);
621  vpDisplay::displayLine(I,ip21,ip22,col, thickness);
622  }
623 }
624 
625 
626 // ######################
627 // Private Functions
628 // ######################
629 
630 double
631 vpMbtDistanceKltCylinder::computeZ(const double &x, const double &y)
632 {
633 // double A = x*x + y*y + 1 - ((cylinder.getA()*x+cylinder.getB()*y+cylinder.getC()) * (cylinder.getA()*x+cylinder.getB()*y+cylinder.getC()));
634 // double B = (x * cylinder.getX() + y * cylinder.getY() + cylinder.getZ());
635 // double C = cylinder.getX() * cylinder.getX() + cylinder.getY() * cylinder.getY() + cylinder.getZ() * cylinder.getZ() - cylinder.getR() * cylinder.getR();
636 //
637 // return (B - std::sqrt(B*B - A*C))/A;
638 
639  return cylinder.computeZ(x, y);
640 }
641 #elif !defined(VISP_BUILD_SHARED_LIBS)
642 // Work arround to avoid warning: libvisp_mbt.a(vpMbtDistanceKltCylinder.cpp.o) has no symbols
643 void dummy_vpMbtDistanceKltCylinder() {};
644 #endif
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:97
void displayPrimitive(const vpImage< unsigned char > &_I)
unsigned int computeNbDetectedCurrent(const vpKltOpencv &_tracker)
void removeOutliers(const vpColVector &weight, const double &threshold_outlier)
double get_i() const
Definition: vpImagePoint.h:199
void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &cP)
perspective projection of the circle
Definition: vpCircle.cpp:269
Implementation of an homogeneous matrix and operations on such kind of matrices.
std::vector< int > listIndicesCylinderBBox
Pointer to the polygon that define a face.
static bool isNaN(const double value)
Definition: vpMath.cpp:85
Class to define colors available for display functionnalities.
Definition: vpColor.h:121
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
double get_oY() const
Get the point Y coordinate in the object frame.
Definition: vpPoint.cpp:449
vpMbScanLine & getMbScanLineRenderer()
double getRho2() const
Definition: vpCylinder.h:146
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...
void init(const vpKltOpencv &_tracker, const vpHomogeneousMatrix &cMo)
double computeZ(const double x, const double y) const
Definition: vpCylinder.cpp:391
double get_y() const
Get the point y coordinate in the image plane.
Definition: vpPoint.cpp:458
static int round(const double x)
Definition: vpMath.h:249
double get_j() const
Definition: vpImagePoint.h:210
static void getMinMaxRoi(const std::vector< vpImagePoint > &roi, int &i_min, int &i_max, int &j_min, int &j_max)
void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &cP)
Definition: vpCylinder.cpp:298
static const vpColor red
Definition: vpColor.h:163
Class that defines what is a point.
Definition: vpPoint.h:59
bool isInside(const vpImagePoint &iP, const PointInPolygonMethod &method=PnPolyRayCasting) const
Definition: vpPolygon.cpp:303
void set_i(const double ii)
Definition: vpImagePoint.h:163
double getTheta1() const
Definition: vpCylinder.h:139
void projection()
Definition: vpCircle.cpp:155
void computeInteractionMatrixAndResidu(const vpHomogeneousMatrix &cMc0, vpColVector &_R, vpMatrix &_J)
static void computeIntersectionPoint(const vpCircle &circle, const vpCameraParameters &cam, const double &rho, const double &theta, double &i, double &j)
Definition: vpCircle.cpp:373
Generic class defining intrinsic camera parameters.
double get_oZ() const
Get the point Z coordinate in the object frame.
Definition: vpPoint.cpp:451
double get_x() const
Get the point x coordinate in the image plane.
Definition: vpPoint.cpp:456
bool useScanLine
Use scanline rendering.
void buildFrom(const vpPoint &p1, const vpPoint &p2, const double &r)
void projection()
Definition: vpCylinder.cpp:185
vpMbHiddenFaces< vpMbtPolygon > * hiddenface
Pointer to the list of faces.
void display(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor col, const unsigned int thickness=1, const bool displayFullModel=false)
static void convertLine(const vpCameraParameters &cam, const double &rho_m, const double &theta_m, double &rho_p, double &theta_p)
Line coordinates conversion (rho,theta).
void set_j(const double jj)
Definition: vpImagePoint.h:174
double get_oX() const
Get the point X coordinate in the object frame.
Definition: vpPoint.cpp:447
static void displayCross(const vpImage< unsigned char > &I, const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness=1)
void setWorldCoordinates(const double oX, const double oY, const double oZ)
Definition: vpPoint.cpp:111
Implementation of column vector and the associated operations.
Definition: vpColVector.h:72
Wrapper for the KLT (Kanade-Lucas-Tomasi) feature tracker implemented in OpenCV. Thus to enable this ...
Definition: vpKltOpencv.h:76
void getFeature(const int &index, long &id, float &x, float &y) const
int getNbFeatures() const
Get the number of current features.
Definition: vpKltOpencv.h:118
double getRho1() const
Definition: vpCylinder.h:133
double getTheta2() const
Definition: vpCylinder.h:152
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition: vpImagePoint.h:88
static void displayLine(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)
void setWorldCoordinates(const vpColVector &oP)
Definition: vpCylinder.cpp:73
void updateMask(cv::Mat &mask, unsigned char _nb=255, unsigned int _shiftBorder=0)
void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &_cP)
Definition: vpPoint.cpp:247
void set_ij(const double ii, const double jj)
Definition: vpImagePoint.h:185
void setWorldCoordinates(const vpColVector &oP)
Definition: vpCircle.cpp:62
std::vector< PolygonType * > & getPolygon()