43 #include <visp/vpFeatureDisplay.h>
46 #include <visp/vpMeterPixelConversion.h>
49 #include <visp/vpDisplay.h>
52 #include <visp/vpDebug.h>
55 #include <visp/vpMath.h>
57 #include <visp/vpImagePoint.h>
73 unsigned int thickness)
99 unsigned int thickness )
111 double co = cos(thetap) ;
112 double si = sin(thetap) ;
122 if (fabs(a) < fabs(b)) {
125 ip2.
set_ij(h, (-c - a*h)/b);
131 ip2.
set_ij((-c - b*w)/a, w);
150 double rho2,
double theta2,
154 unsigned int thickness)
158 displayLine(rho1, theta1, cam, I, color, thickness) ;
159 displayLine(rho2, theta2, cam, I, color, thickness) ;
175 double mu20,
double mu11,
double mu02,
179 unsigned int thickness)
185 unsigned int number_of_points = 45 ;
186 const double incr = 2 * M_PI/(double)number_of_points ;
190 double s = sqrt(
vpMath::sqr(mu20-mu02)+4*mu11*mu11) ;
193 if (fabs(mu11)<1e-6) e =0 ;
194 else e = (mu02-mu20+s)/(2*mu11) ;
195 double a =sqrt( (mu02+mu20+s)/2.0) ;
196 double b =sqrt( (mu02+mu20-s)/2.0) ;
200 double e1 = atan(e) ;
204 double ce = cos(e1) ;
205 double se = sin(e1) ;
211 for( i = 0; i < number_of_points+2 ; i++)
213 double x1 = a *cos(k) ;
214 double y1 = b *sin(k) ;
215 double x11 = x + ce *x1 - se *y1 ;
216 double y11 = y + se *x1 + ce *y1 ;
254 unsigned int thickness)
281 unsigned int thickness )
293 double co = cos(thetap) ;
294 double si = sin(thetap) ;
304 if (fabs(a) < fabs(b)) {
307 ip2.
set_ij(h, (-c - a*h)/b);
313 ip2.
set_ij((-c - b*w)/a, w);
332 double rho2,
double theta2,
336 unsigned int thickness)
340 displayLine(rho1, theta1, cam, I, color, thickness) ;
341 displayLine(rho2, theta2, cam, I, color, thickness) ;
358 double mu20,
double mu11,
double mu02,
362 unsigned int thickness)
368 unsigned int number_of_points = 45 ;
369 const double incr = 2 * M_PI/(double)number_of_points ;
373 double s = sqrt(
vpMath::sqr(mu20-mu02)+4*mu11*mu11) ;
376 if (fabs(mu11)<1e-6) e =0 ;
377 else e = (mu02-mu20+s)/(2*mu11) ;
378 double a =sqrt( (mu02+mu20+s)/2.0) ;
379 double b =sqrt( (mu02+mu20-s)/2.0) ;
383 double e1 = atan(e) ;
387 double ce = cos(e1) ;
388 double se = sin(e1) ;
393 for( i = 0; i < number_of_points+2 ; i++)
395 double x1 = a *cos(k) ;
396 double y1 = b *sin(k) ;
397 double x11 = x + ce *x1 - se *y1 ;
398 double y11 = y + se *x1 + ce *y1 ;
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)
unsigned int getWidth() const
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)
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.
static void displayPoint(double x, double y, const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1)
void set_u(const double u)
static double sqr(double x)
virtual void displayCross(const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness=1)=0
void set_v(const double v)
Generic class defining intrinsic camera parameters.
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)
static void displayLine(double rho, double theta, const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1)
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
void set_ij(const double ii, const double jj)