49 #include <visp/vpBasicFeature.h>
50 #include <visp/vpFeaturePointPolar.h>
53 #include <visp/vpException.h>
54 #include <visp/vpMatrixException.h>
55 #include <visp/vpFeatureException.h>
58 #include <visp/vpDebug.h>
61 #include <visp/vpMath.h>
63 #include <visp/vpFeatureDisplay.h>
292 if (
flags[i] ==
false)
296 vpTRACE(
"Warning !!! The interaction matrix is computed but rho was not set yet");
299 vpTRACE(
"Warning !!! The interaction matrix is computed but theta was not set yet");
302 vpTRACE(
"Warning !!! The interaction matrix is computed but Z was not set yet");
305 vpTRACE(
"Problem during the reading of the variable flags");
314 double Z_ =
get_Z() ;
316 double c_ = cos(theta);
317 double s_ = sin(theta);
319 double rho2 = rho*rho;
321 if (fabs(rho) < 1e-6) {
323 std::cout <<
"rho = " << rho << std::endl ;
326 "rho polar coordinate of the point is null")) ;
332 std::cout <<
"Z = " << Z_ << std::endl ;
335 "Point is behind the camera ")) ;
341 std::cout <<
"Z = " << Z_ << std::endl ;
344 "Point Z coordinates is null")) ;
351 Lrho[0][0] = -c_/Z_ ;
352 Lrho[0][1] = -s_/Z_ ;
353 Lrho[0][2] = rho/Z_ ;
354 Lrho[0][3] = (1+rho2)*s_ ;
355 Lrho[0][4] = -(1+rho2)*c_ ;
368 Ltheta[0][0] = s_/(rho*Z_) ;
369 Ltheta[0][1] = -c_/(rho*Z_) ;
371 Ltheta[0][3] = c_/rho ;
372 Ltheta[0][4] = s_/rho ;
426 const unsigned int select)
434 erho[0] =
s[0] - s_star[0] ;
443 double err =
s[1] - s_star[1] ;
446 while (err < -M_PI) err += 2*M_PI ;
447 while (err > M_PI) err -= 2*M_PI ;
458 std::cout <<std::endl << me << std::endl ;
464 std::cout <<std::endl << me << std::endl ;
499 std::cout <<
"Point: Z=" <<
get_Z() ;
501 std::cout <<
" rho=" <<
get_rho() ;
504 std::cout <<std::endl ;
538 std::cout <<
"Z = " << Z << std::endl ;
541 "Point is behind the camera ")) ;
547 std::cout <<
"Z = " << Z << std::endl ;
550 "Point Z coordinates is null")) ;
571 unsigned int thickness)
const
604 unsigned int thickness)
const
Definition of the vpMatrix class.
bool * flags
Ensure that all the parameters needed to compute the iteraction matrix are set.
void resize(const unsigned int nrows, const unsigned int ncols, const bool nullify=true)
vpFeaturePointPolar * duplicate() const
void print(const unsigned int select=FEATURE_ALL) const
Class to define colors available for display functionnalities.
unsigned int dim_s
Dimension of the visual feature.
error that can be emited by ViSP classes.
void set_Z(const double Z)
Class that defines 2D image point visual feature with polar coordinates described in ...
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 buildFrom(const double rho, const double theta, const double Z)
void set_rhoThetaZ(const double rho, const double theta, const double Z)
class that defines what is a visual feature
static unsigned int selectRho()
Error that can be emited by the vpBasicFeature class and its derivates.
Generic class defining intrinsic camera parameters.
void stackMatrices(const vpMatrix &A)
static unsigned int selectTheta()
vpBasicFeatureDeallocatorType deallocate
Class that provides a data structure for the column vectors as well as a set of operations on these v...
void set_theta(const double theta)
vpColVector error(const vpBasicFeature &s_star, const unsigned int select=FEATURE_ALL)
error that can be emited by the vpMatrix class and its derivates
void display(const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const
vpMatrix interaction(const unsigned int select=FEATURE_ALL)
unsigned int nbParameters
Number of parameters needed to compute the interaction matrix.
vpColVector s
State of the visual feature.
void set_rho(const double rho)
void resize(const unsigned int i, const bool flagNullify=true)