45 #include <visp3/visual_features/vpBasicFeature.h>
46 #include <visp3/visual_features/vpFeaturePointPolar.h>
49 #include <visp3/core/vpException.h>
50 #include <visp3/visual_features/vpFeatureException.h>
53 #include <visp3/core/vpDebug.h>
56 #include <visp3/core/vpMath.h>
58 #include <visp3/core/vpFeatureDisplay.h>
287 if (
flags[i] ==
false)
291 vpTRACE(
"Warning !!! The interaction matrix is computed but rho was not set yet");
294 vpTRACE(
"Warning !!! The interaction matrix is computed but theta was not set yet");
297 vpTRACE(
"Warning !!! The interaction matrix is computed but Z was not set yet");
300 vpTRACE(
"Problem during the reading of the variable flags");
309 double Z_ =
get_Z() ;
311 double c_ = cos(theta);
312 double s_ = sin(theta);
314 double rho2 = rho*rho;
316 if (fabs(rho) < 1e-6) {
318 std::cout <<
"rho = " << rho << std::endl ;
321 "rho polar coordinate of the point is null")) ;
327 std::cout <<
"Z = " << Z_ << std::endl ;
330 "Point is behind the camera ")) ;
336 std::cout <<
"Z = " << Z_ << std::endl ;
339 "Point Z coordinates is null")) ;
346 Lrho[0][0] = -c_/Z_ ;
347 Lrho[0][1] = -s_/Z_ ;
348 Lrho[0][2] = rho/Z_ ;
349 Lrho[0][3] = (1+rho2)*s_ ;
350 Lrho[0][4] = -(1+rho2)*c_ ;
363 Ltheta[0][0] = s_/(rho*Z_) ;
364 Ltheta[0][1] = -c_/(rho*Z_) ;
366 Ltheta[0][3] = c_/rho ;
367 Ltheta[0][4] = s_/rho ;
421 const unsigned int select)
429 erho[0] =
s[0] - s_star[0] ;
438 double err =
s[1] - s_star[1] ;
441 while (err < -M_PI) err += 2*M_PI ;
442 while (err > M_PI) err -= 2*M_PI ;
485 std::cout <<
"Point: Z=" <<
get_Z() ;
487 std::cout <<
" rho=" <<
get_rho() ;
490 std::cout <<std::endl ;
524 std::cout <<
"Z = " << Z << std::endl ;
527 "Point is behind the camera ")) ;
533 std::cout <<
"Z = " << Z << std::endl ;
536 "Point Z coordinates is null")) ;
557 unsigned int thickness)
const
590 unsigned int thickness)
const
Implementation of a matrix and operations on matrices.
bool * flags
Ensure that all the parameters needed to compute the iteraction matrix are set.
void stack(const double &d)
void resize(const unsigned int nrows, const unsigned int ncols, const bool flagNullify=true)
vpFeaturePointPolar * duplicate() const
void print(const unsigned int select=FEATURE_ALL) const
Class to define colors available for display functionnalities.
void stack(const vpMatrix &A)
unsigned int dim_s
Dimension of the visual feature.
void set_Z(const double Z)
Class that defines 2D image point visual feature with polar coordinates described in ...
static unsigned int selectTheta()
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 const unsigned int FEATURE_LINE[32]
vpBasicFeatureDeallocatorType deallocate
Implementation of column vector and the associated operations.
void set_theta(const double theta)
vpColVector error(const vpBasicFeature &s_star, const unsigned int select=FEATURE_ALL)
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)