Visual Servoing Platform  version 3.0.0
vpMbtDistanceKltCylinder.cpp
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2015 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 
50  : c0Mo(), p1Ext(), p2Ext(), cylinder(), circle1(), circle2(),
51  initPoints(), initPoints3D(), curPoints(), curPointsInd(),
52  nbPointsCur(0), nbPointsInit(0), minNbPoint(4), enoughPoints(false),
53  cam(), isTrackedKltCylinder(true), listIndicesCylinderBBox(), hiddenface(NULL), useScanLine(false)
54 {
55 }
56 
62 {}
63 
64 
65 
66 void
67 vpMbtDistanceKltCylinder::buildFrom(const vpPoint &p1, const vpPoint &p2, const double &r)
68 {
69  p1Ext = p1;
70  p2Ext = p2;
71 
72  vpColVector ABC(3);
73  vpColVector V1(3);
74  vpColVector V2(3);
75 
76  V1[0] = p1.get_oX();
77  V1[1] = p1.get_oY();
78  V1[2] = p1.get_oZ();
79  V2[0] = p2.get_oX();
80  V2[1] = p2.get_oY();
81  V2[2] = p2.get_oZ();
82 
83  // Get the axis of the cylinder
84  ABC = V1-V2;
85 
86  // Build our extremity circles
87  circle1.setWorldCoordinates(ABC[0],ABC[1],ABC[2],p1.get_oX(),p1.get_oY(),p1.get_oZ(),r);
88  circle2.setWorldCoordinates(ABC[0],ABC[1],ABC[2],p2.get_oX(),p2.get_oY(),p2.get_oZ(),r);
89 
90  // Build our cylinder
91  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);
92 }
93 
102 void
104 {
105  c0Mo = cMo;
106  cylinder.changeFrame(cMo);
107 
108  // extract ids of the points in the face
109  nbPointsInit = 0;
110  nbPointsCur = 0;
111  initPoints = std::map<int, vpImagePoint>();
112  initPoints3D = std::map<int, vpPoint>();
113  curPoints = std::map<int, vpImagePoint>();
114  curPointsInd = std::map<int, int>();
115 
116  for (unsigned int i = 0; i < static_cast<unsigned int>(_tracker.getNbFeatures()); i ++){
117  int id;
118  float x_tmp, y_tmp;
119  _tracker.getFeature((int)i, id, x_tmp, y_tmp);
120 
121  bool add = false;
122 
123  if(useScanLine)
124  {
125  if((unsigned int)y_tmp < hiddenface->getMbScanLineRenderer().getPrimitiveIDs().getHeight() &&
126  (unsigned int)x_tmp < hiddenface->getMbScanLineRenderer().getPrimitiveIDs().getWidth())
127  {
128  for(unsigned int kc = 0 ; kc < listIndicesCylinderBBox.size() ; kc++)
129  if(hiddenface->getMbScanLineRenderer().getPrimitiveIDs()[(unsigned int)y_tmp][(unsigned int)x_tmp] == listIndicesCylinderBBox[kc])
130  {
131  add = true;
132  break;
133  }
134  }
135  }
136  else
137  {
138  std::vector<vpImagePoint> roi;
139  for(unsigned int kc = 0 ; kc < listIndicesCylinderBBox.size() ; kc++)
140  {
141  hiddenface->getPolygon()[listIndicesCylinderBBox[kc]]->getRoiClipped(cam, roi);
142  if(vpPolygon::isInside(roi, y_tmp, x_tmp))
143  {
144  add = true;
145  break;
146  }
147  roi.clear();
148  }
149  }
150 
151  if(add){
152 
153  double xm=0, ym=0;
154  vpPixelMeterConversion::convertPoint(cam, x_tmp, y_tmp, xm, ym);
155  double Z = computeZ(xm,ym);
156  if(!vpMath::isNaN(Z)){
157  initPoints[id] = vpImagePoint(y_tmp, x_tmp);
158  curPoints[id] = vpImagePoint(y_tmp, x_tmp);
159  curPointsInd[id] = (int)i;
160  nbPointsInit++;
161  nbPointsCur++;
162 
163 
164  vpPoint p;
165  p.setWorldCoordinates(xm * Z, ym * Z, Z);
166  initPoints3D[id] = p;
167  //std::cout << "Computed Z for : " << xm << "," << ym << " : " << computeZ(xm,ym) << std::endl;
168  }
169  }
170  }
171 
172  if(nbPointsCur >= minNbPoint) enoughPoints = true;
173  else enoughPoints = false;
174 
175  //std::cout << "Nb detected points in cylinder : " << nbPointsCur << std::endl;
176 }
177 
185 unsigned int
187 {
188  int id;
189  float x, y;
190  nbPointsCur = 0;
191  curPoints = std::map<int, vpImagePoint>();
192  curPointsInd = std::map<int, int>();
193 
194  for (unsigned int i = 0; i < static_cast<unsigned int>(_tracker.getNbFeatures()); i++){
195  _tracker.getFeature((int)i, id, x, y);
196  if(isTrackedFeature(id)){
197  curPoints[id] = vpImagePoint(static_cast<double>(y),static_cast<double>(x));
198  curPointsInd[id] = (int)i;
199  nbPointsCur++;
200  }
201  }
202 
203  if(nbPointsCur >= minNbPoint) enoughPoints = true;
204  else enoughPoints = false;
205 
206  return nbPointsCur;
207 }
208 
216 void
217 vpMbtDistanceKltCylinder::removeOutliers(const vpColVector& _w, const double &threshold_outlier)
218 {
219  std::map<int, vpImagePoint> tmp;
220  std::map<int, int> tmp2;
221  unsigned int nbSupp = 0;
222  unsigned int k = 0;
223 
224  nbPointsCur = 0;
225  std::map<int, vpImagePoint>::const_iterator iter = curPoints.begin();
226  for( ; iter != curPoints.end(); iter++){
227  if(_w[k] > threshold_outlier && _w[k+1] > threshold_outlier){
228 // if(_w[k] > threshold_outlier || _w[k+1] > threshold_outlier){
229  tmp[iter->first] = vpImagePoint(iter->second.get_i(), iter->second.get_j());
230  tmp2[iter->first] = curPointsInd[iter->first];
231  nbPointsCur++;
232  }
233  else{
234  nbSupp++;
235  initPoints.erase(iter->first);
236  }
237 
238  k+=2;
239  }
240 
241  if(nbSupp != 0){
242  curPoints = std::map<int, vpImagePoint>();
243  curPointsInd = std::map<int, int>();
244 
245  curPoints = tmp;
246  curPointsInd = tmp2;
247  if(nbPointsCur >= minNbPoint) enoughPoints = true;
248  else enoughPoints = false;
249  }
250 }
251 
263 void
265 {
266  unsigned int index_ = 0;
267 
268  cylinder.changeFrame(_cMc0 * c0Mo);
269 
270  std::map<int, vpImagePoint>::const_iterator iter = curPoints.begin();
271  for( ; iter != curPoints.end(); iter++){
272  int id(iter->first);
273  double i_cur(iter->second.get_i()), j_cur(iter->second.get_j());
274 
275  double x_cur(0), y_cur(0);
276  vpPixelMeterConversion::convertPoint(cam, j_cur, i_cur, x_cur, y_cur);
277 
278  vpPoint p0 = initPoints3D[id];
279  p0.changeFrame(_cMc0);
280  p0.project();
281 
282  double x0_transform(p0.get_x()), y0_transform(p0.get_y()) ;
283 
284  double Z = computeZ(x_cur, y_cur);
285 
286  if(vpMath::isNaN(Z) || Z < std::numeric_limits<double>::epsilon()){
287 // std::cout << "Z is Nan : " << A << " , " << B << " , " << C << " | " << Z << " | " << x_cur << " , " << y_cur << std::endl;
288 // std::cout << std::sqrt(B*B - A*C) << " , " << B*B - A*C << std::endl;
289 
290  _J[2*index_][0] = 0;
291  _J[2*index_][1] = 0;
292  _J[2*index_][2] = 0;
293  _J[2*index_][3] = 0;
294  _J[2*index_][4] = 0;
295  _J[2*index_][5] = 0;
296 
297  _J[2*index_+1][0] = 0;
298  _J[2*index_+1][1] = 0;
299  _J[2*index_+1][2] = 0;
300  _J[2*index_+1][3] = 0;
301  _J[2*index_+1][4] = 0;
302  _J[2*index_+1][5] = 0;
303 
304  _R[2*index_] = (x0_transform - x_cur);
305  _R[2*index_+1] = (y0_transform - y_cur);
306  index_++;
307  }
308  else
309  {
310  double invZ = 1.0/Z;
311 
312  _J[2*index_][0] = - invZ;
313  _J[2*index_][1] = 0;
314  _J[2*index_][2] = x_cur * invZ;
315  _J[2*index_][3] = x_cur * y_cur;
316  _J[2*index_][4] = -(1+x_cur*x_cur);
317  _J[2*index_][5] = y_cur;
318 
319  _J[2*index_+1][0] = 0;
320  _J[2*index_+1][1] = - invZ;
321  _J[2*index_+1][2] = y_cur * invZ;
322  _J[2*index_+1][3] = (1+y_cur*y_cur);
323  _J[2*index_+1][4] = - y_cur * x_cur;
324  _J[2*index_+1][5] = - x_cur;
325 
326  _R[2*index_] = (x0_transform - x_cur);
327  _R[2*index_+1] = (y0_transform - y_cur);
328  index_++;
329  }
330  }
331 }
332 
340 bool
341 vpMbtDistanceKltCylinder::isTrackedFeature(const int _id)
342 {
343  std::map<int, vpImagePoint>::iterator iter = initPoints.find(_id);
344  if(iter != initPoints.end())
345  return true;
346 
347  return false;
348 }
349 
358 void
360 #if (VISP_HAVE_OPENCV_VERSION >= 0x020408)
361  cv::Mat &mask,
362 #else
363  IplImage* mask,
364 #endif
365  unsigned char nb, unsigned int shiftBorder)
366 {
367 #if (VISP_HAVE_OPENCV_VERSION >= 0x020408)
368  int width = mask.cols;
369  int height = mask.rows;
370 #else
371  int width = mask->width;
372  int height = mask->height;
373 #endif
374 
375  for(unsigned int kc = 0 ; kc < listIndicesCylinderBBox.size() ; kc++)
376  {
377  if((*hiddenface)[listIndicesCylinderBBox[kc]]->isVisible() && (*hiddenface)[listIndicesCylinderBBox[kc]]->getNbPoint() > 2)
378  {
379  int i_min, i_max, j_min, j_max;
380  std::vector<vpImagePoint> roi;
381  (*hiddenface)[listIndicesCylinderBBox[kc]]->getRoiClipped(cam, roi);
382  vpPolygon3D::getMinMaxRoi(roi, i_min, i_max, j_min,j_max);
383 
384  /* check image boundaries */
385  if(i_min > height){ //underflow
386  i_min = 0;
387  }
388  if(i_max > height){
389  i_max = height;
390  }
391  if(j_min > width){ //underflow
392  j_min = 0;
393  }
394  if(j_max > width){
395  j_max = width;
396  }
397 
398  double shiftBorder_d = (double) shiftBorder;
399  #if (VISP_HAVE_OPENCV_VERSION >= 0x020408)
400  for(int i=i_min; i< i_max; i++){
401  double i_d = (double) i;
402  for(int j=j_min; j< j_max; j++){
403  double j_d = (double) j;
404  if(shiftBorder != 0){
405  if( vpPolygon::isInside(roi, i_d, j_d)
406  && vpPolygon::isInside(roi, i_d+shiftBorder_d, j_d+shiftBorder_d)
407  && vpPolygon::isInside(roi, i_d-shiftBorder_d, j_d+shiftBorder_d)
408  && vpPolygon::isInside(roi, i_d+shiftBorder_d, j_d-shiftBorder_d)
409  && vpPolygon::isInside(roi, i_d-shiftBorder_d, j_d-shiftBorder_d) ){
410  mask.at<unsigned char>(i,j) = nb;
411  }
412  }
413  else{
414  if(vpPolygon::isInside(roi, i, j)){
415  mask.at<unsigned char>(i,j) = nb;
416  }
417  }
418  }
419  }
420  #else
421  unsigned char* ptrData = (unsigned char*)mask->imageData + i_min*mask->widthStep+j_min;
422  for(int i=i_min; i< i_max; i++){
423  double i_d = (double) i;
424  for(int j=j_min; j< j_max; j++){
425  double j_d = (double) j;
426  if(shiftBorder != 0){
427  if( vpPolygon::isInside(roi, i_d, j_d)
428  && vpPolygon::isInside(roi, i_d+shiftBorder_d, j_d+shiftBorder_d)
429  && vpPolygon::isInside(roi, i_d-shiftBorder_d, j_d+shiftBorder_d)
430  && vpPolygon::isInside(roi, i_d+shiftBorder_d, j_d-shiftBorder_d)
431  && vpPolygon::isInside(roi, i_d-shiftBorder_d, j_d-shiftBorder_d) ){
432  *(ptrData++) = nb;
433  }
434  else{
435  ptrData++;
436  }
437  }
438  else{
439  if(vpPolygon::isInside(roi, i, j)){
440  *(ptrData++) = nb;
441  }
442  else{
443  ptrData++;
444  }
445  }
446  }
447  ptrData += mask->widthStep - j_max + j_min;
448  }
449  #endif
450  }
451  }
452 }
453 
459 void
461 {
462  std::map<int, vpImagePoint>::const_iterator iter = curPoints.begin();
463  for( ; iter != curPoints.end(); iter++){
464  int id(iter->first);
465  vpImagePoint iP;
466  iP.set_i(static_cast<double>(iter->second.get_i()));
467  iP.set_j(static_cast<double>(iter->second.get_j()));
468 
470 
471  iP.set_i( vpMath::round( iP.get_i() + 7 ) );
472  iP.set_j( vpMath::round( iP.get_j() + 7 ) );
473  char ide[10];
474  sprintf(ide, "%ld", static_cast<long int>(id));
475  vpDisplay::displayText(_I, iP, ide, vpColor::red);
476  }
477 }
478 
484 void
486 {
487  std::map<int, vpImagePoint>::const_iterator iter = curPoints.begin();
488  for( ; iter != curPoints.end(); iter++){
489  int id(iter->first);
490  vpImagePoint iP;
491  iP.set_i(static_cast<double>(iter->second.get_i()));
492  iP.set_j(static_cast<double>(iter->second.get_j()));
493 
495 
496  iP.set_i( vpMath::round( iP.get_i() + 7 ) );
497  iP.set_j( vpMath::round( iP.get_j() + 7 ) );
498  char ide[10];
499  sprintf(ide, "%ld", static_cast<long int>(id));
500  vpDisplay::displayText(_I, iP, ide, vpColor::red);
501  }
502 }
503 
504 void
506  const vpColor col, const unsigned int thickness, const bool /*displayFullModel*/)
507 {
508  //if(isvisible || displayFullModel)
509  {
510  // Perspective projection
511  circle1.changeFrame(cMo);
512  circle2.changeFrame(cMo);
513  cylinder.changeFrame(cMo);
514 
515  try{
516  circle1.projection();
517  }
518  catch(...){std::cout<<"Problem projection circle 1";}
519  try{
520  circle2.projection();
521  }
522  catch(...){std::cout<<"Problem projection circle 2";}
523 
524  cylinder.projection();
525 
526  double rho1,theta1;
527  double rho2,theta2;
528 
529  // Meters to pixels conversion
530  vpMeterPixelConversion::convertLine(camera,cylinder.getRho1(),cylinder.getTheta1(),rho1,theta1);
531  vpMeterPixelConversion::convertLine(camera,cylinder.getRho2(),cylinder.getTheta2(),rho2,theta2);
532 
533  // Determine intersections between circles and limbos
534  double i11,i12,i21,i22,j11,j12,j21,j22;
535 
536  vpCircle::computeIntersectionPoint(circle1, cam, rho1, theta1, i11, j11);
537  vpCircle::computeIntersectionPoint(circle2, cam, rho1, theta1, i12, j12);
538 
539  vpCircle::computeIntersectionPoint(circle1, cam, rho2, theta2, i21, j21);
540  vpCircle::computeIntersectionPoint(circle2, cam, rho2, theta2, i22, j22);
541 
542  // Create the image points
543  vpImagePoint ip11,ip12,ip21,ip22;
544  ip11.set_ij(i11,j11);
545  ip12.set_ij(i12,j12);
546  ip21.set_ij(i21,j21);
547  ip22.set_ij(i22,j22);
548 
549  // Display
550  vpDisplay::displayLine(I,ip11,ip12,col, thickness);
551  vpDisplay::displayLine(I,ip21,ip22,col, thickness);
552  }
553 }
554 
555 void
557  const vpColor col, const unsigned int thickness, const bool /*displayFullModel*/)
558 {
559  //if(isvisible || displayFullModel)
560  {
561  // Perspective projection
562  circle1.changeFrame(cMo);
563  circle2.changeFrame(cMo);
564  cylinder.changeFrame(cMo);
565 
566  try{
567  circle1.projection();
568  }
569  catch(...){std::cout<<"Problem projection circle 1";}
570  try{
571  circle2.projection();
572  }
573  catch(...){std::cout<<"Problem projection circle 2";}
574 
575  cylinder.projection();
576 
577  double rho1,theta1;
578  double rho2,theta2;
579 
580  // Meters to pixels conversion
581  vpMeterPixelConversion::convertLine(camera,cylinder.getRho1(),cylinder.getTheta1(),rho1,theta1);
582  vpMeterPixelConversion::convertLine(camera,cylinder.getRho2(),cylinder.getTheta2(),rho2,theta2);
583 
584  // Determine intersections between circles and limbos
585  double i11,i12,i21,i22,j11,j12,j21,j22;
586 
587  vpCircle::computeIntersectionPoint(circle1, camera, rho1, theta1, i11, j11);
588  vpCircle::computeIntersectionPoint(circle2, camera, rho1, theta1, i12, j12);
589 
590  vpCircle::computeIntersectionPoint(circle1, camera, rho2, theta2, i21, j21);
591  vpCircle::computeIntersectionPoint(circle2, camera, rho2, theta2, i22, j22);
592 
593  // Create the image points
594  vpImagePoint ip11,ip12,ip21,ip22;
595  ip11.set_ij(i11,j11);
596  ip12.set_ij(i12,j12);
597  ip21.set_ij(i21,j21);
598  ip22.set_ij(i22,j22);
599 
600  // Display
601  vpDisplay::displayLine(I,ip11,ip12,col, thickness);
602  vpDisplay::displayLine(I,ip21,ip22,col, thickness);
603  }
604 }
605 
606 
607 // ######################
608 // Private Functions
609 // ######################
610 
611 double
612 vpMbtDistanceKltCylinder::computeZ(const double &x, const double &y)
613 {
614  double A = x*x + y*y + 1 - ((cylinder.getA()*x+cylinder.getB()*y+cylinder.getC()) * (cylinder.getA()*x+cylinder.getB()*y+cylinder.getC()));
615  double B = (x * cylinder.getX() + y * cylinder.getY() + cylinder.getZ());
616  double C = cylinder.getX() * cylinder.getX() + cylinder.getY() * cylinder.getY() + cylinder.getZ() * cylinder.getZ() - cylinder.getR() * cylinder.getR();
617 
618  return (B - std::sqrt(B*B - A*C))/A;
619 }
620 #elif !defined(VISP_BUILD_SHARED_LIBS)
621 // Work arround to avoid warning: libvisp_mbt.a(vpMbtDistanceKltCylinder.cpp.o) has no symbols
622 void dummy_vpMbtDistanceKltCylinder() {};
623 #endif
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:92
void displayPrimitive(const vpImage< unsigned char > &_I)
unsigned int computeNbDetectedCurrent(const vpKltOpencv &_tracker)
double getY() const
Definition: vpCylinder.h:171
void removeOutliers(const vpColVector &weight, const double &threshold_outlier)
double get_i() const
Definition: vpImagePoint.h:190
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:84
Class to define colors available for display functionnalities.
Definition: vpColor.h:121
double getZ() const
Definition: vpCylinder.h:175
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
Definition: vpDisplay.cpp:888
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:144
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 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:248
double get_j() const
Definition: vpImagePoint.h:201
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)
Definition: vpPolygon.cpp:246
void set_i(const double ii)
Definition: vpImagePoint.h:154
double getTheta1() const
Definition: vpCylinder.h:137
void projection()
Definition: vpCircle.cpp:155
void computeInteractionMatrixAndResidu(const vpHomogeneousMatrix &cMc0, vpColVector &_R, vpMatrix &_J)
double getC() const
Definition: vpCylinder.h:163
double getB() const
Definition: vpCylinder.h:159
static void computeIntersectionPoint(const vpCircle &circle, const vpCameraParameters &cam, const double &rho, const double &theta, double &i, double &j)
Definition: vpCircle.cpp:373
virtual void displayCross(const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness=1)=0
Generic class defining intrinsic camera parameters.
double get_oZ() const
Get the point Z coordinate in the object frame.
Definition: vpPoint.cpp:451
void getFeature(const int &index, int &id, float &x, float &y) const
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:165
double get_oX() const
Get the point X coordinate in the object frame.
Definition: vpPoint.cpp:447
double getA() const
Definition: vpCylinder.h:155
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.
Definition: vpKltOpencv.h:75
int getNbFeatures() const
Get the number of current features.
Definition: vpKltOpencv.h:117
double getRho1() const
Definition: vpCylinder.h:131
double getTheta2() const
Definition: vpCylinder.h:150
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition: vpImagePoint.h:88
virtual void displayLine(const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)=0
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:176
void setWorldCoordinates(const vpColVector &oP)
Definition: vpCircle.cpp:62
double getX() const
Definition: vpCylinder.h:167
double getR() const
Definition: vpCylinder.h:179
std::vector< PolygonType * > & getPolygon()