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>
80 if (
p1 != NULL)
delete p1 ;
81 if (
p2 != NULL)
delete p2 ;
133 double norm = sqrt(A*A+B*B+C*C) ;
157 buildPlane(P1,P2,P3,plane1) ;
158 buildPlane(P1,P2,P4,plane2) ;
194 if(std::fabs((V1-V2).sumSquare()) > std::numeric_limits<double>::epsilon())
197 V3[0]=double(rand()%1000)/100;
198 V3[1]=double(rand()%1000)/100;
199 V3[2]=double(rand()%1000)/100;
269 while (theta > M_PI) { theta -= M_PI ; }
270 while (theta < -M_PI) { theta += M_PI ; }
272 if (theta < -M_PI/2.0) theta = -theta - 3*M_PI/2.0;
273 else theta = M_PI/2.0 - theta;
367 while (theta > M_PI) { theta -= M_PI ; }
368 while (theta < -M_PI) { theta += M_PI ; }
370 if (theta < -M_PI/2.0) theta = -theta - 3*M_PI/2.0;
371 else theta = M_PI/2.0 - theta;
424 if (
isvisible ==
true || displayFullModel)
455 if (
isvisible ==
true || displayFullModel)
523 double rho = featureline.
getRho() ;
524 double theta = featureline.
getTheta() ;
526 double co = cos(theta);
527 double si = sin(theta);
529 double mx = 1.0/cam.
get_px() ;
530 double my = 1.0/cam.
get_py() ;
531 double xc = cam.
get_u0() ;
532 double yc = cam.
get_v0() ;
550 double *Lrho = H[0] ;
551 double *Ltheta = H[1] ;
553 for (
unsigned int k=0 ; k < 6 ; k++)
555 L[j][k] = (Lrho[k] + alpha*Ltheta[k]);
557 error[j] = rho - ( x*co + y*si) ;
586 if( ((
unsigned int)i > (I.
getHeight()- threshold) ) || (
unsigned int)i < threshold ||
587 ((
unsigned int)j > (I.
getWidth ()- threshold) ) || (
unsigned int)j < threshold ) {
Definition of the vpMatrix class.
void projection(const vpColVector &_cP, vpColVector &_p)
Projection onto the image plane of a point. Input: the 3D coordinates in the camera frame _cP...
vpLine * line
The 3D line.
void updateMovingEdge(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo)
unsigned int getWidth() 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.
double get_y() const
Get the point y coordinate in the image plane.
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)
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.
double get_x() const
Get the point x coordinate in the image plane.
vpMatrix interaction(const unsigned int select=FEATURE_ALL)
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)
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)