44 #ifndef vpMbKltTracker_h 45 #define vpMbKltTracker_h 47 #include <visp3/core/vpConfig.h> 49 #if defined(VISP_HAVE_MODULE_KLT) && (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)) 51 #include <visp3/core/vpExponentialMap.h> 52 #include <visp3/core/vpMeterPixelConversion.h> 53 #include <visp3/core/vpPixelMeterConversion.h> 54 #include <visp3/core/vpSubColVector.h> 55 #include <visp3/core/vpSubMatrix.h> 56 #include <visp3/klt/vpKltOpencv.h> 57 #include <visp3/mbt/vpMbTracker.h> 58 #include <visp3/mbt/vpMbtDistanceCircle.h> 59 #include <visp3/mbt/vpMbtDistanceKltCylinder.h> 60 #include <visp3/mbt/vpMbtDistanceKltPoints.h> 61 #include <visp3/vision/vpHomography.h> 214 #if (VISP_HAVE_OPENCV_VERSION >= 0x020408) 267 void addCircle(
const vpPoint &P1,
const vpPoint &P2,
const vpPoint &P3,
double r,
const std::string &name =
"");
269 const vpColor &col,
unsigned int thickness = 1,
bool displayFullModel =
false);
271 const vpColor &col,
unsigned int thickness = 1,
bool displayFullModel =
false);
278 virtual std::list<vpMbtDistanceKltPoints *> &
getFeaturesKlt() {
return kltPolygons; }
285 #if (VISP_HAVE_OPENCV_VERSION >= 0x020408) 288 inline CvPoint2D32f *getKltPoints() {
return tracker.
getFeatures(); }
291 std::vector<vpImagePoint> getKltImagePoints()
const;
293 std::map<int, vpImagePoint> getKltImagePointsWithId()
const;
328 virtual std::vector<std::vector<double> >
getModelForDisplay(
unsigned int width,
unsigned int height,
331 bool displayFullModel=
false);
333 virtual void loadConfigFile(
const std::string &configFile,
bool verbose=
true);
351 faces.getMbScanLineRenderer().setMaskBorder(maskBorder);
374 #ifdef VISP_HAVE_OGRE 375 faces.getOgreContext()->setWindowName(
"MBT Klt");
388 for (std::list<vpMbtDistanceKltPoints *>::const_iterator it = kltPolygons.begin(); it != kltPolygons.end(); ++it)
389 (*it)->useScanLine = v;
404 std::cerr <<
"This option is not yet implemented in vpMbKltTracker, " 405 "projection error computation set to false." 409 void setUseKltTracking(
const std::string &name,
const bool &useKltTracking);
452 faces.getMbScanLineRenderer().setMaskBorder(maskBorder);
472 virtual std::vector<std::vector<double> > getFeaturesForDisplayKlt();
478 const std::string &name =
"");
490 #endif // VISP_HAVE_OPENCV Implementation of a matrix and operations on matrices.
virtual void setScanLineVisibilityTest(const bool &v)
virtual void track(const vpImage< unsigned char > &I)=0
virtual void computeVVSInteractionMatrixAndResidu()=0
virtual void computeVVSInit()=0
unsigned int getKltMaskBorder() const
void setKltThresholdAcceptation(double th)
Implementation of an homogeneous matrix and operations on such kind of matrices.
int getKltNbPoints() const
virtual std::list< vpMbtDistanceKltPoints * > & getFeaturesKlt()
virtual void setProjectionErrorComputation(const bool &flag)
std::vector< std::vector< double > > m_featuresToBeDisplayedKlt
Display features.
Class to define RGB colors available for display functionnalities.
std::list< vpMbtDistanceKltCylinder * > kltCylinders
vpKltOpencv getKltOpencv() const
virtual void initCircle(const vpPoint &p1, const vpPoint &p2, const vpPoint &p3, double radius, int idFace=0, const std::string &name="")=0
std::vector< cv::Point2f > getFeatures() const
Get the list of current features.
int getNbFeatures() const
Get the number of current features.
vpColVector m_weightedError_klt
Weighted error.
virtual vpColVector getRobustWeights() const
void setThresholdAcceptation(double th)
std::vector< cv::Point2f > getKltPoints() const
void setKltMaskBorder(const unsigned int &e)
virtual void resetTracker()=0
virtual void display(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &col, unsigned int thickness=1, bool displayFullModel=false)=0
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
vpHomogeneousMatrix ctTc0
virtual void init(const vpImage< unsigned char > &I)=0
vpRobust m_robust_klt
Robust.
virtual void setCameraParameters(const vpCameraParameters &cam)
Implementation of a polygon of the model used by the model-based tracker.
virtual std::list< vpMbtDistanceCircle * > & getFeaturesCircle()
unsigned int maskBorder
Erosion of the mask.
virtual void initFaceFromCorners(vpMbtPolygon &polygon)=0
Generic class defining intrinsic camera parameters.
double getThresholdAcceptation() const
unsigned int m_nbFaceUsed
Main methods for a model-based tracker.
Model based tracker using only KLT.
vpKltOpencv tracker
Points tracker.
double getKltThresholdAcceptation() const
cv::Mat cur
Temporary OpenCV image for fast conversion.
virtual std::vector< std::vector< double > > getModelForDisplay(unsigned int width, unsigned int height, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, bool displayFullModel=false)=0
vpColVector m_w_klt
Robust weights.
std::list< vpMbtDistanceCircle * > circles_disp
Vector of the circles used here only to display the full model.
virtual std::list< vpMbtDistanceKltCylinder * > & getFeaturesKltCylinder()
virtual void setOgreVisibilityTest(const bool &v)
void setMaskBorder(const unsigned int &e)
Implementation of column vector and the associated operations.
virtual void initCylinder(const vpPoint &p1, const vpPoint &p2, double radius, int idFace=0, const std::string &name="")=0
virtual void initFaceFromLines(vpMbtPolygon &polygon)=0
virtual void setOgreVisibilityTest(const bool &v)
virtual void testTracking()=0
Wrapper for the KLT (Kanade-Lucas-Tomasi) feature tracker implemented in OpenCV. Thus to enable this ...
unsigned int getMaskBorder() const
int getNbKltPoints() const
Contains an M-estimator and various influence function.
virtual void setPose(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cdMo)=0
virtual void setScanLineVisibilityTest(const bool &v)
virtual void loadConfigFile(const std::string &configFile, bool verbose=true)
vpColVector m_error_klt
(s - s*)
std::list< vpMbtDistanceKltPoints * > kltPolygons
virtual vpColVector getError() const
vpMatrix m_L_klt
Interaction matrix.