Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches

#include <vpMeLine.h>

Inheritance diagram for vpMeLine:

Public Member Functions

 vpMeLine ()
 vpMeLine (const vpMeLine &meline)
virtual ~vpMeLine () VP_OVERRIDE
vpMeLineoperator= (const vpMeLine &meline)
void display (const vpImage< unsigned char > &I, const vpColor &color, unsigned int thickness=1)
void display (const vpImage< vpRGBa > &I, const vpColor &color, unsigned int thickness=1)
vpColVector get_ABC () const
void getExtremities (vpImagePoint &ip1, vpImagePoint &ip2) const
double getRho () const
vpColVector getRhoTheta () const
double getTheta () const
void initTracking (const vpImage< unsigned char > &I)
void initTracking (const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2)
void track (const vpImage< unsigned char > &I)
Public Member Functions Inherited from vpTracker
vpColVector get_p () const
vpColVector get_cP () const

Static Public Member Functions

static void displayLine (const vpImage< unsigned char > &I, const vpMeSite &PExt1, const vpMeSite &PExt2, const double &A, const double &B, const double &C, const vpColor &color=vpColor::green, unsigned int thickness=1)
static void displayLine (const vpImage< vpRGBa > &I, const vpMeSite &PExt1, const vpMeSite &PExt2, const double &A, const double &B, const double &C, const vpColor &color=vpColor::green, unsigned int thickness=1)
static void displayLine (const vpImage< unsigned char > &I, const vpMeSite &PExt1, const vpMeSite &PExt2, const std::list< vpMeSite > &site_list, const double &A, const double &B, const double &C, const vpColor &color=vpColor::green, unsigned int thickness=1)
static void displayLine (const vpImage< vpRGBa > &I, const vpMeSite &PExt1, const vpMeSite &PExt2, const std::list< vpMeSite > &site_list, const double &A, const double &B, const double &C, const vpColor &color=vpColor::green, unsigned int thickness=1)
static bool intersection (const vpMeLine &line1, const vpMeLine &line2, vpImagePoint &iP)
static void project (double a, double b, double c, const vpMeSite &P, vpImagePoint &iP)
Deprecated functions
static VP_DEPRECATED bool inMask (const vpImage< bool > *mask, unsigned int i, unsigned int j)

Public Attributes

Public Attributes Inherited from vpTracker
vpColVector p
vpColVector cP
bool cPAvailable

Protected Member Functions

void computeDelta (double &delta, double i1, double j1, double i2, double j2)
void computeRhoTheta ()
void leastSquare (const vpImage< unsigned char > &I)
void normalizeAngle (double &delta)
unsigned int plugHoles (const vpImage< unsigned char > &I)
void reSample (const vpImage< unsigned char > &I)
virtual void sample (const vpImage< unsigned char > &I, bool doNotTrack=false) VP_OVERRIDE
virtual unsigned int seekExtremities (const vpImage< unsigned char > &I)
void setExtremities ()
void updateDelta ()

Protected Attributes

vpMeSite m_PExt [2]
double m_rho
double m_theta
double m_delta
int m_sign
double m_a
double m_b
double m_c
Protected Attributes Inherited from vpMeTracker
std::list< vpMeSitem_meList
vpMem_me
int m_nGoodElement
const vpImage< bool > * m_mask
const vpImage< bool > * m_maskCandidates
vpMeSite::vpMeSiteDisplayType m_selectDisplay

Deprecated functions

VP_DEPRECATED void setRhoSignFromIntensity (bool unused)
VP_DEPRECATED void computeRhoSignFromIntensity (bool unused)
VP_DEPRECATED double getA () const
VP_DEPRECATED double getB () const
VP_DEPRECATED double getC () const
VP_DEPRECATED void getEquationParam (double &A, double &B, double &C) const
static VP_DEPRECATED void display (const vpImage< unsigned char > &I, const vpMeSite &PExt1, const vpMeSite &PExt2, const double &A, const double &B, const double &C, const vpColor &color=vpColor::green, unsigned int thickness=1)
static VP_DEPRECATED void display (const vpImage< vpRGBa > &I, const vpMeSite &PExt1, const vpMeSite &PExt2, const double &A, const double &B, const double &C, const vpColor &color=vpColor::green, unsigned int thickness=1)
static VP_DEPRECATED void display (const vpImage< unsigned char > &I, const vpMeSite &PExt1, const vpMeSite &PExt2, const std::list< vpMeSite > &site_list, const double &A, const double &B, const double &C, const vpColor &color=vpColor::green, unsigned int thickness=1)
static VP_DEPRECATED void display (const vpImage< vpRGBa > &I, const vpMeSite &PExt1, const vpMeSite &PExt2, const std::list< vpMeSite > &site_list, const double &A, const double &B, const double &C, const vpColor &color=vpColor::green, unsigned int thickness=1)

Public Member Functions Inherited from vpMeTracker

void display (const vpImage< unsigned char > &I)
void display (const vpImage< vpRGBa > &I)
void display (const vpImage< unsigned char > &I, vpColVector &w, unsigned int &index_w)
vpMegetMe ()
std::list< vpMeSite > & getMeList ()
std::list< vpMeSitegetMeList () const
int getNbPoints () const
void init ()
unsigned int numberOfSignal ()
bool outOfImage (int i, int j, int border, int nrows, int ncols)
bool outOfImage (const vpImagePoint &iP, int border, int nrows, int ncols)
void reset ()
void setDisplay (vpMeSite::vpMeSiteDisplayType select)
virtual void setMask (const vpImage< bool > &mask)
virtual void setMaskCandidates (const vpImage< bool > *maskCandidates)
void setMe (vpMe *me)
void setMeList (const std::list< vpMeSite > &meList)
unsigned int totalNumberOfSignal ()
static bool inRoiMask (const vpImage< bool > *mask, unsigned int i, unsigned int j)
static bool inMeMaskCandidates (const vpImage< bool > *meMaskCandidates, unsigned int i, unsigned int j)

Detailed Description

Class that tracks in an image a line moving edges.

In this class the line is defined by its equation in the $ (i,j) =
(line,column) $ image plane. Two kinds of parametrization are available to describe a 2D line. The first one corresponds to the following equation

\‍[ ai + bj + c = 0 \‍]

where $ i $ and $ j $ are the coordinates of the points belonging to the line. The line features are $ (a, b, c) $.

The second way to write the line equation is to consider polar coordinates

\‍[ i \; cos(\theta) + j \; sin(\theta) - \rho = 0 \‍]

where $ i $ and $ j $ are still the coordinates of the points belonging to the line. But now the line features are $(\rho, \theta) $. The computation of $ \rho $ and $ \theta
$ is easy thanks to $ (a, b, c) $.

\‍[ \theta = arctan(b/a) \‍]

\‍[ \rho = -c/\sqrt{a^2+b^2} \‍]

The value of $ \theta $ is between $ -\pi $ and $ \pi
$. And the value of $ \rho $ can be positive or negative. The conventions to find the right values of the two features are illustrated in the following pictures.

The angle $\theta$ is computed thanks to the direction of the arrow. The arrow points to the side of the line which is darker.

Tutorials & Examples

Tutorials

