39 #ifndef vpMbtDistanceKltCylinder_h
40 #define vpMbtDistanceKltCylinder_h
42 #include <visp3/core/vpConfig.h>
44 #if defined(VISP_HAVE_MODULE_KLT) && (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100))
48 #include <visp3/core/vpCircle.h>
49 #include <visp3/core/vpCylinder.h>
50 #include <visp3/core/vpDisplay.h>
51 #include <visp3/core/vpGEMM.h>
52 #include <visp3/core/vpPlane.h>
53 #include <visp3/core/vpPolygon3D.h>
54 #include <visp3/klt/vpKltOpencv.h>
55 #include <visp3/mbt/vpMbHiddenFaces.h>
56 #include <visp3/vision/vpHomography.h>
84 std::map<int, vpImagePoint> initPoints;
86 std::map<int, vpPoint> initPoints3D;
88 std::map<int, vpImagePoint> curPoints;
90 std::map<int, int> curPointsInd;
92 unsigned int nbPointsCur;
94 unsigned int nbPointsInit;
96 unsigned int minNbPoint;
102 bool isTrackedKltCylinder;
106 std::vector<int> listIndicesCylinderBBox;
113 double computeZ(
const double &x,
const double &y);
114 bool isTrackedFeature(
int id);
138 void buildFrom(
const vpPoint &p1,
const vpPoint &p2,
const double &r);
140 unsigned int computeNbDetectedCurrent(
const vpKltOpencv &_tracker);
144 const vpColor &col,
unsigned int thickness = 1,
bool displayFullModel =
false);
146 const vpColor &col,
unsigned int thickness = 1,
bool displayFullModel =
false);
158 inline std::map<int, vpImagePoint> &getCurrentPoints() {
return curPoints; }
160 inline std::map<int, int> &getCurrentPointsInd() {
return curPointsInd; }
162 inline vpCylinder getCylinder()
const {
return cylinder; }
172 inline unsigned int getInitialNumberPoint()
const {
return nbPointsInit; }
183 inline unsigned int getCurrentNumberPoints()
const {
return nbPointsCur; }
185 std::vector<std::vector<double> > getFeaturesForDisplay();
189 inline bool hasEnoughPoints()
const {
return enoughPoints; }
196 inline bool isTracked()
const {
return isTrackedKltCylinder; }
200 void removeOutliers(
const vpColVector &weight,
const double &threshold_outlier);
207 virtual inline void setCameraParameters(
const vpCameraParameters &_cam) { cam = _cam; }
214 inline void setTracked(
const bool &track) { this->isTrackedKltCylinder = track; }
216 #if (VISP_HAVE_OPENCV_VERSION >= 0x020408)
217 void updateMask(cv::Mat &mask,
unsigned char _nb = 255,
unsigned int _shiftBorder = 0);
219 void updateMask(IplImage *mask,
unsigned char _nb = 255,
unsigned int _shiftBorder = 0);
225 #endif // VISP_HAVE_OPENCV