43 #include <visp/vpConfig.h>
50 #include <visp/vpMbtDistanceLine.h>
51 #include <visp/vpPlane.h>
52 #include <visp/vpMeterPixelConversion.h>
53 #include <visp/vpFeatureBuilder.h>
130 double norm = sqrt(A*A+B*B+C*C) ;
154 buildPlane(P1,P2,P3,plane1) ;
155 buildPlane(P1,P2,P4,plane2) ;
192 if(std::fabs((V1-V2).sumSquare()) > std::numeric_limits<double>::epsilon())
195 V3[0]=double(rand()%1000)/100;
196 V3[1]=double(rand()%1000)/100;
197 V3[2]=double(rand()%1000)/100;
270 while (theta > M_PI) { theta -= M_PI ; }
271 while (theta < -M_PI) { theta += M_PI ; }
273 if (theta < -M_PI/2.0) theta = -theta - 3*M_PI/2.0;
274 else theta = M_PI/2.0 - theta;
378 while (theta > M_PI) { theta -= M_PI ; }
379 while (theta < -M_PI) { theta += M_PI ; }
381 if (theta < -M_PI/2.0) theta = -theta - 3*M_PI/2.0;
382 else theta = M_PI/2.0 - theta;
558 double rho = featureline.
getRho() ;
559 double theta = featureline.
getTheta() ;
561 double co = cos(theta);
562 double si = sin(theta);
564 double mx = 1.0/cam.
get_px() ;
565 double my = 1.0/cam.
get_py() ;
566 double xc = cam.
get_u0() ;
567 double yc = cam.
get_v0() ;
585 double *Lrho = H[0] ;
586 double *Ltheta = H[1] ;
588 for (
unsigned int k=0 ; k < 6 ; k++)
590 L[j][k] = (Lrho[k] + alpha*Ltheta[k]);
592 error[j] = rho - ( x*co + y*si) ;
621 if( ((
unsigned int)i > (I.
getHeight()- threshold) ) || (
unsigned int)i < threshold ||
622 ((
unsigned int)j > (I.
getWidth ()- threshold) ) || (
unsigned int)j < threshold ) {
Definition of the vpMatrix class.
vpLine * line
The 3D line.
void updateMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo)
unsigned int getWidth() const
unsigned int getClipping() const
bool Reinit
Indicates if the line has to be reinitialized.
static vpColVector cross(const vpColVector &a, const vpColVector &b)
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
void setWorldCoordinates(const double &A1, const double &B1, const double &C1, const double &D1, const double &A2, const double &B2, const double &C2, const double &D2)
Performs search in a given direction(normal) for a given distance(pixels) for a given 'site'...
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 trackMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo)
void track(const vpImage< unsigned char > &I)
vpPoint * p1
The first extremity.
void displayMovingEdges(const vpImage< unsigned char > &I)
double get_oY() const
Get the point Y coordinate in the object frame.
Contains predetermined masks for sites and holds moving edges tracking parameters.
Implementation of a line used by the model-based tracker.
void initTracking(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, double rho, double theta)
bool isvisible
Indicates if the line is visible or not.
void display(const vpImage< unsigned char > &, vpColor)
unsigned int nbFeature
The number of moving edges.
Class that defines what is a point.
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)
std::vector< std::pair< vpPoint, unsigned int > > roiPointsClip
Region of interest clipped.
void addPoint(const unsigned int n, const vpPoint &P)
Class that defines a line in the object frame, the camera frame and the image plane. All the parameters must be set in meter.
void reinitMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo)
void updateParameters(const vpImage< unsigned char > &I, double rho, double theta)
vpPoint * p2
The second extremity.
void setInitRange(const unsigned int &r)
vpColVector error
The error vector.
Generic class defining intrinsic camera parameters.
double get_oZ() const
Get the point Z coordinate in the object frame.
vpMatrix interaction(const unsigned int select=FEATURE_ALL)
void computeRoiClipped(const vpCameraParameters &cam=vpCameraParameters())
std::list< vpMeSite > & getMeList()
void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &cP)
void setA(const double A)
void setC(const double C)
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 setD(const double D)
double get_oX() const
Get the point X coordinate in the object frame.
bool closeToImageBorder(const vpImage< unsigned char > &I, const unsigned int threshold)
Class that provides a data structure for the column vectors as well as a set of operations on these v...
void setMovingEdge(vpMe *Me)
void computeInteractionMatrixError(const vpHomogeneousMatrix &cMo)
vpMbHiddenFaces< vpMbtPolygon > * hiddenface
Pointer to the list of faces.
unsigned int getHeight() const
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
This class defines the container for a plane geometrical structure.
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d)
void setB(const double B)
void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &_cP)
void initMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo)
virtual void setNbPoint(const unsigned int nb)
void initInteractionMatrixError()
vpMbtMeLine * meline
The moving edge container.
void buildFrom(vpPoint &_p1, vpPoint &_p2)
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 resize(const unsigned int i, const bool flagNullify=true)
void computeFov(const unsigned int &w, const unsigned int &h)
vpPoint * p
corners in the object frame