The example below available in tutorial-me-line-tracker.cpp and described in Tutorial: Moving-edges tracking shows how to use this class.

#include <iostream>
#include <visp3/core/vpConfig.h>
// If openCV available, priority to OpenCV capture, otherwise the user has to modify the code uncommenting/commenting
// one of the following lines
#if defined(VISP_HAVE_OPENCV) && \
(((VISP_HAVE_OPENCV_VERSION < 0x030000) && defined(HAVE_OPENCV_HIGHGUI)) || \
((VISP_HAVE_OPENCV_VERSION >= 0x030000) && defined(HAVE_OPENCV_VIDEOIO)))
#undef VISP_HAVE_V4L2
#undef VISP_HAVE_DC1394
#undef VISP_HAVE_CMU1394
#undef VISP_HAVE_FLYCAPTURE
#undef VISP_HAVE_REALSENSE2
// #undef HAVE_OPENCV_HIGHGUI
// #undef HAVE_OPENCV_VIDEOIO
#else
// Use the first grabber that is available. Uncomment/comment the following lines to disable usage of a grabber
// #undef VISP_HAVE_V4L2
// #undef VISP_HAVE_DC1394
// #undef VISP_HAVE_CMU1394
// #undef VISP_HAVE_FLYCAPTURE
// #undef VISP_HAVE_REALSENSE2
#undef HAVE_OPENCV_HIGHGUI
#undef HAVE_OPENCV_VIDEOIO
#endif
#if (defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394) || defined(VISP_HAVE_CMU1394) || \
defined(VISP_HAVE_FLYCAPTURE) || defined(VISP_HAVE_REALSENSE2) || defined(VISP_HAVE_OPENCV) && \
(((VISP_HAVE_OPENCV_VERSION < 0x030000) && defined(HAVE_OPENCV_HIGHGUI)) || \
((VISP_HAVE_OPENCV_VERSION >= 0x030000) && defined(HAVE_OPENCV_VIDEOIO))) && \
((VISP_HAVE_OPENCV_VERSION < 0x050000) && defined(HAVE_OPENCV_CALIB3D) && defined(HAVE_OPENCV_FEATURES2D)) || \
((VISP_HAVE_OPENCV_VERSION >= 0x050000) && defined(HAVE_OPENCV_3D) && defined(HAVE_OPENCV_FEATURES)))
#ifdef VISP_HAVE_MODULE_SENSOR
#include <visp3/sensor/vp1394CMUGrabber.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
#include <visp3/sensor/vpFlyCaptureGrabber.h>
#include <visp3/sensor/vpRealSense2.h>
#include <visp3/sensor/vpV4l2Grabber.h>
#if (VISP_HAVE_OPENCV_VERSION < 0x030000) && defined(HAVE_OPENCV_HIGHGUI)
#include <opencv2/highgui/highgui.hpp> // for cv::VideoCapture
#elif (VISP_HAVE_OPENCV_VERSION >= 0x030000) && defined(HAVE_OPENCV_VIDEOIO)
#include <opencv2/videoio/videoio.hpp> // for cv::VideoCapture
#endif
#endif
#include <visp3/gui/vpDisplayFactory.h>
#include <visp3/me/vpMeLine.h>
int main(int argc, char **argv)
{
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
std::shared_ptr<vpDisplay> display;
#else
vpDisplay *display = nullptr;
#endif
int opt_me_range = 10;
int opt_me_sample_step = 5;
int opt_me_threshold = 20; // Value in [0 ; 255]
for (int i = 1; i < argc; i++) {
if (std::string(argv[i]) == "--me-range" && i + 1 < argc) {
opt_me_range = std::atoi(argv[++i]);
}
else if (std::string(argv[i]) == "--me-sample-step" && i + 1 < argc) {
opt_me_sample_step = std::atoi(argv[++i]);
}
else if (std::string(argv[i]) == "--me-threshold" && i + 1 < argc) {
opt_me_threshold = std::atoi(argv[++i]);
}
else if (std::string(argv[i]) == "--help" || std::string(argv[i]) == "-h") {
std::cout << "\nUsage: " << argv[0]
<< " [--me-range <range>]"
<< " [--me-sample-step <sample step>]"
<< " [--me-threshold <threshold>]"
<< " [--help] [-h]\n"
<< std::endl;
return EXIT_SUCCESS;
}
else {
std::cout << "\nError: wrong parameter " << argv[i] << std::endl;
return EXIT_FAILURE;
}
}
try {
int opt_device = 0; // For OpenCV and V4l2 grabber to set the camera device
#if defined(VISP_HAVE_V4L2)
std::ostringstream device;
device << "/dev/video" << opt_device;
std::cout << "Use Video 4 Linux grabber on device " << device.str() << std::endl;
g.setDevice(device.str());
g.setScale(1);
g.open(I);
#elif defined(VISP_HAVE_DC1394)
(void)opt_device; // To avoid non used warning
std::cout << "Use DC1394 grabber" << std::endl;
g.open(I);
#elif defined(VISP_HAVE_CMU1394)
(void)opt_device; // To avoid non used warning
std::cout << "Use CMU1394 grabber" << std::endl;
g.open(I);
#elif defined(VISP_HAVE_FLYCAPTURE)
(void)opt_device; // To avoid non used warning
std::cout << "Use FlyCapture grabber" << std::endl;
g.open(I);
#elif defined(VISP_HAVE_REALSENSE2)
(void)opt_device; // To avoid non used warning
std::cout << "Use Realsense 2 grabber" << std::endl;
rs2::config config;
config.disable_stream(RS2_STREAM_DEPTH);
config.disable_stream(RS2_STREAM_INFRARED);
config.enable_stream(RS2_STREAM_COLOR, 640, 480, RS2_FORMAT_RGBA8, 30);
g.open(config);
g.acquire(I);
#elif defined(VISP_HAVE_OPENCV) && \
(((VISP_HAVE_OPENCV_VERSION < 0x030000) && defined(HAVE_OPENCV_HIGHGUI)) || \
((VISP_HAVE_OPENCV_VERSION >= 0x030000) && defined(HAVE_OPENCV_VIDEOIO)))
std::cout << "Use OpenCV grabber on device " << opt_device << std::endl;
cv::VideoCapture g(opt_device); // Open the default camera
if (!g.isOpened()) { // Check if we succeeded
std::cout << "Failed to open the camera" << std::endl;
return EXIT_FAILURE;
}
cv::Mat frame;
int i = 0;
while ((i++ < 20) && !g.read(frame)) {
} // warm up camera by skiping unread frames
g >> frame; // get a new frame from camera
#endif
#if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394) || defined(VISP_HAVE_CMU1394) || defined(VISP_HAVE_FLYCAPTURE) || defined(VISP_HAVE_REALSENSE2)
g.acquire(I);
#elif defined(VISP_HAVE_OPENCV) && \
(((VISP_HAVE_OPENCV_VERSION < 0x030000) && defined(HAVE_OPENCV_HIGHGUI)) || \
((VISP_HAVE_OPENCV_VERSION >= 0x030000) && defined(HAVE_OPENCV_VIDEOIO)))
g >> frame; // get a new frame from camera
#endif
#if defined(VISP_HAVE_DISPLAY)
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
display = vpDisplayFactory::createDisplay(I, -1, -1, "Camera view");
#else
display = vpDisplayFactory::allocateDisplay(I, -1, -1, "Camera view");
#endif
#else
std::cout << "No image viewer is available..." << std::endl;
#endif
vpMe me;
me.setRange(opt_me_range);
me.setThreshold(opt_me_threshold);
me.setSampleStep(opt_me_sample_step);
std::cout << "Moving-edges settings" << std::endl;
me.print();
vpMeLine line;
line.setMe(&me);
line.initTracking(I);
bool quit = false;
while (!quit) {
#if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394) || defined(VISP_HAVE_CMU1394) || defined(VISP_HAVE_FLYCAPTURE) || defined(VISP_HAVE_REALSENSE2)
g.acquire(I);
#elif defined(VISP_HAVE_OPENCV) && \
(((VISP_HAVE_OPENCV_VERSION < 0x030000) && defined(HAVE_OPENCV_HIGHGUI)) || \
((VISP_HAVE_OPENCV_VERSION >= 0x030000) && defined(HAVE_OPENCV_VIDEOIO)))
g >> frame;
#endif
vpDisplay::displayText(I, 20, 20, "Click to quit", vpColor::red);
line.track(I);
if (vpDisplay::getClick(I, false)) {
quit = true;
}
}
}
catch (const vpException &e) {
std::cout << "Catch an exception: " << e << std::endl;
}
#if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11)
if (display != nullptr) {
delete display;
}
#endif
}
#else
int main()
{
#if defined(VISP_HAVE_OPENCV)
std::cout << "Install a 3rd party dedicated to frame grabbing (dc1394, cmu1394, v4l2, OpenCV, FlyCapture, "
<< "Realsense2), configure and build ViSP again to use this tutorial."
<< std::endl;
#else
std::cout << "Install OpenCV 3rd party, configure and build ViSP again to use this tutorial." << std::endl;
#endif
return EXIT_SUCCESS;
}
#endif
Firewire cameras video capture based on CMU 1394 Digital Camera SDK.
void open(vpImage< unsigned char > &I)
Class for firewire ieee1394 video devices using libdc1394-2.x api.
void open(vpImage< unsigned char > &I)
static const vpColor red
Definition vpColor.h:198
Class that defines generic functionalities for display.
Definition vpDisplay.h:171
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void display(const vpImage< unsigned char > &I)
static void flush(const vpImage< unsigned char > &I)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
error that can be emitted by ViSP classes.
Definition vpException.h:60
void open(vpImage< unsigned char > &I)
static void convert(const vpImage< unsigned char > &src, vpImage< vpRGBa > &dest)
Definition of the vpImage class member functions.
Definition vpImage.h:131
Class that tracks in an image a line moving edges.
Definition vpMeLine.h:157
void display(const vpImage< unsigned char > &I, const vpColor &color, unsigned int thickness=1)
Definition vpMeLine.cpp:177
void track(const vpImage< unsigned char > &I)
Definition vpMeLine.cpp:607
void initTracking(const vpImage< unsigned char > &I)
Definition vpMeLine.cpp:187
@ RANGE_RESULT
Definition vpMeSite.h:85
void setDisplay(vpMeSite::vpMeSiteDisplayType select)
void setMe(vpMe *me)
Definition vpMe.h:143
void print()
Definition vpMe.cpp:404
void setRange(const unsigned int &range)
Definition vpMe.h:438
void setLikelihoodThresholdType(const vpLikelihoodThresholdType likelihood_threshold_type)
Definition vpMe.h:531
void setThreshold(const double &threshold)
Definition vpMe.h:489
void setSampleStep(const double &sample_step)
Definition vpMe.h:445
@ NORMALIZED_THRESHOLD
Definition vpMe.h:154
void acquire(vpImage< unsigned char > &grey, double *ts=nullptr)
bool open(const rs2::config &cfg=rs2::config())
Class that is a wrapper over the Video4Linux2 (V4L2) driver.
void open(vpImage< unsigned char > &I)
void setScale(unsigned scale=vpV4l2Grabber::DEFAULT_SCALE)
void setDevice(const std::string &devname)
std::shared_ptr< vpDisplay > createDisplay()
Return a smart pointer vpDisplay specialization if a GUI library is available or nullptr otherwise.
vpDisplay * allocateDisplay()
Return a newly allocated vpDisplay specialization if a GUI library is available or nullptr otherwise.

