43 #include <visp/vpCircle.h>
45 #include <visp/vpFeatureDisplay.h>
86 const double X0,
const double Y0,
136 const double X0,
const double Y0,
179 double s = X0*X0 + Y0*Y0 + Z0*Z0 - r*r ;
180 double det = A*X0+B*Y0+C*Z0;
185 K[0] = 1 - 2*A*X0 + A*A*s;
186 K[1] = 1 - 2*B*Y0 + B*B*s;
187 K[2] = -A*Y0 - B*X0 + A*B*s;
188 K[3] = -C*X0 - A*Z0 + A*C*s;
189 K[4] = -C*Y0 - B*Z0 + B*C*s;
190 K[5] = 1 - 2*C*Z0 + C*C*s;
193 double det = K[2]*K[2] -K[0]*K[1];
194 if (fabs(det) < 1e-8)
203 double xc = (K[1]*K[3]-K[2]*K[4])/det;
204 double yc = (K[0]*K[4]-K[2]*K[3])/det;
206 double c = sqrt( (K[0]-K[1])*(K[0]-K[1]) + 4*K[2]*K[2] );
207 double s = 2*(K[0]*xc*xc + 2*K[2]*xc*yc + K[1]*yc*yc - K[5]);
216 A = sqrt(s/(K[0] + K[1] + c));
217 B = sqrt(s/(K[0] + K[1] - c));
221 A = sqrt(s/(K[0] + K[1] - c));
222 B = sqrt(s/(K[0] + K[1] + c));
227 E = (K[1] - K[0] + c)/(2*K[2]);
230 A = sqrt(s/(K[0] + K[1] + c));
231 B = sqrt(s/(K[0] + K[1] - c));
235 A = sqrt(s/(K[0] + K[1] - c));
236 B = sqrt(s/(K[0] + K[1] + c));
259 A = cMo[0][0]*
oP[0] + cMo[0][1]*
oP[1] + cMo[0][2]*
oP[2];
260 B = cMo[1][0]*oP[0] + cMo[1][1]*oP[1] + cMo[1][2]*oP[2];
261 C = cMo[2][0]*oP[0] + cMo[2][1]*oP[1] + cMo[2][2]*oP[2];
264 X0 = cMo[0][3] + cMo[0][0]*oP[3] + cMo[0][1]*oP[4] + cMo[0][2]*oP[5];
265 Y0 = cMo[1][3] + cMo[1][0]*oP[3] + cMo[1][1]*oP[4] + cMo[1][2]*oP[5];
266 Z0 = cMo[2][3] + cMo[2][0]*oP[3] + cMo[2][1]*oP[4] + cMo[2][2]*oP[5];
289 A = cMo[0][0]*
oP[0] + cMo[0][1]*
oP[1] + cMo[0][2]*
oP[2];
290 B = cMo[1][0]*oP[0] + cMo[1][1]*oP[1] + cMo[1][2]*oP[2];
291 C = cMo[2][0]*oP[0] + cMo[2][1]*oP[1] + cMo[2][2]*oP[2];
294 X0 = cMo[0][3] + cMo[0][0]*oP[3] + cMo[0][1]*oP[4] + cMo[0][2]*oP[5];
295 Y0 = cMo[1][3] + cMo[1][0]*oP[3] + cMo[1][1]*oP[4] + cMo[1][2]*oP[5];
296 Z0 = cMo[2][3] + cMo[2][0]*oP[3] + cMo[2][1]*oP[4] + cMo[2][2]*oP[5];
316 const unsigned int thickness)
319 cam, I, color, thickness) ;
327 const unsigned int thickness)
333 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.
void projection()
perspective projection of the circle
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)