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");
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")) ;
333 std::cout <<
"Z = " << Z << std::endl ;
336 "Point is behind the camera ")) ;
342 std::cout <<
"Z = " << Z << std::endl ;
345 "Point Z coordinates is null")) ;
355 Lrho[0][3] = (1+rho2)*s ;
356 Lrho[0][4] = -(1+rho2)*c ;
369 Ltheta[0][0] = s/(rho*Z) ;
370 Ltheta[0][1] = -c/(rho*Z) ;
372 Ltheta[0][3] = c/rho ;
373 Ltheta[0][4] = s/rho ;
427 const unsigned int select)
435 erho[0] =
s[0] - s_star[0] ;
444 double err =
s[1] - s_star[1] ;
447 while (err < -M_PI) err += 2*M_PI ;
448 while (err > M_PI) err -= 2*M_PI ;
459 std::cout <<std::endl << me << std::endl ;
465 std::cout <<std::endl << me << std::endl ;
500 std::cout <<
"Point: Z=" <<
get_Z() ;
502 std::cout <<
" rho=" <<
get_rho() ;
505 std::cout <<std::endl ;
539 std::cout <<
"Z = " << Z << std::endl ;
542 "Point is behind the camera ")) ;
548 std::cout <<
"Z = " << Z << std::endl ;
551 "Point Z coordinates is null")) ;
572 unsigned int thickness)
const
605 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.
static unsigned int selectTheta()
static vpMatrix stackMatrices(const vpMatrix &A, const vpMatrix &B)
Stack two Matrices C = [ A B ]^T.
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)