The code below shows how to use this class.

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpImage.h>
#include <visp3/core/vpImagePoint.h>
#include <visp3/me/vpMeLine.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
// Fill the image with a black rectangle
I = 0u;
for (int i = 100; i < 180; i ++) {
for (int j = 120; j < 250; j ++) {
I[i][j] = 255;
}
}
// Set the moving-edges tracker parameters
vpMe me;
me.setRange(25);
me.setThreshold(20);
me.setSampleStep(10);
// Initialize the moving-edges line tracker parameters
vpMeLine line;
line.setMe(&me);
// Initialize the location of the vertical line to track
vpImagePoint ip1, ip2; // Two points belonging to the line to track
ip1.set_i( 120 );
ip1.set_j( 119 );
ip2.set_i( 170 );
ip2.set_j( 122 );
line.initTracking(I, ip1, ip2);
while ( 1 )
{
// ... Here the code to read or grab the next image.
// Track the line.
line.track(I);
}
return 0;
}
void set_j(double jj)
void set_i(double ii)
Note
It is possible to display the line as an overlay. For that you must use the display function of the class vpMeLine.
Examples
servoAfma62DhalfCamVelocity.cpp, servoAfma6Line2DCamVelocity.cpp, trackMeLine.cpp, and tutorial-me-line-tracker.cpp.

Definition at line 156 of file vpMeLine.h.

Constructor & Destructor Documentation

◆ vpMeLine() [1/2]

vpMeLine::vpMeLine ( )

Basic constructor that calls the constructor of the class vpMeTracker.

Definition at line 81 of file vpMeLine.cpp.

References m_a, m_b, m_c, m_delta, m_rho, m_sign, and m_theta.

Referenced by intersection(), operator=(), and vpMeLine().

◆ vpMeLine() [2/2]

vpMeLine::vpMeLine ( const vpMeLine & meline)

Copy constructor.

Definition at line 85 of file vpMeLine.cpp.

References vpMeLine(), and vpMeTracker::vpMeTracker().

◆ ~vpMeLine()

vpMeLine::~vpMeLine ( )
virtual

Destructor.

Definition at line 90 of file vpMeLine.cpp.

References vpMeTracker::m_meList.

Member Function Documentation

◆ computeDelta()

void vpMeLine::computeDelta ( double & delta,
double i1,
double j1,
double i2,
double j2 )
protected

References computeRhoTheta(), and leastSquare().

◆ computeRhoSignFromIntensity()

VP_DEPRECATED void vpMeLine::computeRhoSignFromIntensity ( bool unused)
inline
Deprecated
This method is deprecated and should no more be used. Instead of computing the sign of rho from the intensity of the middle point of the line, the algorithm was modified to consider all the points to be more robust to occlusion of the middle point.

This method allows to turn off the computation of the sign of the rho attribute based on the intensity near the middle point of the line. This is usually done to distinguish between a black/white and a white/black edge but it may be source of problem (ex. for a servoing example) when this point can be occluded.

