39 #include <visp3/core/vpFeatureDisplay.h>
42 #include <visp3/core/vpMeterPixelConversion.h>
45 #include <visp3/core/vpDisplay.h>
48 #include <visp3/core/vpDebug.h>
51 #include <visp3/core/vpMath.h>
53 #include <visp3/core/vpImagePoint.h>
69 unsigned int thickness)
95 unsigned int thickness )
107 double co = cos(thetap) ;
108 double si = sin(thetap) ;
118 if (fabs(a) < fabs(b)) {
121 ip2.
set_ij(h, (-c - a*h)/b);
127 ip2.
set_ij((-c - b*w)/a, w);
146 double rho2,
double theta2,
150 unsigned int thickness)
154 displayLine(rho1, theta1, cam, I, color, thickness) ;
155 displayLine(rho2, theta2, cam, I, color, thickness) ;
176 double mu20,
double mu11,
double mu02,
180 unsigned int thickness)
183 unsigned int number_of_points = 45 ;
184 const double incr = 2 * M_PI/(double)number_of_points ;
187 double s = sqrt(
vpMath::sqr(mu20-mu02)+4*mu11*mu11) ;
191 if (fabs(mu11) < std::numeric_limits<double>::epsilon()) {
197 e = (mu02-mu20+s)/(2*mu11) ;
198 a = sqrt( (mu02+mu20+s)/2.0) ;
199 b = sqrt( (mu02+mu20-s)/2.0) ;
202 double e1 = atan(e) ;
206 double ce = cos(e1) ;
207 double se = sin(e1) ;
213 for( i = 0; i < number_of_points+2 ; i++)
215 double x1 = a *cos(k) ;
216 double y1 = b *sin(k) ;
217 double x11 = x + ce *x1 - se *y1 ;
218 double y11 = y + se *x1 + ce *y1 ;
253 unsigned int thickness)
280 unsigned int thickness )
292 double co = cos(thetap) ;
293 double si = sin(thetap) ;
303 if (fabs(a) < fabs(b)) {
306 ip2.
set_ij(h, (-c - a*h)/b);
312 ip2.
set_ij((-c - b*w)/a, w);
331 double rho2,
double theta2,
335 unsigned int thickness)
339 displayLine(rho1, theta1, cam, I, color, thickness) ;
340 displayLine(rho2, theta2, cam, I, color, thickness) ;
362 double mu20,
double mu11,
double mu02,
366 unsigned int thickness)
369 unsigned int number_of_points = 45 ;
370 const double incr = 2 * M_PI/(double)number_of_points ;
373 double s = sqrt(
vpMath::sqr(mu20-mu02)+4*mu11*mu11) ;
377 if (fabs(mu11) < std::numeric_limits<double>::epsilon()) {
383 e = (mu02-mu20+s)/(2*mu11) ;
384 a = sqrt( (mu02+mu20+s)/2.0) ;
385 b = sqrt( (mu02+mu20-s)/2.0) ;
388 double e1 = atan(e) ;
392 double ce = cos(e1) ;
393 double se = sin(e1) ;
399 for( i = 0; i < number_of_points+2 ; i++)
401 double x1 = a *cos(k) ;
402 double y1 = b *sin(k) ;
403 double x11 = x + ce *x1 - se *y1 ;
404 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.
error that can be emited by ViSP classes.
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)
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 displayCross(const vpImage< unsigned char > &I, const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness=1)
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 ...
static void displayLine(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)
void set_ij(const double ii, const double jj)