41#include <visp3/visual_features/vpBasicFeature.h>
42#include <visp3/visual_features/vpFeatureVanishingPoint.h>
45#include <visp3/core/vpException.h>
46#include <visp3/visual_features/vpFeatureException.h>
49#include <visp3/core/vpDebug.h>
52#include <visp3/core/vpMath.h>
54#include <visp3/core/vpFeatureDisplay.h>
119 s[3] = atan_one_over_rho;
157 if (
flags[i] ==
false) {
160 vpTRACE(
"Warning !!! The interaction matrix is computed but x was not set yet");
163 vpTRACE(
"Warning !!! The interaction matrix is computed but y was not set yet");
166 vpTRACE(
"Warning !!! The interaction matrix is computed but 1/rho was not set yet");
169 vpTRACE(
"Warning !!! The interaction matrix is computed but atan(1/rho) was not set yet");
172 vpTRACE(
"Warning !!! The interaction matrix is computed but alpha was not set yet");
175 vpTRACE(
"Problem during the reading of the variable flags");
192 Lx[0][4] = -(1 + x * x);
207 Ly[0][3] = 1 + y * y;
218 double rho2 = 1. + one_over_rho * one_over_rho;
220 Lone_over_rho[0][0] = 0.;
221 Lone_over_rho[0][1] = 0.;
222 Lone_over_rho[0][2] = 0.;
223 Lone_over_rho[0][3] = -rho2 * sin(alpha);
224 Lone_over_rho[0][4] = rho2 * cos(alpha);
225 Lone_over_rho[0][5] = 0.;
234 Latan_one_over_rho[0][0] = 0.;
235 Latan_one_over_rho[0][1] = 0.;
236 Latan_one_over_rho[0][2] = 0.;
237 Latan_one_over_rho[0][3] = -sin(alpha);
238 Latan_one_over_rho[0][4] = cos(alpha);
239 Latan_one_over_rho[0][5] = 0.;
252 Lalpha[0][3] = cos(alpha) * one_over_rho;
253 Lalpha[0][4] = sin(alpha) * one_over_rho;
279 ex[0] =
s[0] - s_star[0];
286 ey[0] =
s[1] - s_star[1];
292 e_one_over_rho[0] =
s[2] - s_star[2];
299 e_atan_one_over_rho[0] =
s[3] - s_star[3];
306 double err =
s[4] - s_star[4];
330 std::cout <<
"Vanishing point:";
332 std::cout <<
" x=" <<
get_x();
334 std::cout <<
" y=" <<
get_y();
342 std::cout <<
" alpha=" <<
getAlpha();
344 std::cout << std::endl;
363 const vpColor &color,
unsigned int thickness)
const
375 double x = cos(alpha) / one_over_rho;
376 double y = sin(alpha) / one_over_rho;
382 double x = cos(alpha) / tan(atan_one_over_rho);
383 double y = sin(alpha) / tan(atan_one_over_rho);
397 unsigned int thickness)
const
409 double x = cos(alpha) / one_over_rho;
410 double y = sin(alpha) / one_over_rho;
416 double x = cos(alpha) / tan(atan_one_over_rho);
417 double y = sin(alpha) / tan(atan_one_over_rho);
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true, bool recopy_=true)
vpColVector s
State of the visual feature.
unsigned int nbParameters
Number of parameters needed to compute the interaction matrix.
unsigned int dim_s
Dimension of the visual feature.
static const unsigned int FEATURE_LINE[32]
vpBasicFeatureDeallocatorType deallocate
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
Class to define RGB colors available for display functionalities.
static void displayPoint(double x, double y, const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1)
static unsigned int selectAtanOneOverRho()
vpFeatureVanishingPoint * duplicate() const VP_OVERRIDE
void set_y(double y)
Set vanishing point feature value.
void setAlpha(double alpha)
Set vanishing point feature value.
double getOneOverRho() const
Get vanishing point feature value.
double getAlpha() const
Get vanishing point feature value.
void setAtanOneOverRho(double atan_one_over_rho)
Set vanishing point feature value.
vpColVector error(const vpBasicFeature &s_star, unsigned int select=(vpFeatureVanishingPoint::selectX()|vpFeatureVanishingPoint::selectY())) VP_OVERRIDE
void setOneOverRho(double one_over_rho)
Set vanishing point feature value.
double getAtanOneOverRho() const
Get vanishing point feature value.
void set_xy(double x, double y)
Set vanishing point visual feature from cartesian coordinates. Same as buildFrom().
static unsigned int selectX()
Select visual feature .
static unsigned int selectOneOverRho()
vpFeatureVanishingPoint & buildFrom(const double &x, const double &y)
Set vanishing point visual feature from cartesian coordinates. Same as set_xy().
double get_y() const
Get vanishing point feature value.
void display(const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const VP_OVERRIDE
static unsigned int selectAlpha()
vpMatrix interaction(unsigned int select=(vpFeatureVanishingPoint::selectX()|vpFeatureVanishingPoint::selectY())) VP_OVERRIDE
double get_x() const
Get vanishing point feature value.
vpFeatureVanishingPoint()
Default constructor that calls init().
static unsigned int selectY()
Select visual feature .
void print(unsigned int select=(vpFeatureVanishingPoint::selectX()|vpFeatureVanishingPoint::selectY())) const VP_OVERRIDE
void set_x(double x)
Set vanishing point feature value.
Definition of the vpImage class member functions.
Implementation of a matrix and operations on matrices.
void stack(const vpMatrix &A)