Parameters
unused: This parameter is unused.

Definition at line 515 of file vpMeLine.h.

◆ computeRhoTheta()

void vpMeLine::computeRhoTheta ( )
protected

Compute the two parameters $(\rho, \theta)$ of the line in the (i,j) frame using all the MEs for disambiguating.

Select (rho,theta) from contrast between (rho,theta) and (-rho,theta +/- pi)

Definition at line 653 of file vpMeLine.cpp.

References vpMeSite::getIndex(), vpMeSite::getState(), m_a, m_b, m_c, vpMeSite::m_mask_sign, vpMeTracker::m_meList, m_rho, m_theta, vpMeSite::NO_SUPPRESSION, and vpMath::rad().

Referenced by computeDelta(), and track().

◆ display() [1/9]

void vpMeLine::display ( const vpImage< unsigned char > & I,
const vpColor & color,
unsigned int thickness = 1 )

Display me line.

Warning
To effectively display the line a call to vpDisplay::flush() is needed.
Parameters
I: Image in which the line appears.
color: Color of the displayed line. Note that a moving edge that is considered as an outlier is displayed in green.
thickness: Drawings thickness.
Examples
servoAfma62DhalfCamVelocity.cpp, servoAfma6Line2DCamVelocity.cpp, trackMeLine.cpp, and tutorial-me-line-tracker.cpp.

Definition at line 177 of file vpMeLine.cpp.

References displayLine(), m_a, m_b, m_c, vpMeTracker::m_meList, and m_PExt.

Referenced by track().

◆ display() [2/9]

void vpMeLine::display ( const vpImage< unsigned char > & I,
const vpMeSite & PExt1,
const vpMeSite & PExt2,
const double & A,
const double & B,
const double & C,
const vpColor & color = vpColor::green,
unsigned int thickness = 1 )
static
Deprecated
Use rather displayLine().
Deprecated
This static function is deprecated. You should rather use vpMeLine::displayLine().

Display of a moving line thanks to its equation parameters and its extremities.

Parameters
I: The image used as background.
PExt1: First extremity
PExt2: Second extremity
A: Parameter a of the line equation a*i + b*j + c = 0
B: Parameter b of the line equation a*i + b*j + c = 0
C: Parameter c of the line equation a*i + b*j + c = 0
color: Color used to display the line.
thickness: Thickness of the line.

Definition at line 752 of file vpMeLine.cpp.

References displayLine().

◆ display() [3/9]

void vpMeLine::display ( const vpImage< unsigned char > & I,
const vpMeSite & PExt1,
const vpMeSite & PExt2,
const std::list< vpMeSite > & site_list,
const double & A,
const double & B,
const double & C,
const vpColor & color = vpColor::green,
unsigned int thickness = 1 )
static
Deprecated
Use rather displayLine().
Deprecated
This static function is deprecated. You should rather use vpMeLine::displayLine().

Display of a moving line thanks to its equation parameters and its extremities with all the site list.

Parameters
I: The image used as background.
PExt1: First extremity
PExt2: Second extremity
site_list: vpMeSite list
A: Parameter a of the line equation a*i + b*j + c = 0
B: Parameter b of the line equation a*i + b*j + c = 0
C: Parameter c of the line equation a*i + b*j + c = 0
color: Color used to display the line.
thickness: Thickness of the line.

Definition at line 793 of file vpMeLine.cpp.

References displayLine().

◆ display() [4/9]

void vpMeLine::display ( const vpImage< vpRGBa > & I,
const vpColor & color,
unsigned int thickness = 1 )

Display me line.

Warning
To effectively display the line a call to vpDisplay::flush() is needed.
Parameters
I: Image in which the line appears.
color: Color of the displayed line. Note that a moving edge that is considered as an outlier is displayed in green.
thickness: Drawings thickness.

Definition at line 182 of file vpMeLine.cpp.

References displayLine(), m_a, m_b, m_c, vpMeTracker::m_meList, and m_PExt.

◆ display() [5/9]

void vpMeLine::display ( const vpImage< vpRGBa > & I,
const vpMeSite & PExt1,
const vpMeSite & PExt2,
const double & A,
const double & B,
const double & C,
const vpColor & color = vpColor::green,
unsigned int thickness = 1 )
static
Deprecated
Use rather displayLine().
Deprecated
This static function is deprecated. You should rather use vpMeLine::displayLine().

Display of a moving line thanks to its equation parameters and its extremities.

Parameters
I: The image used as background.
PExt1: First extremity
PExt2: Second extremity
A: Parameter a of the line equation a*i + b*j + c = 0
B: Parameter b of the line equation a*i + b*j + c = 0
C: Parameter c of the line equation a*i + b*j + c = 0
color: Color used to display the line.
thickness: Thickness of the line.

Definition at line 772 of file vpMeLine.cpp.

References displayLine().

◆ display() [6/9]

void vpMeLine::display ( const vpImage< vpRGBa > & I,
const vpMeSite & PExt1,
const vpMeSite & PExt2,
const std::list< vpMeSite > & site_list,
const double & A,
const double & B,
const double & C,
const vpColor & color = vpColor::green,
unsigned int thickness = 1 )
static
Deprecated
Use rather displayLine().
Deprecated
This static function is deprecated. You should rather use vpMeLine::displayLine().

Display of a moving line thanks to its equation parameters and its extremities with all the site list.

Parameters
I: The image used as background.
PExt1: First extremity
PExt2: Second extremity
site_list: vpMeSite list
A: Parameter a of the line equation a*i + b*j + c = 0
B: Parameter b of the line equation a*i + b*j + c = 0
C: Parameter c of the line equation a*i + b*j + c = 0
color: Color used to display the line.
thickness: Thickness of the line.

Definition at line 815 of file vpMeLine.cpp.

References displayLine().

◆ display() [7/9]

void vpMeTracker::display ( const vpImage< unsigned char > & I)
inherited

Display the moving edge sites with a color corresponding to their state.

  • If green : The vpMeSite is a good point.
  • If blue : The point is removed because of the vpMeSite tracking phase (contrast problem).
  • If purple : The point is removed because of the vpMeSite tracking phase (threshold problem).
  • If red : The point is removed because of the robust method in the virtual visual servoing (M-Estimator problem).
  • If cyan : The point is removed because it's too close to another.
  • Yellow otherwise.
Parameters
[in]I: The image.

Definition at line 252 of file vpMeTracker.cpp.

References vpMeSite::display(), and m_meList.

Referenced by display(), vpMeEllipse::initTracking(), vpMeEllipse::initTracking(), and vpMeLine::track().

◆ display() [8/9]

void vpMeTracker::display ( const vpImage< unsigned char > & I,
vpColVector & w,
unsigned int & index_w )
inherited

Displays the status of moving edge sites

Parameters
[in]I: The image.
[in]w: vector
[in]index_w: index

Definition at line 270 of file vpMeTracker.cpp.

References display(), vpMeSite::getState(), m_meList, vpMeSite::NO_SUPPRESSION, and vpMeSite::setWeight().

◆ display() [9/9]

void vpMeTracker::display ( const vpImage< vpRGBa > & I)
inherited

