47 #include <visp/vpConfig.h>
53 #include <visp/vpMbtPolygon.h>
129 for (
unsigned int i = 0 ; i <
nbpt ; i++)
150 for (
unsigned int i = 0 ; i <
nbpt ; i++){
151 if(
p[i].get_Z() < 0){
179 double angle =
p[0].
get_X()*facenormal[0] +
p[0].
get_Y()*facenormal[1] +
p[0].
get_Z()*facenormal[2] ;
190 if (angle < 0.0000001 ){
244 for (
unsigned int i = 0; i <
nbpt; i += 1){
249 e4[0] = -pt.
get_X()/(double)nbpt; e4[1] = -pt.
get_Y()/(double)nbpt; e4[2] = -pt.
get_Z()/(double)nbpt;
253 double my_angle = acos(angle2);
257 if( my_angle < alpha ){
268 std::vector<vpImagePoint>
271 std::vector<vpImagePoint> roi;
272 for (
unsigned int i = 0; i <
nbpt; i ++){
288 double i_min_d = (double) INT_MAX;
290 double j_min_d = (double) INT_MAX;
293 for (
unsigned int i = 0; i < roi.size(); i += 1){
294 if(i_min_d > roi[i].get_i())
295 i_min_d = roi[i].get_i();
297 if(roi[i].get_i() < 0)
300 if((roi[i].get_i() > 0) && (i_max_d < roi[i].get_i()))
301 i_max_d = roi[i].get_i();
303 if(j_min_d > roi[i].get_j())
304 j_min_d = roi[i].get_j();
306 if(roi[i].get_j() < 0)
309 if((roi[i].get_j() > 0) && j_max_d < roi[i].get_j())
310 j_max_d = roi[i].get_j();
312 i_min =
static_cast<int> (i_min_d);
313 i_max =
static_cast<int> (i_max_d);
314 j_min =
static_cast<int> (j_min_d);
315 j_max =
static_cast<int> (j_max_d);
328 for(
unsigned int i=0; i<corners.size(); ++i){
329 if((corners[i].get_i() < 0) || (corners[i].get_j() < 0) ||
void projection(const vpColVector &_cP, vpColVector &_p)
Projection onto the image plane of a point. Input: the 3D coordinates in the camera frame _cP...
void changeFrame(const vpHomogeneousMatrix &cMo)
unsigned int getWidth() const
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
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)
error that can be emited by ViSP classes.
unsigned int nbpt
Number of points used to define the polygon.
void set_X(const double X)
Set the point X coordinate in the camera frame.
Class that defines what is a point.
void addPoint(const unsigned int n, const vpPoint &P)
void set_Z(const double Z)
Set the point Z coordinate in the camera frame.
Generic class defining intrinsic camera parameters.
std::vector< vpImagePoint > getRoi(const vpCameraParameters &_cam)
void set_Y(const double Y)
Set the point Y coordinate in the camera frame.
double get_Y() const
Get the point Y coordinate in the camera frame.
double get_Z() const
Get the point Z coordinate in the camera frame.
bool isappearing
flag to specify whether the face is appearing or not
Class that provides a data structure for the column vectors as well as a set of operations on these v...
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
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
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)
virtual void setNbPoint(const unsigned int nb)
bool isvisible
flag to specify whether the face is visible or not
vpColVector & normalize()
normalise the vector
double get_X() const
Get the point X coordinate in the camera frame.
vpPoint * p
corners in the object frame