44 #include <visp3/core/vpException.h> 45 #include <visp3/visual_features/vpFeatureBuilder.h> 46 #include <visp3/visual_features/vpFeatureException.h> 101 double rho_l = L1.
getRho();
102 double rho_r = L2.
getRho();
105 double c_l = cos(theta_l);
106 double c_r = cos(theta_r);
107 double s_l = sin(theta_l);
108 double s_r = sin(theta_r);
111 if (fabs(theta_r - theta_l) < min || fabs(fabs(theta_r - theta_l) - M_PI) < min ||
112 fabs(fabs(theta_r - theta_l) - 2 * M_PI) < min) {
113 vpCERROR <<
"There is no vanishing point : the lines are parallel in the " 117 "parallel in the image plane"));
120 double y = (rho_r * c_l - rho_l * c_r) / (-s_l * c_r + s_r * c_l);
121 double x = (rho_r * s_l - rho_l * s_r) / (-c_l * s_r + c_r * s_l);
127 double rho_1 = L1.
getRho();
129 double rho_2 = L2.
getRho();
132 double theta_diff = theta_1 - theta_2;
134 double denom = sqrt( rho_1*rho_1 + rho_2*rho_2 - 2*rho_1*rho_2 * cos(theta_diff) );
135 double one_over_rho = sin(theta_diff) / denom;
136 double alpha = atan2( rho_1 * cos(theta_2) - rho_2 * cos(theta_1), rho_2*sin(theta_1) - rho_1 * sin(theta_2));
194 double x1 = 0, y1 = 0;
195 double x2 = 0, y2 = 0;
201 double theta_1 = atan2(-(x1-x2), y1 - y2);
202 double rho_1 = ( (x1+x2)*cos(theta_1) + (y1+y2)*sin(theta_1) ) / 2.;
208 double theta_2 = atan2(-(x1-x2), y1 - y2);
209 double rho_2 = ( (x1+x2)*cos(theta_2) + (y1+y2)*sin(theta_2) ) / 2.;
213 double theta_diff = theta_1 - theta_2;
215 if (fabs(theta_diff) < min || fabs(fabs(theta_diff) - M_PI) < min || fabs(fabs(theta_diff) - 2 * M_PI) < min) {
219 double x = (sin(theta_1) * rho_2 - sin(theta_2)*rho_1 ) / sin(theta_diff);
220 double y = (cos(theta_2) * rho_1 - cos(theta_1)*rho_2 ) / sin(theta_diff);
226 double theta_diff = theta_1 - theta_2;
227 double denom = sqrt( rho_1*rho_1 + rho_2*rho_2 - 2*rho_1*rho_2 * cos(theta_diff) );
228 double one_over_rho = sin(theta_diff) / denom;
232 double alpha = atan2( rho_1 * cos(theta_2) - rho_2 * cos(theta_1), rho_2*sin(theta_1) - rho_1 * sin(theta_2));
238 double theta_diff = theta_1 - theta_2;
239 double denom = sqrt( rho_1*rho_1 + rho_2*rho_2 - 2*rho_1*rho_2 * cos(theta_diff) );
240 double alpha = atan2( rho_1 * cos(theta_2) - rho_2 * cos(theta_1), rho_2*sin(theta_1) - rho_1 * sin(theta_2));
241 double one_over_rho = sin(theta_diff) / denom;
242 double atan_one_over_rho = atan2(sin(theta_diff), denom);
static unsigned int selectAtanOneOverRho()
error that can be emited by ViSP classes.
static void convertPoint(const vpCameraParameters &cam, const double &u, const double &v, double &x, double &y)
double get_y() const
Get the point y coordinate in the image plane.
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
static unsigned int selectX()
Select visual feature .
Class that defines a 3D line in the object frame and allows forward projection of the line in the cam...
static unsigned int selectY()
Select visual feature .
Error that can be emited by the vpBasicFeature class and its derivates.
Generic class defining intrinsic camera parameters.
Class that defines a 2D line visual feature which is composed by two parameters that are and ...
void setAtanOneOverRho(double atan_one_over_rho)
Set vanishing point feature value.
double get_x() const
Get the point x coordinate in the image plane.
static unsigned int selectOneOverRho()
void setAlpha(double alpha)
Set vanishing point feature value.
void set_y(double y)
Set vanishing point feature value.
static unsigned int selectAlpha()
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
void set_x(double x)
Set vanishing point feature value.
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d)
void setOneOverRho(double one_over_rho)
Set vanishing point feature value.