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) ;
180 double mu20,
double mu11,
double mu02,
184 unsigned int thickness)
187 unsigned int number_of_points = 45 ;
188 const double incr = 2 * M_PI/(double)number_of_points ;
191 double s = sqrt(
vpMath::sqr(mu20-mu02)+4*mu11*mu11) ;
195 if (fabs(mu11) < std::numeric_limits<double>::epsilon()) {
201 e = (mu02-mu20+s)/(2*mu11) ;
202 a = sqrt( (mu02+mu20+s)/2.0) ;
203 b = sqrt( (mu02+mu20-s)/2.0) ;
206 double e1 = atan(e) ;
210 double ce = cos(e1) ;
211 double se = sin(e1) ;
217 for( i = 0; i < number_of_points+2 ; i++)
219 double x1 = a *cos(k) ;
220 double y1 = b *sin(k) ;
221 double x11 = x + ce *x1 - se *y1 ;
222 double y11 = y + se *x1 + ce *y1 ;
257 unsigned int thickness)
284 unsigned int thickness )
296 double co = cos(thetap) ;
297 double si = sin(thetap) ;
307 if (fabs(a) < fabs(b)) {
310 ip2.
set_ij(h, (-c - a*h)/b);
316 ip2.
set_ij((-c - b*w)/a, w);
335 double rho2,
double theta2,
339 unsigned int thickness)
343 displayLine(rho1, theta1, cam, I, color, thickness) ;
344 displayLine(rho2, theta2, cam, I, color, thickness) ;
366 double mu20,
double mu11,
double mu02,
370 unsigned int thickness)
373 unsigned int number_of_points = 45 ;
374 const double incr = 2 * M_PI/(double)number_of_points ;
377 double s = sqrt(
vpMath::sqr(mu20-mu02)+4*mu11*mu11) ;
381 if (fabs(mu11) < std::numeric_limits<double>::epsilon()) {
387 e = (mu02-mu20+s)/(2*mu11) ;
388 a = sqrt( (mu02+mu20+s)/2.0) ;
389 b = sqrt( (mu02+mu20-s)/2.0) ;
392 double e1 = atan(e) ;
396 double ce = cos(e1) ;
397 double se = sin(e1) ;
403 for( i = 0; i < number_of_points+2 ; i++)
405 double x1 = a *cos(k) ;
406 double y1 = b *sin(k) ;
407 double x11 = x + ce *x1 - se *y1 ;
408 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)
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)