Display the moving edge sites with a color corresponding to their state.

  • If green : The vpMeSite is a good point.
  • If blue : The point is removed because of the vpMeSite tracking phase (contrast problem).
  • If purple : The point is removed because of the vpMeSite tracking phase (threshold problem).
  • If red : The point is removed because of the robust method in the virtual visual servoing (M-Estimator problem).
  • If cyan : The point is removed because it's too close to another.
  • Yellow otherwise.
Parameters
[in]I: The image.

Definition at line 261 of file vpMeTracker.cpp.

References vpMeSite::display(), and m_meList.

◆ displayLine() [1/4]

void vpMeLine::displayLine ( const vpImage< unsigned char > & I,
const vpMeSite & PExt1,
const vpMeSite & PExt2,
const double & A,
const double & B,
const double & C,
const vpColor & color = vpColor::green,
unsigned int thickness = 1 )
static

Display of a moving line thanks to its equation parameters and its extremities.

Parameters
I: The image used as background.
PExt1: First extremity
PExt2: Second extremity
A: Parameter a of the line equation a*i + b*j + c = 0
B: Parameter b of the line equation a*i + b*j + c = 0
C: Parameter c of the line equation a*i + b*j + c = 0
color: Color used to display the line.
thickness: Thickness of the line.

Definition at line 825 of file vpMeLine.cpp.

References vpDisplay::displayCross(), vpDisplay::displayLine(), vpColor::green, project(), vpImagePoint::set_i(), and vpImagePoint::set_j().

Referenced by display(), display(), display(), display(), display(), and display().

◆ displayLine() [2/4]

void vpMeLine::displayLine ( const vpImage< unsigned char > & I,
const vpMeSite & PExt1,
const vpMeSite & PExt2,
const std::list< vpMeSite > & site_list,
const double & A,
const double & B,
const double & C,
const vpColor & color = vpColor::green,
unsigned int thickness = 1 )
static

Display of a moving line thanks to its equation parameters and its extremities with all the site list.

Parameters
I: The image used as background.
PExt1: First extremity
PExt2: Second extremity
site_list: vpMeSite list
A: Parameter a of the line equation a*i + b*j + c = 0
B: Parameter b of the line equation a*i + b*j + c = 0
C: Parameter c of the line equation a*i + b*j + c = 0
color: Color used to display the line.
thickness: Thickness of the line.

Definition at line 902 of file vpMeLine.cpp.

References vpDisplay::displayCross(), vpDisplay::displayLine(), vpMeSite::getState(), vpColor::green, vpMeSite::M_ESTIMATOR, vpMeSite::m_ifloat, vpMeSite::m_jfloat, project(), vpImagePoint::set_i(), and vpImagePoint::set_j().

◆ displayLine() [3/4]

void vpMeLine::displayLine ( const vpImage< vpRGBa > & I,
const vpMeSite & PExt1,
const vpMeSite & PExt2,
const double & A,
const double & B,
const double & C,
const vpColor & color = vpColor::green,
unsigned int thickness = 1 )
static

Display of a moving line thanks to its equation parameters and its extremities.

Parameters
I: The image used as background.
PExt1: First extremity
PExt2: Second extremity
A: Parameter a of the line equation a*i + b*j + c = 0
B: Parameter b of the line equation a*i + b*j + c = 0
C: Parameter c of the line equation a*i + b*j + c = 0
color: Color used to display the line.
thickness: Thickness of the line.

Definition at line 864 of file vpMeLine.cpp.

References vpDisplay::displayCross(), vpDisplay::displayLine(), vpColor::green, project(), vpImagePoint::set_i(), and vpImagePoint::set_j().

◆ displayLine() [4/4]

void vpMeLine::displayLine ( const vpImage< vpRGBa > & I,
const vpMeSite & PExt1,
const vpMeSite & PExt2,
const std::list< vpMeSite > & site_list,
const double & A,
const double & B,
const double & C,
const vpColor & color = vpColor::green,
unsigned int thickness = 1 )
static

Display of a moving line thanks to its equation parameters and its extremities with all the site list.

Parameters
I: The image used as background.
PExt1: First extremity
PExt2: Second extremity
site_list: vpMeSite list
A: Parameter a of the line equation a*i + b*j + c = 0
B: Parameter b of the line equation a*i + b*j + c = 0
C: Parameter c of the line equation a*i + b*j + c = 0
color: Color used to display the line.
thickness: Thickness of the line.

Definition at line 955 of file vpMeLine.cpp.

References vpDisplay::displayCross(), vpDisplay::displayLine(), vpMeSite::getState(), vpColor::green, vpMeSite::M_ESTIMATOR, vpMeSite::m_ifloat, vpMeSite::m_jfloat, project(), vpImagePoint::set_i(), and vpImagePoint::set_j().

◆ get_ABC()

vpColVector vpMeLine::get_ABC ( ) const
inline

Gets the parameters a,b,c of the line with equation a*x + b*y + c = 0 as a 3-dim vector.

Returns
3-dim vector containing a, b and c line parameters.

Definition at line 209 of file vpMeLine.h.

References m_a, m_b, and m_c.

◆ get_cP()

vpColVector vpTracker::get_cP ( ) const
inlineinherited

Return object parameters expressed in the 3D camera frame.

Definition at line 95 of file vpTracker.h.

References cP.

◆ get_p()

vpColVector vpTracker::get_p ( ) const
inlineinherited

Return object parameters expressed in the 2D image plane computed by perspective projection.

Definition at line 93 of file vpTracker.h.

References p.

◆ getA()

VP_DEPRECATED double vpMeLine::getA ( ) const
inline
Deprecated
Gets parameter a of the line equation a*i + b*j + c = 0 You should rather use get_ABC().

Definition at line 524 of file vpMeLine.h.

References m_a.

◆ getB()

VP_DEPRECATED double vpMeLine::getB ( ) const
inline
Deprecated
Gets parameter b of the line equation a*i + b*j + c = 0 You should rather use get_ABC().

Definition at line 530 of file vpMeLine.h.

References m_b.

◆ getC()

VP_DEPRECATED double vpMeLine::getC ( ) const
inline
Deprecated
Gets parameter c of the line equation a*i + b*j + c = 0 You should rather use get_ABC().

Definition at line 536 of file vpMeLine.h.

References m_c.

◆ getEquationParam()

VP_DEPRECATED void vpMeLine::getEquationParam ( double & A,
double & B,
double & C ) const
inline
Deprecated
Gets the equation parameters of the line You should rather use get_ABC().

Definition at line 542 of file vpMeLine.h.

References m_a, m_b, and m_c.

◆ getExtremities()

void vpMeLine::getExtremities ( vpImagePoint & ip1,
vpImagePoint & ip2 ) const

Get the extremities of the line. These two points strictly belong to the line. They are the projection of m_Pext[2] on the line

Parameters
ip1: Coordinates of the first extremity.
ip2: Coordinates of the second extremity.

Definition at line 703 of file vpMeLine.cpp.

References m_a, m_b, m_c, vpMeTracker::m_meList, and project().

Referenced by plugHoles(), and seekExtremities().

◆ getMe()

vpMe * vpMeTracker::getMe ( )
inlineinherited

Return the moving edges initialisation parameters.

