40 #include <visp3/core/vpFeatureDisplay.h> 43 #include <visp3/core/vpMeterPixelConversion.h> 46 #include <visp3/core/vpDisplay.h> 49 #include <visp3/core/vpDebug.h> 52 #include <visp3/core/vpMath.h> 54 #include <visp3/core/vpImagePoint.h> 65 const vpColor &color,
unsigned int thickness)
96 double co = cos(thetap);
97 double si = sin(thetap);
107 if (fabs(a) < fabs(b)) {
110 ip2.
set_ij(h, (-c - a * h) / b);
115 ip2.
set_ij((-c - b * w) / a, w);
133 const vpColor &color,
unsigned int thickness)
136 displayLine(rho1, theta1, cam, I, color, thickness);
137 displayLine(rho2, theta2, cam, I, color, thickness);
157 const vpColor &color,
unsigned int thickness)
160 unsigned int number_of_points = 45;
161 const double incr = 2 * M_PI / (double)number_of_points;
164 double s = sqrt(
vpMath::sqr(mu20 - mu02) + 4 * mu11 * mu11);
168 if (fabs(mu11) < std::numeric_limits<double>::epsilon()) {
173 e = (mu02 - mu20 + s) / (2 * mu11);
174 a = sqrt((mu02 + mu20 + s) / 2.0);
175 b = sqrt((mu02 + mu20 - s) / 2.0);
189 for (i = 0; i < number_of_points + 2; i++) {
190 double x1 = a * cos(k);
191 double y1 = b * sin(k);
192 double x11 = x + ce * x1 - se * y1;
193 double y11 = y + se * x1 + ce * y1;
223 const vpColor &color,
unsigned int thickness)
244 const vpColor &color,
unsigned int thickness)
255 double co = cos(thetap);
256 double si = sin(thetap);
266 if (fabs(a) < fabs(b)) {
269 ip2.
set_ij(h, (-c - a * h) / b);
274 ip2.
set_ij((-c - b * w) / a, w);
292 unsigned int thickness)
295 displayLine(rho1, theta1, cam, I, color, thickness);
296 displayLine(rho2, theta2, cam, I, color, thickness);
317 unsigned int thickness)
320 unsigned int number_of_points = 45;
321 const double incr = 2 * M_PI / (double)number_of_points;
324 double s = sqrt(
vpMath::sqr(mu20 - mu02) + 4 * mu11 * mu11);
328 if (fabs(mu11) < std::numeric_limits<double>::epsilon()) {
333 e = (mu02 - mu20 + s) / (2 * mu11);
334 a = sqrt((mu02 + mu20 + s) / 2.0);
335 b = sqrt((mu02 + mu20 - s) / 2.0);
349 for (i = 0; i < number_of_points + 2; i++) {
350 double x1 = a * cos(k);
351 double y1 = b * sin(k);
352 double x11 = x + ce * x1 - se * y1;
353 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)
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)
unsigned int getHeight() const
static void displayLine(double rho, double theta, const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1)
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)
unsigned int getWidth() const
void set_ij(const double ii, const double jj)