45 #include <visp3/visual_features/vpBasicFeature.h>
46 #include <visp3/visual_features/vpFeatureLine.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>
61 #include <visp3/core/vpCameraParameters.h>
64 #include <visp3/core/vpColor.h>
65 #include <visp3/core/vpImage.h>
69 #include <visp3/core/vpFeatureDisplay.h>
104 A = B = C = D = 0.0 ;
128 for(
int i = 0; i < 2; i++)
flags[i] =
true;
144 const double C_,
const double D_)
213 if (
flags[i] ==
false)
217 vpTRACE(
"Warning !!! The interaction matrix is computed but rho was not set yet");
220 vpTRACE(
"Warning !!! The interaction matrix is computed but theta was not set yet");
223 vpTRACE(
"Warning !!! The interaction matrix is computed but A was not set yet");
226 vpTRACE(
"Warning !!! The interaction matrix is computed but B was not set yet");
229 vpTRACE(
"Warning !!! The interaction matrix is computed but C was not set yet");
232 vpTRACE(
"Warning !!! The interaction matrix is computed but D was not set yet");
235 vpTRACE(
"Problem during the reading of the variable flags");
242 double theta =
s[1] ;
245 double co = cos(theta);
246 double si = sin(theta);
250 vpERROR_TRACE(
"Incorrect plane coordinates D is null, D = %f",D) ;
253 "Incorrect plane coordinates D")) ;
256 double lambda_theta =( A*si - B*co) /D;
257 double lambda_rho = (C + rho*A*co + rho*B*si)/D;
264 Lrho[0][0]= co*lambda_rho;
265 Lrho[0][1]= si*lambda_rho;
266 Lrho[0][2]= -rho*lambda_rho;
267 Lrho[0][3]= si*(1.0 + rho*rho);
268 Lrho[0][4]= -co*(1.0 + rho*rho);
278 Ltheta[0][0] = co*lambda_theta;
279 Ltheta[0][1] = si*lambda_theta;
280 Ltheta[0][2] = -rho*lambda_theta;
281 Ltheta[0][3] = -rho*co;
282 Ltheta[0][4] = -rho*si;
331 const unsigned int select)
339 erho[0] =
s[0] - s_star[0] ;
347 double err =
s[1] - s_star[1] ;
348 while (err < -M_PI) err += 2*M_PI ;
349 while (err > M_PI) err -= 2*M_PI ;
388 std::cout <<
"Line:\t " << A <<
"X+" << B <<
"Y+" << C <<
"Z +" << D <<
"=0" <<std::endl ;;
390 std::cout <<
" \trho=" <<
s[0] ;
392 std::cout <<
" \ttheta=" << s[1] ;
393 std::cout <<std::endl ;
416 for(
int i = 0; i < 2; i++)
flags[i] =
true;
449 const double A_,
const double B_,
450 const double C_,
const double D_)
494 unsigned int thickness)
const
525 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 setABCD(const double A, const double B, const double C, const double D)
static unsigned int selectRho()
void stack(const double &d)
void resize(const unsigned int nrows, const unsigned int ncols, const bool flagNullify=true)
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.
class that defines what is a visual feature
void buildFrom(const double rho, const double theta)
void display(const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const
Error that can be emited by the vpBasicFeature class and its derivates.
Generic class defining intrinsic camera parameters.
Class that defines a 2D line visual feature which is composed by two parameters that are and ...
vpFeatureLine * duplicate() const
vpMatrix interaction(const unsigned int select=FEATURE_ALL)
static const unsigned int FEATURE_LINE[32]
vpBasicFeatureDeallocatorType deallocate
Implementation of column vector and the associated operations.
static void displayLine(double rho, double theta, const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1)
vpColVector error(const vpBasicFeature &s_star, const unsigned int select=FEATURE_ALL)
static unsigned int selectTheta()
unsigned int nbParameters
Number of parameters needed to compute the interaction matrix.
vpColVector s
State of the visual feature.
void resize(const unsigned int i, const bool flagNullify=true)
void setRhoTheta(const double rho, const double theta)