39 #ifndef _vpMbEdgeKltTracker_h_
40 #define _vpMbEdgeKltTracker_h_
42 #include <visp3/core/vpConfig.h>
44 #if defined(VISP_HAVE_MODULE_KLT) && defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_VIDEO)
46 #include <visp3/core/vpExponentialMap.h>
47 #include <visp3/core/vpPoseVector.h>
48 #include <visp3/core/vpSubColVector.h>
49 #include <visp3/core/vpSubMatrix.h>
50 #include <visp3/klt/vpKltOpencv.h>
51 #include <visp3/mbt/vpMbEdgeTracker.h>
52 #include <visp3/mbt/vpMbKltTracker.h>
53 #include <visp3/mbt/vpMbTracker.h>
211 class VISP_EXPORT vpMbEdgeKltTracker :
212 #if defined(VISP_HAVE_MODULE_KLT) && defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_VIDEO)
213 public vpMbKltTracker,
219 double m_thresholdKLT;
221 double m_thresholdMBT;
223 unsigned int m_maxIterKlt;
234 vpMbEdgeKltTracker();
235 virtual ~vpMbEdgeKltTracker();
238 const vpColor &col,
unsigned int thickness = 1,
bool displayFullModel =
false) VP_OVERRIDE;
240 const
vpColor &col,
unsigned int thickness = 1,
bool displayFullModel = false) VP_OVERRIDE;
242 virtual inline
vpColVector getError() const VP_OVERRIDE {
return m_error_hybrid; }
244 virtual std::vector<std::vector<double> >
getModelForDisplay(
unsigned int width,
unsigned int height,
247 bool displayFullModel =
false) VP_OVERRIDE;
249 virtual inline
vpColVector getRobustWeights() const VP_OVERRIDE {
return m_w_hybrid; }
256 virtual inline double getNearClippingDistance() const VP_OVERRIDE {
return vpMbKltTracker::getNearClippingDistance(); }
258 virtual void loadConfigFile(
const std::string &configFile,
bool verbose =
true) VP_OVERRIDE;
262 void resetTracker() VP_OVERRIDE;
300 #ifdef VISP_HAVE_OGRE
301 faces.getOgreContext()->setWindowName(
"MBT Hybrid");
313 vpMbKltTracker::setScanLineVisibilityTest(v);
336 unsigned int lvl = 0,
double *edge_residual =
nullptr,
double *klt_residual =
nullptr);
338 virtual
void computeVVSInteractionMatrixAndResidu() VP_OVERRIDE;
342 virtual
void init(const
vpImage<
unsigned char> &I) VP_OVERRIDE;
344 const std::
string &name = "") VP_OVERRIDE;
345 virtual
void initCylinder(const
vpPoint &, const
vpPoint &,
double r,
int idFace, const std::
string &name = "") VP_OVERRIDE;
346 virtual
void initFaceFromCorners(
vpMbtPolygon &polygon) VP_OVERRIDE;
347 virtual
void initFaceFromLines(
vpMbtPolygon &polygon) VP_OVERRIDE;
348 unsigned int initMbtTracking(
unsigned int level = 0);
352 void postTrackingMbt(
vpColVector &w,
unsigned int level = 0);
354 unsigned int trackFirstLoop(const
vpImage<
unsigned char> &I,
vpColVector &factor,
unsigned int lvl = 0);
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
Class to define RGB colors available for display functionalities.
Implementation of an homogeneous matrix and operations on such kind of matrices.
Implementation of a matrix and operations on matrices.
Make the complete tracking of an object by using its CAD model.
void computeVVS(const vpImage< unsigned char > &_I, unsigned int lvl)
virtual void setScanLineVisibilityTest(const bool &v) VP_OVERRIDE
virtual void testTracking() VP_OVERRIDE
virtual void setNearClippingDistance(const double &dist) VP_OVERRIDE
virtual void track(const vpImage< unsigned char > &I) VP_OVERRIDE
virtual void display(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &col, unsigned int thickness=1, bool displayFullModel=false) VP_OVERRIDE
virtual void computeVVSInit() VP_OVERRIDE
virtual void setFarClippingDistance(const double &dist) VP_OVERRIDE
virtual void setOgreVisibilityTest(const bool &v) VP_OVERRIDE
virtual void setClipping(const unsigned int &flags) VP_OVERRIDE
virtual std::vector< std::vector< double > > getModelForDisplay(unsigned int width, unsigned int height, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, bool displayFullModel=false) VP_OVERRIDE
virtual void setPose(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cdMo) VP_OVERRIDE
virtual void loadConfigFile(const std::string &configFile, bool verbose=true) VP_OVERRIDE
Main methods for a model-based tracker.
virtual double getNearClippingDistance() const
virtual void setOgreVisibilityTest(const bool &v)
virtual void setProjectionErrorComputation(const bool &flag)
Implementation of a polygon of the model used by the model-based tracker.
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...