43 #include <visp/vpCylinder.h>
44 #include <visp/vpFeatureDisplay.h>
92 const double X0,
const double Y0,
150 const double X0,
const double Y0,
227 double co, si, e, x0, y0, z0;
228 double A,B,C, X0, Y0, Z0, R ;
229 double s, a, b, c, zero;
238 zero = A*X0 + B*Y0 + C*Z0;
240 s = X0*X0 + Y0*Y0 + Z0*Z0 - R*R - zero*zero;
243 printf(
"The camera is inside the cylinder!\n");
257 e = sqrt(co*co + si*si);
258 p_[0] = -(R*c*s-z0)/e ;
259 p_[1] = atan2(si,co) ;
267 e = sqrt(co*co + si*si);
268 p_[2] = -( R*c*s+z0 )/e ;
269 p_[3] = atan2( si,co ) ;
308 double oA,oB,oC, oX0, oY0, oZ0 ;
316 X1 = cMo[0][0]*oA + cMo[0][1]*oB + cMo[0][2]*oC ;
317 Y1 = cMo[1][0]*oA + cMo[1][1]*oB + cMo[1][2]*oC ;
318 Z1 = cMo[2][0]*oA + cMo[2][1]*oB + cMo[2][2]*oC ;
319 s = sqrt ( X1*X1 + Y1*Y1 + Z1*Z1 );
329 X2 = cMo[0][3] + cMo[0][0]*oX0 + cMo[0][1]*oY0 + cMo[0][2]*oZ0;
330 Y2 = cMo[1][3] + cMo[1][0]*oX0 + cMo[1][1]*oY0 + cMo[1][2]*oZ0;
331 Z2 = cMo[2][3] + cMo[2][0]*oX0 + cMo[2][1]*oY0 + cMo[2][2]*oZ0;
335 cP_[3] = (1-a*a)*X2 - a*b*Y2 - a*c*Z2;
336 cP_[4] = -a*b*X2 + (1-b*b)*Y2 - b*c*Z2;
337 cP_[5] = -a*c*X2 - b*c*Y2 + (1-c*c)*Z2;
407 const unsigned int thickness)
414 cam, I, color, thickness) ;
425 const unsigned int thickness)
428 cam, I, color, thickness) ;
vpCylinder * duplicate() const
for memory issue (used by the vpServo class only)
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
static void displayCylinder(double rho1, double theta1, double rho2, double theta2, const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1)
Class to define colors available for display functionnalities.
error that can be emited by ViSP classes.
void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &cP)
Generic class defining intrinsic camera parameters.
Class that defines what is a cylinder.
Class that provides a data structure for the column vectors as well as a set of operations on these v...
void display(const vpImage< unsigned char > &I, const vpCameraParameters &cam, const vpColor &color=vpColor::green, const unsigned int thickness=1)
void setWorldCoordinates(const vpColVector &oP)
void resize(const unsigned int i, const bool flagNullify=true)