Returns
Moving Edges.
Examples
trackMeCircle.cpp, trackMeEllipse.cpp, and trackMeLine.cpp.

Definition at line 153 of file vpMeTracker.h.

References m_me.

◆ getMeList() [1/2]

std::list< vpMeSite > & vpMeTracker::getMeList ( )
inlineinherited

Return the list of moving edges

Returns
List of Moving Edges.

Definition at line 160 of file vpMeTracker.h.

References m_meList.

◆ getMeList() [2/2]

std::list< vpMeSite > vpMeTracker::getMeList ( ) const
inlineinherited

Return the list of moving edges

Returns
List of Moving Edges.

Definition at line 167 of file vpMeTracker.h.

References m_meList.

◆ getNbPoints()

int vpMeTracker::getNbPoints ( ) const
inlineinherited

Return the number of points that has not been suppressed.

Returns
Number of good points.

Definition at line 174 of file vpMeTracker.h.

References m_nGoodElement.

◆ getRho()

double vpMeLine::getRho ( ) const
inline

Returns the value of $\rho$, the distance between the origin and the point on the line that belongs to the normal to the line passing through the origin.

Depending on the convention described at the beginning of this class, $\rho$ is signed.

See also
getTheta(), getRhoTheta()
Examples
trackMeLine.cpp.

Definition at line 236 of file vpMeLine.h.

References m_rho.

◆ getRhoTheta()

vpColVector vpMeLine::getRhoTheta ( ) const
inline

Returns the value of $\rho, \theta$ as a 2-dim vector.

  • $\rho$ is the distance between the origin and the point on the line that belongs to the normal to the line passing through the origin.
  • $\theta$ is the angle in radian between the vertical axis and the normal to the line.

Depending on the convention described at the beginning of this class, $\rho$ is signed.

See also
getRho(), getTheta()

Definition at line 253 of file vpMeLine.h.

References m_rho, and m_theta.

◆ getTheta()

double vpMeLine::getTheta ( ) const
inline

Returns the value of the angle $\theta$ between $-\pi$ and $\pi$.

See also
getRho(), getRhoTheta()
Examples
trackMeLine.cpp.

Definition at line 266 of file vpMeLine.h.

References m_theta.

◆ init()

BEGIN_VISP_NAMESPACE void vpMeTracker::init ( )
inherited

Initialize the tracker.

Definition at line 48 of file vpMeTracker.cpp.

References vpTracker::init(), m_selectDisplay, vpMeSite::NONE, and vpTracker::p.

Referenced by vpMeTracker(), and vpMeTracker().

◆ initTracking() [1/2]

void vpMeLine::initTracking ( const vpImage< unsigned char > & I)

Initialization of the tracking. Ask the user to click on two points from the line to track.

Parameters
I: Image in which the line appears.
Examples
servoAfma62DhalfCamVelocity.cpp, servoAfma6Line2DCamVelocity.cpp, trackMeLine.cpp, and tutorial-me-line-tracker.cpp.

Definition at line 187 of file vpMeLine.cpp.

References vpDisplay::displayCross(), vpDisplay::flush(), vpDisplay::getClick(), initTracking(), and vpColor::red.

Referenced by initTracking().

◆ initTracking() [2/2]

void vpMeLine::initTracking ( const vpImage< unsigned char > & I,
const vpImagePoint & ip1,
const vpImagePoint & ip2 )

Initialization of the tracking. The line is defined thanks to the coordinates of two points.

Parameters
I: Image in which the line appears.
ip1: Coordinates of the first point.
ip2: Coordinates of the second point.

Definition at line 332 of file vpMeLine.cpp.

References vpImagePoint::get_i(), vpImagePoint::get_j(), vpMeTracker::initTracking(), m_delta, m_PExt, and sample().

◆ inMask()

VP_DEPRECATED bool vpMeTracker::inMask ( const vpImage< bool > * mask,
unsigned int i,
unsigned int j )
inlinestaticinherited
Deprecated
You should rather use inRoiMask(). Test whether the pixel is inside the region of interest mask. Mask values that are set to true are considered in the tracking.
Parameters
[in]mask: Mask corresponding to the region of interest in the image or nullptr if not wanted. Mask values that are set to true are considered in the tracking. To disable a pixel, set false.
[in]i: Pixel coordinate along the rows.
[in]j: Pixel coordinate along the columns.

Definition at line 294 of file vpMeTracker.h.

References inRoiMask().

◆ inMeMaskCandidates()

bool vpMeTracker::inMeMaskCandidates ( const vpImage< bool > * meMaskCandidates,
unsigned int i,
unsigned int j )
staticinherited

Test whether the moving-edge (ME) is inside the mask of ME candidates for the initialization. Mask values that are set to true and their 8 neighbors are considered for the initialization.

Parameters
[in]meMaskCandidates: Mask corresponding the ME location in the image or nullptr if not wanted. Mask values that are set to true are considered for the initialization. To disable a pixel, set false.
[in]i: ME coordinate along the rows.
[in]j: ME coordinate along the columns.

Definition at line 113 of file vpMeTracker.cpp.

References vpImage< Type >::getCols(), and vpImage< Type >::getRows().

Referenced by vpMeLine::plugHoles(), vpMeEllipse::sample(), vpMeLine::sample(), and vpMeLine::seekExtremities().

◆ inRoiMask()

bool vpMeTracker::inRoiMask ( const vpImage< bool > * mask,
unsigned int i,
unsigned int j )
staticinherited

Test whether the pixel is inside the region of interest mask. Mask values that are set to true are considered in the tracking.

Parameters
[in]mask: Mask corresponding to the region of interest in the image or nullptr if not wanted. Mask values that are set to true are considered in the tracking. To disable a pixel, set false.
[in]i: Pixel coordinate along the rows.
[in]j: Pixel coordinate along the columns.

Definition at line 103 of file vpMeTracker.cpp.

References vpImage< Type >::getValue().

