ViSP  2.9.0
vpMbtPolygon.cpp
1 /****************************************************************************
2  *
3  * $Id: vpMbtPolygon.cpp 4632 2014-02-03 17:06:40Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2014 by INRIA. All rights reserved.
7  *
8  * This software is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * ("GPL") version 2 as published by the Free Software Foundation.
11  * See the file LICENSE.txt at the root directory of this source
12  * distribution for additional information about the GNU GPL.
13  *
14  * For using ViSP with software that can not be combined with the GNU
15  * GPL, please contact INRIA about acquiring a ViSP Professional
16  * Edition License.
17  *
18  * See http://www.irisa.fr/lagadic/visp/visp.html for more information.
19  *
20  * This software was developed at:
21  * INRIA Rennes - Bretagne Atlantique
22  * Campus Universitaire de Beaulieu
23  * 35042 Rennes Cedex
24  * France
25  * http://www.irisa.fr/lagadic
26  *
27  * If you have questions regarding the use of this file, please contact
28  * INRIA at visp@inria.fr
29  *
30  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
31  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
32  *
33  *
34  * Description:
35  * Make the complete tracking of an object by using its CAD model
36  *
37  * Authors:
38  * Nicolas Melchior
39  * Romain Tallonneau
40  * Eric Marchand
41  * Aurelien Yol
42  *
43  *****************************************************************************/
44 
45 #include <limits.h>
46 
47 #include <visp/vpConfig.h>
53 #include <visp/vpMbtPolygon.h>
54 
59  : index(-1), nbpt(0), nbCornersInsidePrev(0), isvisible(false), isappearing(false),
60  p(NULL), roiPointsClip(), clippingFlag(vpMbtPolygon::NO_CLIPPING),
61  distNearClip(0.001), distFarClip(100.)
62 {
63 }
64 
66  : index(-1), nbpt(0), nbCornersInsidePrev(0), isvisible(false), isappearing(false),
67  p(NULL), roiPointsClip(), clippingFlag(vpMbtPolygon::NO_CLIPPING),
68  distNearClip(0.001), distFarClip(100.)
69 {
70  *this = mbtp;
71 }
72 
74 {
75  index = mbtp.index;
76  nbpt = mbtp.nbpt;
78  isvisible = mbtp.isvisible;
79  isappearing = mbtp.isappearing;
83 
84  if (p) delete [] p;
85  p = new vpPoint [nbpt];
86  for(unsigned int i = 0; i < nbpt; i++)
87  p[i] = mbtp.p[i];
88 
89  return (*this);
90 }
91 
96 {
97  if (p !=NULL)
98  {
99  delete[] p;
100  p = NULL;
101  }
102 }
103 
111 vpPoint &
112 vpMbtPolygon::getPoint(const unsigned int _index)
113 {
114  if(_index >= nbpt){
115  throw vpException(vpException::dimensionError, "index out of range");
116  }
117  return p[_index];
118 }
119 
125 void
126 vpMbtPolygon::setNbPoint(const unsigned int nb)
127 {
128  nbpt = nb ;
129  if (p != NULL)
130  delete[] p;
131  p = new vpPoint[nb] ;
132 }
133 
140 void
141 vpMbtPolygon::addPoint(const unsigned int n, const vpPoint &P)
142 {
143  //if( p!NULL && n < nbpt )
144  p[n] = P ;
145 }
146 
152 void
154 {
155  for (unsigned int i = 0 ; i < nbpt ; i++)
156  {
157  p[i].changeFrame(cMo) ;
158  p[i].projection() ;
159  }
160 }
161 
175 bool
176 vpMbtPolygon::isVisible(const vpHomogeneousMatrix &cMo, const double alpha, const bool &modulo)
177 {
178  // std::cout << "Computing angle from MBT Face (cMo, alpha)" << std::endl;
179  if(nbpt <= 2){
180  /* a line is allways visible */
181  isvisible = true;
182  isappearing = false;
183  return true ;
184  }
185 
186  changeFrame(cMo);
187 
188  vpColVector e1(3) ;
189  vpColVector e2(3) ;
190  vpColVector facenormal(3) ;
191 
192  e1[0] = p[1].get_X() - p[0].get_X() ;
193  e1[1] = p[1].get_Y() - p[0].get_Y() ;
194  e1[2] = p[1].get_Z() - p[0].get_Z() ;
195 
196  e2[0] = p[2].get_X() - p[1].get_X() ;
197  e2[1] = p[2].get_Y() - p[1].get_Y() ;
198  e2[2] = p[2].get_Z() - p[1].get_Z() ;
199 
200  e1.normalize();
201  e2.normalize();
202 
203  facenormal = vpColVector::crossProd(e1,e2) ;
204  facenormal.normalize();
205 
206  vpColVector e4(3) ;
207  vpPoint pt;
208  for (unsigned int i = 0; i < nbpt; i += 1){
209  pt.set_X(pt.get_X() + p[i].get_X());
210  pt.set_Y(pt.get_Y() + p[i].get_Y());
211  pt.set_Z(pt.get_Z() + p[i].get_Z());
212  }
213  e4[0] = -pt.get_X()/(double)nbpt; e4[1] = -pt.get_Y()/(double)nbpt; e4[2] = -pt.get_Z()/(double)nbpt;
214  e4.normalize();
215 
216  double cos_angle = vpColVector::dotProd (e4, facenormal);
217  double angle = acos(cos_angle);
218 
219 // std::cout << cos_angle << "/" << vpMath::deg(angle) << std::endl;
220 
221  if( angle < alpha ){
222  isvisible = true;
223  isappearing = false;
224  return true;
225  }
226 
227  if(modulo && (M_PI - angle) < alpha){
228  isvisible = true;
229  isappearing = false;
230  return true;
231  }
232 
233  if (angle < alpha+vpMath::rad(1) ){
234  isappearing = true;
235  }
236  else if (modulo && (M_PI - angle) < alpha+vpMath::rad(1) ){
237  isappearing = true;
238  }
239  else {
240  isappearing = false;
241  }
242  isvisible = false ;
243  return false ;
244 }
245 
251 void
253 {
254  roiPointsClip = std::vector<std::pair<vpPoint,unsigned int> >();
255  std::vector<vpColVector> fovNormals;
256 
257  if(cam.isFovComputed() && clippingFlag > 3)
258  fovNormals = cam.getFovNormals();
259 
260  for (unsigned int i = 0; i < nbpt; i ++){
261  vpPoint p1Clipped, p2Clipped;
262  unsigned int p1ClippedInfo, p2ClippedInfo;
263  vpImagePoint ip;
264  if(vpMbtPolygon::getClippedPoints(p[i], p[(i+1)%nbpt], p1Clipped, p2Clipped, p1ClippedInfo, p2ClippedInfo, cam, fovNormals)){
265  p1Clipped.projection();
266  roiPointsClip.push_back(std::make_pair(p1Clipped, p1ClippedInfo));
267 
268  if(p2ClippedInfo != vpMbtPolygon::NO_CLIPPING){
269  p2Clipped.projection();
270  roiPointsClip.push_back(std::make_pair(p2Clipped, p2ClippedInfo));
271  }
272 
273  if(nbpt == 2){ //Case of a line.
274  if(p2ClippedInfo == vpMbtPolygon::NO_CLIPPING){
275  p2Clipped.projection();
276  roiPointsClip.push_back(std::make_pair(p2Clipped, p2ClippedInfo));
277  }
278  break;
279  }
280  }
281  }
282 }
283 
302 bool
303 vpMbtPolygon::getClippedPointsFov(const vpPoint &p1, const vpPoint &p2,
304  vpPoint &p1Clipped, vpPoint &p2Clipped,
305  unsigned int &p1ClippedInfo, unsigned int &p2ClippedInfo,
306  const vpColVector &normal, const unsigned int &flag)
307 {
308  vpRowVector p1Vec(3);
309  p1Vec[0] = p1.get_X(); p1Vec[1] = p1.get_Y(); p1Vec[2] = p1.get_Z();
310  p1Vec = p1Vec.normalize();
311 
312  vpRowVector p2Vec(3);
313  p2Vec[0] = p2.get_X(); p2Vec[1] = p2.get_Y(); p2Vec[2] = p2.get_Z();
314  p2Vec = p2Vec.normalize();
315 
316  if((clippingFlag & flag) == flag){
317  double beta1 = acos( p1Vec * normal );
318  double beta2 = acos( p2Vec * normal );
319 
320  if(beta1 < M_PI / 2.0 && beta2 < M_PI / 2.0)
321  return false;
322  else if (beta1 < M_PI / 2.0 || beta2 < M_PI / 2.0){
323  vpPoint pClipped;
324  double t = -(normal[0] * p1.get_X() + normal[1] * p1.get_Y() + normal[2] * p1.get_Z());
325  t = t / ( normal[0] * (p2.get_X() - p1.get_X()) + normal[1] * (p2.get_Y() - p1.get_Y()) + normal[2] * (p2.get_Z() - p1.get_Z()) );
326 
327  pClipped.set_X((p2.get_X() - p1.get_X())*t + p1.get_X());
328  pClipped.set_Y((p2.get_Y() - p1.get_Y())*t + p1.get_Y());
329  pClipped.set_Z((p2.get_Z() - p1.get_Z())*t + p1.get_Z());
330 
331  if(beta1 < M_PI / 2.0){
332  p1ClippedInfo = p1ClippedInfo | flag;
333  p1Clipped = pClipped;
334  }
335  else{
336  p2ClippedInfo = p2ClippedInfo | flag;
337  p2Clipped = pClipped;
338  }
339  }
340  }
341 
342  return true;
343 }
344 
358 bool
359 vpMbtPolygon::getClippedPoints(const vpPoint &p1, const vpPoint &p2,
360  vpPoint &p1Clipped, vpPoint &p2Clipped,
361  unsigned int &p1ClippedInfo, unsigned int &p2ClippedInfo,
362  const vpCameraParameters &cam, const std::vector<vpColVector> &fovNormals)
363 {
364  p1Clipped = p1;
365  p2Clipped = p2;
366  p1ClippedInfo = vpMbtPolygon::NO_CLIPPING;
367  p2ClippedInfo = vpMbtPolygon::NO_CLIPPING;
368 
370  // Near Clipping
371  if( (clippingFlag & vpMbtPolygon::NEAR_CLIPPING) == vpMbtPolygon::NEAR_CLIPPING ||
372  ((clippingFlag & vpMbtPolygon::LEFT_CLIPPING) == vpMbtPolygon::LEFT_CLIPPING && (clippingFlag & vpMbtPolygon::RIGHT_CLIPPING) == vpMbtPolygon::RIGHT_CLIPPING) ||
373  ((clippingFlag & vpMbtPolygon::UP_CLIPPING) == vpMbtPolygon::UP_CLIPPING && (clippingFlag & vpMbtPolygon::DOWN_CLIPPING) == vpMbtPolygon::DOWN_CLIPPING)){
374  if(p1Clipped.get_Z() < distNearClip && p2Clipped.get_Z() < distNearClip) //Not using getClippedPointsFov for efficiency
375  return false;
376  else if(p1Clipped.get_Z() < distNearClip || p2Clipped.get_Z() < distNearClip){
377  vpPoint pClippedNear;
378  double t = (p2Clipped.get_Z() - p1Clipped.get_Z());
379  t = (distNearClip - p1Clipped.get_Z()) / t;
380 
381  pClippedNear.set_X((p2Clipped.get_X() - p1Clipped.get_X())*t + p1Clipped.get_X());
382  pClippedNear.set_Y((p2Clipped.get_Y() - p1Clipped.get_Y())*t + p1Clipped.get_Y());
383  pClippedNear.set_Z(distNearClip);
384 
385  if(p1Clipped.get_Z() < distNearClip){
386  p1Clipped = pClippedNear;
387  p1ClippedInfo = p1ClippedInfo | vpMbtPolygon::NEAR_CLIPPING;
388  }
389  else{
390  p2Clipped = pClippedNear;
391  p2ClippedInfo = p2ClippedInfo | vpMbtPolygon::NEAR_CLIPPING;
392  }
393  }
394  }
395 
396  // Left Clipping
397  if((clippingFlag & vpMbtPolygon::LEFT_CLIPPING) == vpMbtPolygon::LEFT_CLIPPING){
398  if(!cam.isFovComputed())
399  vpTRACE("Field of view not computed, left clipping skipped.");
400  else if(!getClippedPointsFov(p1Clipped, p2Clipped, p1Clipped, p2Clipped, p1ClippedInfo, p2ClippedInfo,
401  fovNormals[0], vpMbtPolygon::LEFT_CLIPPING))
402  return false;
403  }
404 
405  // Right Clipping
406  if((clippingFlag & vpMbtPolygon::RIGHT_CLIPPING) == vpMbtPolygon::RIGHT_CLIPPING ){
407  if(!cam.isFovComputed())
408  vpTRACE("Field of view not computed, right clipping skipped.");
409  else if(!getClippedPointsFov(p1Clipped, p2Clipped, p1Clipped, p2Clipped, p1ClippedInfo, p2ClippedInfo,
410  fovNormals[1], vpMbtPolygon::RIGHT_CLIPPING))
411  return false;
412  }
413 
414  // Up Clipping
415  if((clippingFlag & vpMbtPolygon::UP_CLIPPING) == vpMbtPolygon::UP_CLIPPING){
416  if(!cam.isFovComputed())
417  vpTRACE("Field of view not computed, up clipping skipped.");
418  else if(!getClippedPointsFov(p1Clipped, p2Clipped, p1Clipped, p2Clipped, p1ClippedInfo, p2ClippedInfo,
419  fovNormals[2], vpMbtPolygon::UP_CLIPPING))
420  return false;
421  }
422 
423  // Down Clipping
424  if((clippingFlag & vpMbtPolygon::DOWN_CLIPPING) == vpMbtPolygon::DOWN_CLIPPING ){
425  if(!cam.isFovComputed())
426  vpTRACE("Field of view not computed, down clipping skipped.");
427  else if(!getClippedPointsFov(p1Clipped, p2Clipped, p1Clipped, p2Clipped, p1ClippedInfo, p2ClippedInfo,
428  fovNormals[3], vpMbtPolygon::DOWN_CLIPPING))
429  return false;
430  }
431 
432  // Far Clipping
434  if(p1Clipped.get_Z() > distFarClip && p2Clipped.get_Z() > distFarClip) //Not using getClippedPointsFov for efficiency
435  return false;
436  else if(p1Clipped.get_Z() > distFarClip || p2Clipped.get_Z() > distFarClip){
437  vpPoint pClippedFar;
438  double t = (p2Clipped.get_Z() - p1Clipped.get_Z());
439  t = (distFarClip - p1Clipped.get_Z()) / t;
440 
441  pClippedFar.set_X((p2Clipped.get_X() - p1Clipped.get_X())*t + p1Clipped.get_X());
442  pClippedFar.set_Y((p2Clipped.get_Y() - p1Clipped.get_Y())*t + p1Clipped.get_Y());
443  pClippedFar.set_Z(distFarClip);
444 
445  if(p1Clipped.get_Z() > distFarClip){
446  p1Clipped = pClippedFar;
447  p1ClippedInfo = p1ClippedInfo | vpMbtPolygon::FAR_CLIPPING;
448  }
449  else{
450  p2Clipped = pClippedFar;
451  p2ClippedInfo = p2ClippedInfo | vpMbtPolygon::FAR_CLIPPING;
452  }
453  }
454  }
455  }
456 
457  return true;
458 }
459 
469 std::vector<vpImagePoint>
471 {
472  std::vector<vpImagePoint> roi;
473  for (unsigned int i = 0; i < nbpt; i ++){
474  vpImagePoint ip;
475  vpMeterPixelConversion::convertPoint(cam, p[i].get_x(), p[i].get_y(), ip);
476  roi.push_back(ip);
477  }
478 
479  return roi;
480 }
481 
490 std::vector<vpImagePoint>
492 {
493  changeFrame(cMo);
494  return getRoi(cam);
495 }
496 
505 void
506 vpMbtPolygon::getRoiClipped(const vpCameraParameters &cam, std::vector<vpImagePoint> &roi)
507 {
508  for(unsigned int i = 0 ; i < roiPointsClip.size() ; i++){
509  vpImagePoint ip;
510  vpMeterPixelConversion::convertPoint(cam,roiPointsClip[i].first.get_x(),roiPointsClip[i].first.get_y(),ip);
511  roi.push_back(ip);
512  }
513 }
514 
522 void
523 vpMbtPolygon::getRoiClipped(const vpCameraParameters &cam, std::vector<vpImagePoint> &roi, const vpHomogeneousMatrix &cMo)
524 {
525  changeFrame(cMo);
526  computeRoiClipped(cam);
527  getRoiClipped(cam, roi);
528 }
529 
538 void
539 vpMbtPolygon::getRoiClipped(const vpCameraParameters &cam, std::vector<std::pair<vpImagePoint,unsigned int> > &roi)
540 {
541  for(unsigned int i = 0 ; i < roiPointsClip.size() ; i++){
542  vpImagePoint ip;
543  vpMeterPixelConversion::convertPoint(cam,roiPointsClip[i].first.get_x(),roiPointsClip[i].first.get_y(),ip);
544  roi.push_back(std::make_pair(ip, roiPointsClip[i].second));
545  }
546 }
547 
555 void
556 vpMbtPolygon::getRoiClipped(const vpCameraParameters &cam, std::vector<std::pair<vpImagePoint,unsigned int> > &roi, const vpHomogeneousMatrix &cMo)
557 {
558  changeFrame(cMo);
559  computeRoiClipped(cam);
560  getRoiClipped(cam, roi);
561 }
562 
563 
564 
571 unsigned int
573 {
574  unsigned int nbPolyIn = 0;
575  for (unsigned int i = 0; i < nbpt; i ++){
576  if(p[i].get_Z() > 0){
577  vpImagePoint ip;
578  vpMeterPixelConversion::convertPoint(cam, p[i].get_x(), p[i].get_y(), ip);
579  if((ip.get_i() >= 0) && (ip.get_j() >= 0) && (ip.get_i() < I.getHeight()) && (ip.get_j() < I.getWidth()))
580  nbPolyIn++;
581  }
582  }
583 
584  nbCornersInsidePrev = nbPolyIn;
585 
586  return nbPolyIn;
587 }
588 
589 //###################################
590 // Static functions
591 //###################################
592 
593 void
594 vpMbtPolygon::getMinMaxRoi(const std::vector<vpImagePoint> &iroi, int & i_min, int &i_max, int &j_min, int &j_max)
595 {
596  // i_min_d = std::numeric_limits<double>::max(); // create an error under Windows. To fix it we have to add #undef max
597  double i_min_d = (double) INT_MAX;
598  double i_max_d = 0;
599  double j_min_d = (double) INT_MAX;
600  double j_max_d = 0;
601 
602  for (unsigned int i = 0; i < iroi.size(); i += 1){
603  if(i_min_d > iroi[i].get_i())
604  i_min_d = iroi[i].get_i();
605 
606  if(iroi[i].get_i() < 0)
607  i_min_d = 1;
608 
609  if((iroi[i].get_i() > 0) && (i_max_d < iroi[i].get_i()))
610  i_max_d = iroi[i].get_i();
611 
612  if(j_min_d > iroi[i].get_j())
613  j_min_d = iroi[i].get_j();
614 
615  if(iroi[i].get_j() < 0)
616  j_min_d = 1;//border
617 
618  if((iroi[i].get_j() > 0) && j_max_d < iroi[i].get_j())
619  j_max_d = iroi[i].get_j();
620  }
621  i_min = static_cast<int> (i_min_d);
622  i_max = static_cast<int> (i_max_d);
623  j_min = static_cast<int> (j_min_d);
624  j_max = static_cast<int> (j_max_d);
625 }
626 
634 bool
635 vpMbtPolygon::roiInsideImage(const vpImage<unsigned char>& I, const std::vector<vpImagePoint>& corners)
636 {
637  double nbPolyIn = 0;
638  for(unsigned int i=0; i<corners.size(); ++i){
639  if((corners[i].get_i() >= 0) && (corners[i].get_j() >= 0) &&
640  (corners[i].get_i() < I.getHeight()) && (corners[i].get_j() < I.getWidth())){
641  nbPolyIn++;
642  }
643  }
644 
645  if(nbPolyIn < 3 && nbPolyIn < 0.7 * corners.size())
646  return false;
647 
648  return true;
649 }
650 
651 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
652 
662 bool
663 vpMbtPolygon::isVisible(const vpHomogeneousMatrix &cMo, const bool &depthTest)
664 {
665  changeFrame(cMo) ;
666 
667  if(depthTest)
668  for (unsigned int i = 0 ; i < nbpt ; i++){
669  if(p[i].get_Z() < 0){
670  isappearing = false;
671  isvisible = false ;
672  return false ;
673  }
674  }
675 
676  return isVisible(cMo, vpMath::rad(89));
677 }
678 #endif
679 
680 
void projection(const vpColVector &_cP, vpColVector &_p)
Projection onto the image plane of a point. Input: the 3D coordinates in the camera frame _cP...
Definition: vpPoint.cpp:132
void changeFrame(const vpHomogeneousMatrix &cMo)
bool isVisible() const
Definition: vpMbtPolygon.h:190
unsigned int getNbCornerInsideImage(const vpImage< unsigned char > &I, const vpCameraParameters &cam)
double get_i() const
Definition: vpImagePoint.h:194
unsigned int getWidth() const
Definition: vpImage.h:159
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
#define vpTRACE
Definition: vpDebug.h:418
unsigned int clippingFlag
Clipping flag.
Definition: vpMbtPolygon.h:99
virtual ~vpMbtPolygon()
Definition of the row vector class.
Definition: vpRowVector.h:73
bool isFovComputed() const
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 ...
vpPoint & getPoint(const unsigned int _index)
int index
Index of the polygon. Cannot be unsigned int because default value is -1.
Definition: vpMbtPolygon.h:85
error that can be emited by ViSP classes.
Definition: vpException.h:76
void getRoiClipped(const vpCameraParameters &cam, std::vector< vpImagePoint > &roi)
unsigned int nbpt
Number of points used to define the polygon.
Definition: vpMbtPolygon.h:87
vpMbtPolygon & operator=(const vpMbtPolygon &mbtp)
void set_X(const double X)
Set the point X coordinate in the camera frame.
Definition: vpPoint.h:176
unsigned int nbCornersInsidePrev
Number of corners inside the image during the last call to getNbCornerInsideImage.
Definition: vpMbtPolygon.h:89
double get_j() const
Definition: vpImagePoint.h:205
Class that defines what is a point.
Definition: vpPoint.h:65
std::vector< std::pair< vpPoint, unsigned int > > roiPointsClip
Region of interest clipped.
Definition: vpMbtPolygon.h:97
double distFarClip
Distance for near clipping.
Definition: vpMbtPolygon.h:103
void addPoint(const unsigned int n, const vpPoint &P)
void set_Z(const double Z)
Set the point Z coordinate in the camera frame.
Definition: vpPoint.h:180
Implementation of a polygon of the model used by the model-based tracker.
Definition: vpMbtPolygon.h:67
Generic class defining intrinsic camera parameters.
void set_Y(const double Y)
Set the point Y coordinate in the camera frame.
Definition: vpPoint.h:178
void computeRoiClipped(const vpCameraParameters &cam=vpCameraParameters())
double get_Y() const
Get the point Y coordinate in the camera frame.
Definition: vpPoint.h:120
static double rad(double deg)
Definition: vpMath.h:100
double get_Z() const
Get the point Z coordinate in the camera frame.
Definition: vpPoint.h:122
std::vector< vpImagePoint > getRoi(const vpCameraParameters &cam)
bool isappearing
flag to specify whether the face is appearing or not
Definition: vpMbtPolygon.h:93
Class that provides a data structure for the column vectors as well as a set of operations on these v...
Definition: vpColVector.h:72
std::vector< vpColVector > getFovNormals() const
static double dotProd(const vpColVector &a, const vpColVector &b)
Dot Product.
static void getMinMaxRoi(const std::vector< vpImagePoint > &roi, int &i_min, int &i_max, int &j_min, int &j_max)
unsigned int getHeight() const
Definition: vpImage.h:150
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition: vpImagePoint.h:92
static bool roiInsideImage(const vpImage< unsigned char > &I, const std::vector< vpImagePoint > &corners)
static vpColVector crossProd(const vpColVector &a, const vpColVector &b)
normalise the vector
void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &_cP)
Definition: vpPoint.cpp:150
virtual void setNbPoint(const unsigned int nb)
bool isvisible
flag to specify whether the face is visible or not
Definition: vpMbtPolygon.h:91
vpColVector & normalize()
normalise the vector
double get_X() const
Get the point X coordinate in the camera frame.
Definition: vpPoint.h:118
double distNearClip
Distance for near clipping.
Definition: vpMbtPolygon.h:101
vpPoint * p
corners in the object frame
Definition: vpMbtPolygon.h:95