44 #include <visp3/visual_features/vpBasicFeature.h> 45 #include <visp3/visual_features/vpFeatureLine.h> 48 #include <visp3/core/vpException.h> 49 #include <visp3/visual_features/vpFeatureException.h> 52 #include <visp3/core/vpDebug.h> 55 #include <visp3/core/vpMath.h> 60 #include <visp3/core/vpCameraParameters.h> 63 #include <visp3/core/vpColor.h> 64 #include <visp3/core/vpImage.h> 66 #include <visp3/core/vpFeatureDisplay.h> 111 for (
int i = 0; i < 2; i++)
196 if (
flags[i] ==
false) {
199 vpTRACE(
"Warning !!! The interaction matrix is computed but rho " 203 vpTRACE(
"Warning !!! The interaction matrix is computed but theta " 207 vpTRACE(
"Warning !!! The interaction matrix is computed but A was " 211 vpTRACE(
"Warning !!! The interaction matrix is computed but B was " 215 vpTRACE(
"Warning !!! The interaction matrix is computed but C was " 219 vpTRACE(
"Warning !!! The interaction matrix is computed but D was " 223 vpTRACE(
"Problem during the reading of the variable flags");
232 double co = cos(theta);
233 double si = sin(theta);
235 if (fabs(D) < 1e-6) {
236 vpERROR_TRACE(
"Incorrect plane coordinates D is null, D = %f", D);
241 double lambda_theta = (A * si - B * co) / D;
242 double lambda_rho = (C + rho * A * co + rho * B * si) / D;
247 Lrho[0][0] = co * lambda_rho;
248 Lrho[0][1] = si * lambda_rho;
249 Lrho[0][2] = -rho * lambda_rho;
250 Lrho[0][3] = si * (1.0 + rho * rho);
251 Lrho[0][4] = -co * (1.0 + rho * rho);
260 Ltheta[0][0] = co * lambda_theta;
261 Ltheta[0][1] = si * lambda_theta;
262 Ltheta[0][2] = -rho * lambda_theta;
263 Ltheta[0][3] = -rho * co;
264 Ltheta[0][4] = -rho * si;
317 erho[0] =
s[0] - s_star[0];
324 double err =
s[1] - s_star[1];
364 std::cout <<
"Line:\t " << A <<
"X+" << B <<
"Y+" << C <<
"Z +" << D <<
"=0" << std::endl;
367 std::cout <<
" \trho=" <<
s[0];
369 std::cout <<
" \ttheta=" << s[1];
370 std::cout << std::endl;
391 for (
int i = 0; i < 2; i++)
462 unsigned int thickness)
const 488 unsigned int thickness)
const void setABCD(double A, double B, double C, double D)
Implementation of a matrix and operations on matrices.
vpMatrix interaction(unsigned int select=FEATURE_ALL)
static unsigned int selectRho()
vpFeatureLine * duplicate() const
Class to define RGB colors available for display functionnalities.
void stack(const vpMatrix &A)
unsigned int dim_s
Dimension of the visual feature.
void buildFrom(double rho, double theta)
void display(const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const
class that defines what is a visual feature
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 ...
void setRhoTheta(double rho, double theta)
void print(unsigned int select=FEATURE_ALL) const
static const unsigned int FEATURE_LINE[32]
void resize(unsigned int i, bool flagNullify=true)
vpBasicFeatureDeallocatorType deallocate
vpColVector error(const vpBasicFeature &s_star, unsigned int select=FEATURE_ALL)
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)
static unsigned int selectTheta()
unsigned int nbParameters
Number of parameters needed to compute the interaction matrix.
vpColVector s
State of the visual feature.