Referenced by vpMbtFaceDepthDense::computeDesiredFeatures(), vpMbtFaceDepthDense::computeDesiredFeatures(), vpMbtFaceDepthDense::computeDesiredFeatures(), vpMbtFaceDepthNormal::computeDesiredFeatures(), vpMbtFaceDepthNormal::computeDesiredFeatures(), vpMbtFaceDepthNormal::computeDesiredFeatures(), vpMbtDistanceKltPoints::computeNbDetectedCurrent(), vpMbtDistanceKltPoints::init(), inMask(), vpMeEllipse::plugHoles(), vpMeLine::plugHoles(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeLine::seekExtremities(), and track().

◆ intersection()

bool vpMeLine::intersection ( const vpMeLine & line1,
const vpMeLine & line2,
vpImagePoint & iP )
static

Computes the intersection point of two lines. The result is given in the (i,j) frame.

Parameters
line1: The first line.
line2: The second line.
iP: The coordinates of the intersection point.
Returns
Returns a boolean value which depends on the computation success. True means that the computation ends successfully.
Examples
servoAfma62DhalfCamVelocity.cpp.

Definition at line 714 of file vpMeLine.cpp.

References m_a, m_b, m_c, vpImagePoint::set_i(), vpImagePoint::set_j(), and vpMeLine().

◆ leastSquare()

void vpMeLine::leastSquare ( const vpImage< unsigned char > & I)
protected

Least squares method used to make the tracking more robust. It ensures that the points taken into account to compute the right equation belong to the line.

Parameters
I: Image in which the line appears.

Definition at line 207 of file vpMeLine.cpp.

References vpException::dimensionError, vpArray2D< Type >::getCols(), vpMeSite::getState(), m_a, m_b, m_c, vpMeSite::m_ifloat, vpMeSite::m_jfloat, vpMeTracker::m_meList, vpMeSite::NO_SUPPRESSION, vpTrackingException::notEnoughPointError, vpMatrix::nullSpace(), vpMeTracker::numberOfSignal(), vpMatrixException::rankDeficient, vpMath::sqr(), and vpRobust::TUKEY.

Referenced by computeDelta(), reSample(), and track().

◆ normalizeAngle()

void vpMeLine::normalizeAngle ( double & delta)
protected

◆ numberOfSignal()

unsigned int vpMeTracker::numberOfSignal ( )
inherited

◆ operator=()

vpMeLine & vpMeLine::operator= ( const vpMeLine & meline)

Copy operator.

Definition at line 95 of file vpMeLine.cpp.

References m_a, m_b, m_c, m_delta, m_PExt, m_rho, m_sign, m_theta, and vpMeLine().

◆ outOfImage() [1/2]

bool vpMeTracker::outOfImage ( const vpImagePoint & iP,
int border,
int nrows,
int ncols )
inherited

Check if a pixel i,j is out of the image.

Parameters
[in]iP: Pixel coordinates.
[in]border: Number of pixels along the image border to exclude. When border is set to 0, consider the complete image.
[in]nrows: Image number of rows.
[in]ncols: Image number of cols.
Returns
true when the pixel is inside the image minus the border size, false otherwise.

Definition at line 172 of file vpMeTracker.cpp.

References vpImagePoint::get_i(), vpImagePoint::get_j(), and vpMath::round().

◆ outOfImage() [2/2]

bool vpMeTracker::outOfImage ( int i,
int j,
int border,
int nrows,
int ncols )
inherited

Check if a pixel i,j is out of the image.

Parameters
[in]i: Pixel coordinate along the image rows.
[in]j: Pixel coordinates along the image columns.
[in]border: Number of pixels along the image border to exclude. When border is set to 0, consider the complete image.
[in]nrows: Image number of rows.
[in]ncols: Image number of cols.
Returns
true when the pixel is inside the image minus the border size, false otherwise.

Definition at line 164 of file vpMeTracker.cpp.

Referenced by vpMeNurbs::localReSample(), vpMeEllipse::plugHoles(), vpMeLine::plugHoles(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeNurbs::sample(), vpMeLine::seekExtremities(), and vpMeNurbs::seekExtremities().

◆ plugHoles()

unsigned int vpMeLine::plugHoles ( const vpImage< unsigned char > & I)
protected

◆ project()

BEGIN_VISP_NAMESPACE void vpMeLine::project ( double a,
double b,
double c,
const vpMeSite & P,
vpImagePoint & iP )
static

Project a ME site on a straight line.

Parameters
[in]a: Parameters a of the line.
[in]b: Parameters b of the line.
[in]c: Parameters c of the line.
[in]P: ME site.
[out]iP: Coordinates of the ME site projected on the line.

Definition at line 66 of file vpMeLine.cpp.

References vpMeSite::m_ifloat, vpMeSite::m_jfloat, vpImagePoint::set_i(), and vpImagePoint::set_j().

Referenced by displayLine(), displayLine(), displayLine(), displayLine(), getExtremities(), and plugHoles().

◆ reSample()

void vpMeLine::reSample ( const vpImage< unsigned char > & I)
protected

Resample the line if the number of sample is less than 80% of the expected value.

Note
The expected value is computed thanks to the length of the line and the parameter which indicates the number of pixel between two points (vpMe::sample_step).
Parameters
I: Image in which the line appears.

Definition at line 561 of file vpMeLine.cpp.

References vpTrackingException::initializationError, vpMeTracker::initTracking(), leastSquare(), m_delta, vpMeTracker::m_me, vpMeTracker::m_meList, m_PExt, sample(), setExtremities(), and vpMeTracker::track().

Referenced by normalizeAngle(), and track().

◆ reset()

void vpMeTracker::reset ( )
inherited

Reset the tracker by removing all the moving edges.

Definition at line 73 of file vpMeTracker.cpp.

References m_meList, and m_nGoodElement.

Referenced by ~vpMeTracker().

◆ sample()

void vpMeLine::sample ( const vpImage< unsigned char > & I,
bool doNotTrack = false )
protectedvirtual

◆ seekExtremities()

◆ setDisplay()

void vpMeTracker::setDisplay ( vpMeSite::vpMeSiteDisplayType select)
inlineinherited

Set type of moving-edges display.

Parameters
select: Display type selector.
Examples
servoAfma6Line2DCamVelocity.cpp, trackMeCircle.cpp, trackMeEllipse.cpp, trackMeLine.cpp, trackMeNurbs.cpp, tutorial-me-ellipse-tracker.cpp, and tutorial-me-line-tracker.cpp.

Definition at line 234 of file vpMeTracker.h.

References m_selectDisplay.

◆ setExtremities()

void vpMeLine::setExtremities ( )
protected

Seek in the list of good points its two extremities m_PExt[2] These extremities are not strictly on the line

Definition at line 355 of file vpMeLine.cpp.

References vpMeTracker::m_meList, and m_PExt.

Referenced by normalizeAngle(), reSample(), and track().

◆ setMask()

virtual void vpMeTracker::setMask ( const vpImage< bool > & mask)
inlinevirtualinherited

Set the mask.

Parameters
mask: Mask.

Definition at line 241 of file vpMeTracker.h.

References m_mask.

◆ setMaskCandidates()

virtual void vpMeTracker::setMaskCandidates ( const vpImage< bool > * maskCandidates)
inlinevirtualinherited

Set the mask of candidates points for initialization.

Parameters
[in]maskCandidates: Pointer towards the mask of candidates points for initialization.

Definition at line 248 of file vpMeTracker.h.

References m_maskCandidates.

◆ setMe()

void vpMeTracker::setMe ( vpMe * me)
inlineinherited

Set the moving edges initialisation parameters.

Parameters
[in]me: Moving Edges.
Examples
servoAfma62DhalfCamVelocity.cpp, servoAfma6Line2DCamVelocity.cpp, trackMeCircle.cpp, trackMeEllipse.cpp, trackMeLine.cpp, trackMeNurbs.cpp, tutorial-me-ellipse-tracker.cpp, and tutorial-me-line-tracker.cpp.

Definition at line 255 of file vpMeTracker.h.

References m_me.

◆ setMeList()

void vpMeTracker::setMeList ( const std::list< vpMeSite > & meList)
inlineinherited

Set the list of moving edges.

Parameters
[in]meList: List of Moving Edges.

Definition at line 262 of file vpMeTracker.h.

References m_meList.

◆ setRhoSignFromIntensity()

VP_DEPRECATED void vpMeLine::setRhoSignFromIntensity ( bool unused)
inline
Deprecated
This method is deprecated and should no more be used. Instead of computing the sign of rho from the intensity of the middle point of the line, the algorithm was modified to consider all the points to be more robust to occlusion of the middle point.

This method allows to disable/enable the calculation of the sign of the rho attribute from the intensity of the central point of the line. When enabled, it allows to distinguish between a black/white edge and a white/black edge, but it can cause problems for example during a visual-servo, when this point can be occluded.

Parameters
unused: This parameter is unused.

Definition at line 497 of file vpMeLine.h.

◆ totalNumberOfSignal()

unsigned int vpMeTracker::totalNumberOfSignal ( )
inherited

Return the total number of moving-edges.

Definition at line 101 of file vpMeTracker.cpp.

References m_meList.

◆ track()

void vpMeLine::track ( const vpImage< unsigned char > & I)

◆ updateDelta()

void vpMeLine::updateDelta ( )
protected

Set the alpha value of the different vpMeSite to the value of delta.

Definition at line 593 of file vpMeLine.cpp.

References m_a, m_b, m_delta, vpMeTracker::m_meList, and vpMeSite::setAlpha().

Referenced by normalizeAngle(), and track().

Member Data Documentation

◆ cP

◆ cPAvailable

bool vpTracker::cPAvailable
inherited

Flag used to indicate if the feature parameters cP expressed in the camera frame are available.

Definition at line 79 of file vpTracker.h.

Referenced by init(), operator=(), vpTracker(), and vpTracker().

◆ m_a

double vpMeLine::m_a
protected

Parameter a of the line equation a*i + b*j + c = 0.

Definition at line 474 of file vpMeLine.h.

Referenced by computeRhoTheta(), display(), display(), get_ABC(), getA(), getEquationParam(), getExtremities(), intersection(), leastSquare(), operator=(), plugHoles(), updateDelta(), and vpMeLine().

◆ m_b

double vpMeLine::m_b
protected

Parameter b of the line equation a*i + b*j + c = 0.

Definition at line 475 of file vpMeLine.h.

Referenced by computeRhoTheta(), display(), display(), get_ABC(), getB(), getEquationParam(), getExtremities(), intersection(), leastSquare(), operator=(), plugHoles(), updateDelta(), and vpMeLine().

◆ m_c

double vpMeLine::m_c
protected

Parameter c of the line equation a*i + b*j + c = 0.

Definition at line 476 of file vpMeLine.h.

Referenced by computeRhoTheta(), display(), display(), get_ABC(), getC(), getEquationParam(), getExtremities(), intersection(), leastSquare(), operator=(), plugHoles(), and vpMeLine().

◆ m_delta

double vpMeLine::m_delta
protected

Angle in rad between the extremities.

Definition at line 471 of file vpMeLine.h.

Referenced by initTracking(), operator=(), plugHoles(), reSample(), sample(), seekExtremities(), updateDelta(), and vpMeLine().

◆ m_mask

const vpImage<bool>* vpMeTracker::m_mask
protectedinherited

Mask used to disable tracking on a part of image.

Definition at line 312 of file vpMeTracker.h.

Referenced by vpMeEllipse::plugHoles(), vpMeLine::plugHoles(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeLine::seekExtremities(), setMask(), track(), vpMeTracker(), and vpMeTracker().

◆ m_maskCandidates

const vpImage<bool>* vpMeTracker::m_maskCandidates
protectedinherited

Mask used to determine candidate points for initialization in an image.

Definition at line 314 of file vpMeTracker.h.

Referenced by vpMeLine::plugHoles(), vpMeEllipse::sample(), vpMeLine::sample(), vpMeLine::seekExtremities(), setMaskCandidates(), vpMeTracker(), and vpMeTracker().

◆ m_me

◆ m_meList

◆ m_nGoodElement

int vpMeTracker::m_nGoodElement
protectedinherited

Number of good moving-edges that are tracked.

Definition at line 310 of file vpMeTracker.h.

Referenced by getNbPoints(), initTracking(), operator=(), reset(), track(), vpMeTracker(), and vpMeTracker().

◆ m_PExt

vpMeSite vpMeLine::m_PExt[2]
protected

Both extremities of good points in the list. These extremities are not strictly on the line

Definition at line 466 of file vpMeLine.h.

Referenced by display(), display(), initTracking(), operator=(), plugHoles(), reSample(), sample(), and setExtremities().

◆ m_rho

double vpMeLine::m_rho
protected

rho parameter of the line

Definition at line 469 of file vpMeLine.h.

Referenced by computeRhoTheta(), getRho(), getRhoTheta(), operator=(), and vpMeLine().

◆ m_selectDisplay

◆ m_sign

int vpMeLine::m_sign
protected

Sign.

Definition at line 472 of file vpMeLine.h.

Referenced by operator=(), plugHoles(), sample(), seekExtremities(), and vpMeLine().

◆ m_theta

double vpMeLine::m_theta
protected

theta parameter of the line

Definition at line 470 of file vpMeLine.h.

Referenced by computeRhoTheta(), getRhoTheta(), getTheta(), operator=(), and vpMeLine().

◆ p

vpColVector vpTracker::p
inherited

Feature coordinates expressed in the image plane p. They correspond to 2D normalized coordinates expressed in meters.

Definition at line 69 of file vpTracker.h.

Referenced by vpCircle::computeIntersectionPoint(), vpMeterPixelConversion::convertEllipse(), vpMeterPixelConversion::convertEllipse(), vpMeterPixelConversion::convertEllipse(), vpMeterPixelConversion::convertEllipse(), vpCircle::display(), vpCircle::display(), vpCylinder::display(), vpCylinder::display(), vpLine::display(), vpLine::display(), vpPoint::display(), vpPoint::display(), vpSphere::display(), vpSphere::display(), vpFeatureDisplay::displayEllipse(), vpFeatureDisplay::displayEllipse(), vpPose::displayModel(), vpPose::displayModel(), vpImageDraw::drawFrame(), vpImageDraw::drawFrame(), vpCircle::get_mu02(), vpSphere::get_mu02(), vpCircle::get_mu11(), vpSphere::get_mu11(), vpCircle::get_mu20(), vpSphere::get_mu20(), vpCircle::get_n02(), vpSphere::get_n02(), vpCircle::get_n11(), vpSphere::get_n11(), vpCircle::get_n20(), vpSphere::get_n20(), get_p(), vpPoint::get_w(), vpCircle::get_x(), vpPoint::get_x(), vpSphere::get_x(), vpCircle::get_y(), vpPoint::get_y(), vpSphere::get_y(), vpLine::getRho(), vpCylinder::getRho1(), vpCylinder::getRho2(), vpLine::getTheta(), vpCylinder::getTheta1(), vpCylinder::getTheta2(), vpCircle::init(), vpCylinder::init(), vpLine::init(), vpMeTracker::init(), vpPoint::init(), vpSphere::init(), vpCircle::operator=(), operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), vpCircle::projection(), vpCylinder::projection(), vpForwardProjection::projection(), vpLine::projection(), vpPoint::projection(), vpSphere::projection(), vpPoint::set_w(), vpPoint::set_x(), vpPoint::set_y(), vpLine::setRho(), vpLine::setTheta(), vpTracker(), and vpTracker().