41 #include <visp3/visual_features/vpBasicFeature.h>
42 #include <visp3/visual_features/vpFeaturePointPolar.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>
254 if (
flags[i] ==
false) {
257 vpTRACE(
"Warning !!! The interaction matrix is computed but rho "
261 vpTRACE(
"Warning !!! The interaction matrix is computed but theta "
265 vpTRACE(
"Warning !!! The interaction matrix is computed but Z was "
269 vpTRACE(
"Problem during the reading of the variable flags");
280 double c_ = cos(theta);
281 double s_ = sin(theta);
283 double rho2 = rho * rho;
285 if (fabs(rho) < 1e-6) {
286 vpERROR_TRACE(
"rho polar coordinate of the point is null");
287 std::cout <<
"rho = " << rho << std::endl;
293 vpERROR_TRACE(
"Point is behind the camera ");
294 std::cout <<
"Z = " << Z_ << std::endl;
299 if (fabs(Z_) < 1e-6) {
300 vpERROR_TRACE(
"Point Z coordinates is null ");
301 std::cout <<
"Z = " << Z_ << std::endl;
310 Lrho[0][0] = -c_ / Z_;
311 Lrho[0][1] = -s_ / Z_;
312 Lrho[0][2] = rho / Z_;
313 Lrho[0][3] = (1 + rho2) * s_;
314 Lrho[0][4] = -(1 + rho2) * c_;
327 Ltheta[0][0] = s_ / (rho * Z_);
328 Ltheta[0][1] = -c_ / (rho * Z_);
330 Ltheta[0][3] = c_ / rho;
331 Ltheta[0][4] = s_ / rho;
390 erho[0] =
s[0] - s_star[0];
399 double err =
s[1] - s_star[1];
444 std::cout <<
"Point: Z=" <<
get_Z();
446 std::cout <<
" rho=" <<
get_rho();
449 std::cout << std::endl;
461 vpERROR_TRACE(
"Point is behind the camera ");
462 std::cout <<
"Z = " << Z << std::endl;
467 if (fabs(Z) < 1e-6) {
468 vpERROR_TRACE(
"Point Z coordinates is null ");
469 std::cout <<
"Z = " << Z << std::endl;
491 unsigned int thickness)
const
499 x = rho * cos(theta);
500 y = rho * sin(theta);
505 vpERROR_TRACE(
"Error caught");
521 unsigned int thickness)
const
529 x = rho * cos(theta);
530 y = rho * sin(theta);
536 vpERROR_TRACE(
"Error caught");
class that defines what is a visual feature
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.
void resize(unsigned int i, bool flagNullify=true)
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)
Error that can be emitted by the vpBasicFeature class and its derivates.
@ badInitializationError
Wrong feature initialization.
Class that defines 2D image point visual feature with polar coordinates described in .
void print(unsigned int select=FEATURE_ALL) const VP_OVERRIDE
vpFeaturePointPolar & buildFrom(const double &rho, const double &theta, const double &Z)
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 selectTheta()
void set_theta(double theta)
vpColVector error(const vpBasicFeature &s_star, unsigned int select=FEATURE_ALL) VP_OVERRIDE
vpFeaturePointPolar * duplicate() const VP_OVERRIDE
static unsigned int selectRho()
void set_rhoThetaZ(double rho, double theta, double Z)
vpMatrix interaction(unsigned int select=FEATURE_ALL) VP_OVERRIDE
Implementation of a matrix and operations on matrices.
void stack(const vpMatrix &A)