43 #include <visp/vpCircle.h>
45 #include <visp/vpFeatureDisplay.h>
85 const double X0,
const double Y0,
const double Z0,
134 const double X0,
const double Y0,
192 double s = X0*X0 + Y0*Y0 + Z0*Z0 - r*r ;
193 double det = A*X0+B*Y0+C*Z0;
198 K[0] = 1 - 2*A*X0 + A*A*s;
199 K[1] = 1 - 2*B*Y0 + B*B*s;
200 K[2] = -A*Y0 - B*X0 + A*B*s;
201 K[3] = -C*X0 - A*Z0 + A*C*s;
202 K[4] = -C*Y0 - B*Z0 + B*C*s;
203 K[5] = 1 - 2*C*Z0 + C*C*s;
212 double det = K[2]*K[2] -K[0]*K[1];
213 if (fabs(det) < 1e-8)
220 double xc = (K[1]*K[3]-K[2]*K[4])/det;
221 double yc = (K[0]*K[4]-K[2]*K[3])/det;
223 double c = sqrt( (K[0]-K[1])*(K[0]-K[1]) + 4*K[2]*K[2] );
224 double s = 2*(K[0]*xc*xc + 2*K[2]*xc*yc + K[1]*yc*yc - K[5]);
229 if (fabs(K[2])<std::numeric_limits<double>::epsilon())
234 A = sqrt(s/(K[0] + K[1] + c));
235 B = sqrt(s/(K[0] + K[1] - c));
239 A = sqrt(s/(K[0] + K[1] - c));
240 B = sqrt(s/(K[0] + K[1] + c));
245 E = (K[1] - K[0] + c)/(2*K[2]);
248 A = sqrt(s/(K[0] + K[1] + c));
249 B = sqrt(s/(K[0] + K[1] - c));
253 A = sqrt(s/(K[0] + K[1] - c));
254 B = sqrt(s/(K[0] + K[1] + c));
277 A = cMo[0][0]*
oP[0] + cMo[0][1]*
oP[1] + cMo[0][2]*
oP[2];
278 B = cMo[1][0]*oP[0] + cMo[1][1]*oP[1] + cMo[1][2]*oP[2];
279 C = cMo[2][0]*oP[0] + cMo[2][1]*oP[1] + cMo[2][2]*oP[2];
282 X0 = cMo[0][3] + cMo[0][0]*oP[3] + cMo[0][1]*oP[4] + cMo[0][2]*oP[5];
283 Y0 = cMo[1][3] + cMo[1][0]*oP[3] + cMo[1][1]*oP[4] + cMo[1][2]*oP[5];
284 Z0 = cMo[2][3] + cMo[2][0]*oP[3] + cMo[2][1]*oP[4] + cMo[2][2]*oP[5];
307 A = cMo[0][0]*
oP[0] + cMo[0][1]*
oP[1] + cMo[0][2]*
oP[2];
308 B = cMo[1][0]*oP[0] + cMo[1][1]*oP[1] + cMo[1][2]*oP[2];
309 C = cMo[2][0]*oP[0] + cMo[2][1]*oP[1] + cMo[2][2]*oP[2];
312 X0 = cMo[0][3] + cMo[0][0]*oP[3] + cMo[0][1]*oP[4] + cMo[0][2]*oP[5];
313 Y0 = cMo[1][3] + cMo[1][0]*oP[3] + cMo[1][1]*oP[4] + cMo[1][2]*oP[5];
314 Z0 = cMo[2][3] + cMo[2][0]*oP[3] + cMo[2][1]*oP[4] + cMo[2][2]*oP[5];
334 const unsigned int thickness)
337 cam, I, color, thickness) ;
345 const unsigned int thickness)
351 cam, I, color, thickness) ;
static void displayEllipse(double x, double y, double mu20, double mu11, double m02, const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1)
void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &cP)
perspective projection of the circle
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
Class to define colors available for display functionnalities.
error that can be emited by ViSP classes.
static double sqr(double x)
vpCircle * duplicate() const
for memory issue (used by the vpServo class only)
Generic class defining intrinsic camera parameters.
void display(const vpImage< unsigned char > &I, const vpCameraParameters &cam, const vpColor &color=vpColor::green, const unsigned int thickness=1)
Class that provides a data structure for the column vectors as well as a set of operations on these v...
Class that defines what is a circle.
void setWorldCoordinates(const vpColVector &oP)
void resize(const unsigned int i, const bool flagNullify=true)