43 #include <visp/vpCircle.h>
45 #include <visp/vpFeatureDisplay.h>
86 const double X0,
const double Y0,
136 const double X0,
const double Y0,
177 double s = X0*X0 + Y0*Y0 + Z0*Z0 - r*r ;
178 double det = A*X0+B*Y0+C*Z0;
183 K[0] = 1 - 2*A*X0 + A*A*s;
184 K[1] = 1 - 2*B*Y0 + B*B*s;
185 K[2] = -A*Y0 - B*X0 + A*B*s;
186 K[3] = -C*X0 - A*Z0 + A*C*s;
187 K[4] = -C*Y0 - B*Z0 + B*C*s;
188 K[5] = 1 - 2*C*Z0 + C*C*s;
191 double det = K[2]*K[2] -K[0]*K[1];
192 if (fabs(det) < 1e-8)
199 double xc = (K[1]*K[3]-K[2]*K[4])/det;
200 double yc = (K[0]*K[4]-K[2]*K[3])/det;
202 double c = sqrt( (K[0]-K[1])*(K[0]-K[1]) + 4*K[2]*K[2] );
203 double s = 2*(K[0]*xc*xc + 2*K[2]*xc*yc + K[1]*yc*yc - K[5]);
212 A = sqrt(s/(K[0] + K[1] + c));
213 B = sqrt(s/(K[0] + K[1] - c));
217 A = sqrt(s/(K[0] + K[1] - c));
218 B = sqrt(s/(K[0] + K[1] + c));
223 E = (K[1] - K[0] + c)/(2*K[2]);
226 A = sqrt(s/(K[0] + K[1] + c));
227 B = sqrt(s/(K[0] + K[1] - c));
231 A = sqrt(s/(K[0] + K[1] - c));
232 B = sqrt(s/(K[0] + K[1] + c));
255 A = cMo[0][0]*
oP[0] + cMo[0][1]*
oP[1] + cMo[0][2]*
oP[2];
256 B = cMo[1][0]*oP[0] + cMo[1][1]*oP[1] + cMo[1][2]*oP[2];
257 C = cMo[2][0]*oP[0] + cMo[2][1]*oP[1] + cMo[2][2]*oP[2];
260 X0 = cMo[0][3] + cMo[0][0]*oP[3] + cMo[0][1]*oP[4] + cMo[0][2]*oP[5];
261 Y0 = cMo[1][3] + cMo[1][0]*oP[3] + cMo[1][1]*oP[4] + cMo[1][2]*oP[5];
262 Z0 = cMo[2][3] + cMo[2][0]*oP[3] + cMo[2][1]*oP[4] + cMo[2][2]*oP[5];
285 A = cMo[0][0]*
oP[0] + cMo[0][1]*
oP[1] + cMo[0][2]*
oP[2];
286 B = cMo[1][0]*oP[0] + cMo[1][1]*oP[1] + cMo[1][2]*oP[2];
287 C = cMo[2][0]*oP[0] + cMo[2][1]*oP[1] + cMo[2][2]*oP[2];
290 X0 = cMo[0][3] + cMo[0][0]*oP[3] + cMo[0][1]*oP[4] + cMo[0][2]*oP[5];
291 Y0 = cMo[1][3] + cMo[1][0]*oP[3] + cMo[1][1]*oP[4] + cMo[1][2]*oP[5];
292 Z0 = cMo[2][3] + cMo[2][0]*oP[3] + cMo[2][1]*oP[4] + cMo[2][2]*oP[5];
312 const unsigned int thickness)
315 cam, I, color, thickness) ;
323 const unsigned int thickness)
329 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)