41 #include <visp3/visual_features/vpBasicFeature.h>
42 #include <visp3/visual_features/vpFeatureLine.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>
57 #include <visp3/core/vpCameraParameters.h>
60 #include <visp3/core/vpColor.h>
61 #include <visp3/core/vpImage.h>
63 #include <visp3/core/vpFeatureDisplay.h>
109 for (
int i = 0; i < 2; i++)
194 if (
flags[i] ==
false) {
197 vpTRACE(
"Warning !!! The interaction matrix is computed but rho "
201 vpTRACE(
"Warning !!! The interaction matrix is computed but theta "
205 vpTRACE(
"Warning !!! The interaction matrix is computed but A was "
209 vpTRACE(
"Warning !!! The interaction matrix is computed but B was "
213 vpTRACE(
"Warning !!! The interaction matrix is computed but C was "
217 vpTRACE(
"Warning !!! The interaction matrix is computed but D was "
221 vpTRACE(
"Problem during the reading of the variable flags");
230 double co = cos(theta);
231 double si = sin(theta);
233 if (fabs(D) < 1e-6) {
234 vpERROR_TRACE(
"Incorrect plane coordinates D is null, D = %f", D);
239 double lambda_theta = (A * si - B * co) / D;
240 double lambda_rho = (C + rho * A * co + rho * B * si) / D;
245 Lrho[0][0] = co * lambda_rho;
246 Lrho[0][1] = si * lambda_rho;
247 Lrho[0][2] = -rho * lambda_rho;
248 Lrho[0][3] = si * (1.0 + rho * rho);
249 Lrho[0][4] = -co * (1.0 + rho * rho);
258 Ltheta[0][0] = co * lambda_theta;
259 Ltheta[0][1] = si * lambda_theta;
260 Ltheta[0][2] = -rho * lambda_theta;
261 Ltheta[0][3] = -rho * co;
262 Ltheta[0][4] = -rho * si;
315 erho[0] =
s[0] - s_star[0];
322 double err =
s[1] - s_star[1];
363 std::cout <<
"Line:\t " << A <<
"X+" << B <<
"Y+" << C <<
"Z +" << D <<
"=0" << std::endl;
366 std::cout <<
" \trho=" <<
s[0];
368 std::cout <<
" \ttheta=" <<
s[1];
369 std::cout << std::endl;
390 for (
int i = 0; i < 2; i++) {
465 unsigned int thickness)
const
476 vpERROR_TRACE(
"Error caught");
492 unsigned int thickness)
const
503 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 displayLine(double rho, double theta, 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 a 2D line visual feature which is composed by two parameters that are and ,...
void setRhoTheta(double rho, double theta)
static unsigned int selectRho()
vpMatrix interaction(unsigned int select=FEATURE_ALL) VP_OVERRIDE
vpFeatureLine & buildFrom(const double &rho, const double &theta)
vpFeatureLine * duplicate() const VP_OVERRIDE
void setABCD(double A, double B, double C, double D)
static unsigned int selectTheta()
void print(unsigned int select=FEATURE_ALL) const VP_OVERRIDE
void display(const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const VP_OVERRIDE
vpColVector error(const vpBasicFeature &s_star, unsigned int select=FEATURE_ALL) VP_OVERRIDE
Implementation of a matrix and operations on matrices.