36 #ifndef vpMbtDistanceKltCylinder_h
37 #define vpMbtDistanceKltCylinder_h
39 #include <visp3/core/vpConfig.h>
41 #if defined(VISP_HAVE_MODULE_KLT) && defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_VIDEO)
45 #include <visp3/core/vpCircle.h>
46 #include <visp3/core/vpCylinder.h>
47 #include <visp3/core/vpDisplay.h>
48 #include <visp3/core/vpGEMM.h>
49 #include <visp3/core/vpPlane.h>
50 #include <visp3/core/vpPolygon3D.h>
51 #include <visp3/klt/vpKltOpencv.h>
52 #include <visp3/mbt/vpMbHiddenFaces.h>
53 #include <visp3/vision/vpHomography.h>
66 class VISP_EXPORT vpMbtDistanceKltCylinder
82 std::map<int, vpImagePoint> initPoints;
84 std::map<int, vpPoint> initPoints3D;
86 std::map<int, vpImagePoint> curPoints;
88 std::map<int, int> curPointsInd;
90 unsigned int nbPointsCur;
92 unsigned int nbPointsInit;
94 unsigned int minNbPoint;
100 bool isTrackedKltCylinder;
104 std::vector<int> listIndicesCylinderBBox;
111 double computeZ(
const double &x,
const double &y);
112 bool isTrackedFeature(
int id);
133 vpMbtDistanceKltCylinder();
134 virtual ~vpMbtDistanceKltCylinder();
136 void buildFrom(
const vpPoint &p1,
const vpPoint &p2,
const double &r);
138 unsigned int computeNbDetectedCurrent(
const vpKltOpencv &_tracker);
142 const vpColor &col,
unsigned int thickness = 1,
bool displayFullModel =
false);
144 const vpColor &col,
unsigned int thickness = 1,
bool displayFullModel =
false);
156 inline std::map<int, vpImagePoint> &getCurrentPoints() {
return curPoints; }
158 inline std::map<int, int> &getCurrentPointsInd() {
return curPointsInd; }
160 inline vpCylinder getCylinder()
const {
return cylinder; }
170 inline unsigned int getInitialNumberPoint()
const {
return nbPointsInit; }
181 inline unsigned int getCurrentNumberPoints()
const {
return nbPointsCur; }
183 std::vector<std::vector<double> > getFeaturesForDisplay();
187 inline bool hasEnoughPoints()
const {
return enoughPoints; }
194 inline bool isTracked()
const {
return isTrackedKltCylinder; }
198 void removeOutliers(
const vpColVector &weight,
const double &threshold_outlier);
205 virtual inline void setCameraParameters(
const vpCameraParameters &_cam) { cam = _cam; }
212 inline void setTracked(
const bool &track) { this->isTrackedKltCylinder = track; }
214 void updateMask(cv::Mat &mask,
unsigned char _nb = 255,
unsigned int _shiftBorder = 0);
Generic class defining intrinsic camera parameters.
Class that defines a 3D circle in the object frame and allows forward projection of a 3D circle in th...
Implementation of column vector and the associated operations.
Class to define RGB colors available for display functionalities.
Class that defines a 3D cylinder in the object frame and allows forward projection of a 3D cylinder i...
Implementation of an homogeneous matrix and operations on such kind of matrices.
Wrapper for the KLT (Kanade-Lucas-Tomasi) feature tracker implemented in OpenCV. Thus to enable this ...
Implementation of a matrix and operations on matrices.
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...