45 #ifndef __vpMbKltMultiTracker_h__
46 #define __vpMbKltMultiTracker_h__
51 #include <visp3/core/vpConfig.h>
53 #if (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100))
55 #include <visp3/mbt/vpMbKltTracker.h>
96 const vpColor& col ,
const unsigned int thickness=1,
const bool displayFullModel=
false);
99 const vpColor& col ,
const unsigned int thickness=1,
const bool displayFullModel=
false);
103 const vpColor& color,
const unsigned int thickness=1,
const bool displayFullModel =
false);
107 const vpColor& color,
const unsigned int thickness=1,
const bool displayFullModel =
false);
110 const std::map<std::string, vpHomogeneousMatrix> &mapOfCameraPoses,
111 const std::map<std::string, vpCameraParameters> &mapOfCameraParameters,
112 const vpColor& col,
const unsigned int thickness=1,
const bool displayFullModel=
false);
115 const std::map<std::string, vpHomogeneousMatrix> &mapOfCameraPoses,
116 const std::map<std::string, vpCameraParameters> &mapOfCameraParameters,
117 const vpColor& col,
const unsigned int thickness=1,
const bool displayFullModel=
false);
119 virtual std::vector<std::string> getCameraNames()
const;
124 virtual void getCameraParameters(std::map<std::string, vpCameraParameters> &mapOfCameraParameters)
const;
127 virtual unsigned int getClipping(
const std::string &cameraName)
const;
131 virtual std::map<std::string, vpMbHiddenFaces<vpMbtPolygon> >
getFaces()
const;
134 virtual std::list<vpMbtDistanceCircle*>&
getFeaturesCircle(
const std::string &cameraName);
137 virtual std::list<vpMbtDistanceKltPoints*>&
getFeaturesKlt(
const std::string &cameraName);
142 virtual std::map<std::string, std::vector<vpImagePoint> >
getKltImagePoints()
const;
146 virtual std::map<std::string, vpKltOpencv>
getKltOpencv()
const;
148 #if (VISP_HAVE_OPENCV_VERSION >= 0x020408)
149 virtual std::map<std::string, std::vector<cv::Point2f> >
getKltPoints()
const;
151 virtual std::map<std::string, CvPoint2D32f*>
getKltPoints();
157 virtual std::map<std::string, unsigned int> getMultiNbPolygon()
const;
165 return (
unsigned int) m_mapOfKltTrackers.size();
171 virtual void getPose(std::map<std::string, vpHomogeneousMatrix> &mapOfCameraPoses)
const;
175 #ifdef VISP_HAVE_MODULE_GUI
177 const std::string &displayFile=
"");
182 const std::string& initFile1,
const std::string& initFile2,
const bool displayHelp=
false,
183 const bool firstCameraIsReference=
true);
186 const std::string &initFile,
const bool displayHelp=
false);
189 const std::map<std::string, std::string> &mapOfInitFiles,
const bool displayHelp=
false);
201 const std::map<std::string, vpHomogeneousMatrix> &mapOfCameraPoses);
205 virtual void loadConfigFile(
const std::string& configFile1,
const std::string& configFile2,
206 const bool firstCameraIsReference=
true);
208 virtual void loadConfigFile(
const std::map<std::string, std::string> &mapOfConfigFiles);
210 virtual void loadModel(
const std::string &modelFile,
const bool verbose=
false);
213 const bool verbose=
false);
216 const bool verbose=
false,
const bool firstCameraIsReference=
true);
218 const std::string &cad_name,
const std::map<std::string, vpHomogeneousMatrix> &mapOfCameraPoses,
219 const bool verbose=
false);
229 const bool firstCameraIsReference=
true);
233 virtual void setCameraParameters(
const std::map<std::string, vpCameraParameters> &mapOfCameraParameters);
235 virtual void setCameraTransformationMatrix(
const std::string &cameraName,
238 virtual void setCameraTransformationMatrix(
const std::map<std::string, vpHomogeneousMatrix> &mapOfTransformationMatrix);
240 virtual void setClipping(
const unsigned int &flags);
241 virtual void setClipping(
const std::string &cameraName,
const unsigned int &flags);
250 #ifdef VISP_HAVE_OGRE
257 virtual void setKltOpencv(
const std::map<std::string, vpKltOpencv> &mapOfOpenCVTrackers);
259 virtual void setLod(
const bool useLod,
const std::string &name=
"");
260 virtual void setLod(
const bool useLod,
const std::string &cameraName,
const std::string &name);
268 const std::string &name);
288 const std::map<std::string, vpHomogeneousMatrix> &mapOfCameraPoses);
290 virtual void setReferenceCameraName(
const std::string &referenceCameraName);
296 virtual void setUseKltTracking(
const std::string &name,
const bool &useKltTracking);
307 virtual void computeVVSWeights(
const unsigned int iter,
const unsigned int nbInfos,
309 std::map<std::string, vpRobust> &mapOfRobusts,
double threshold);
312 std::map<std::string, unsigned int> &mapOfNbInfos,
313 std::map<std::string, unsigned int> &mapOfNbFaceUsed);
316 std::map<std::string, unsigned int> &mapOfNbInfos,
vpColVector &w_klt);
322 #endif // VISP_HAVE_OPENCV
323 #endif //__vpMbKltMultiTracker_h__
virtual void setKltOpencv(const vpKltOpencv &t)
void addCircle(const vpPoint &P1, const vpPoint &P2, const vpPoint &P3, const double r, const std::string &name="")
virtual void track(const vpImage< unsigned char > &I)
virtual std::list< vpMbtDistanceCircle * > & getFeaturesCircle()
virtual void setDisplayFeatures(const bool displayF)
void setGoodNbRayCastingAttemptsRatio(const double &ratio)
virtual void setCovarianceComputation(const bool &flag)
void setThresholdAcceptation(const double th)
virtual void setScanLineVisibilityTest(const bool &v)
friend class vpMbKltMultiTracker
virtual void reInitModel(const vpImage< unsigned char > &I, const std::string &cad_name, const vpHomogeneousMatrix &cMo_, const bool verbose=false)
void setUseKltTracking(const std::string &name, const bool &useKltTracking)
virtual unsigned int getClipping() const
virtual void setAngleDisappear(const double &a)
Implementation of an homogeneous matrix and operations on such kind of matrices.
virtual void setOptimizationMethod(const vpMbtOptimizationMethod &opt)
Class to define colors available for display functionnalities.
bool postTracking(const vpImage< unsigned char > &I, vpColVector &w)
void computeVVSWeights(const unsigned int iter, const unsigned int nbInfos, const vpColVector &R, vpColVector &w_true, vpColVector &w, vpRobust &robust)
virtual void initFromPose(const vpImage< unsigned char > &I, const std::string &initFile)
virtual void reinit(const vpImage< unsigned char > &I)
Class that defines what is a point.
virtual void loadConfigFile(const std::string &configFile)
std::map< std::string, vpHomogeneousMatrix > m_mapOfCameraTransformationMatrix
Map of camera transformation matrix between the current camera frame to the reference camera frame (c...
void setOgreShowConfigDialog(const bool showConfigDialog)
std::vector< cv::Point2f > getKltPoints() const
std::vector< vpImagePoint > getKltImagePoints() const
virtual void setMinPolygonAreaThresh(const double minPolygonAreaThresh, const std::string &name="")
virtual vpHomogeneousMatrix getPose() const
virtual void getCameraParameters(vpCameraParameters &camera) const
Generic class defining intrinsic camera parameters.
std::map< int, vpImagePoint > getKltImagePointsWithId() const
virtual std::list< vpMbtDistanceKltPoints * > & getFeaturesKlt()
virtual void setAngleAppear(const double &a)
Model based tracker using only KLT.
std::string m_referenceCameraName
Name of the reference camera.
virtual void initClick(const vpImage< unsigned char > &I, const std::string &initFile, const bool displayHelp=false)
virtual std::list< vpMbtDistanceKltCylinder * > & getFeaturesKltCylinder()
void setNbRayCastingAttemptsForVisibility(const unsigned int &attempts)
virtual void setMinLineLengthThresh(const double minLineLengthThresh, const std::string &name="")
std::map< std::string, vpMbKltTracker * > m_mapOfKltTrackers
Map of Model-based klt trackers.
void preTracking(const vpImage< unsigned char > &I, unsigned int &nbInfos, unsigned int &nbFaceUsed)
int getNbKltPoints() const
vpKltOpencv getKltOpencv() const
void setMaskBorder(const unsigned int &e)
virtual void loadModel(const char *modelFile, const bool verbose=false)
void setCameraParameters(const vpCameraParameters &cam)
Implementation of column vector and the associated operations.
virtual void setOgreVisibilityTest(const bool &v)
Implementation of a pose vector and operations on poses.
Wrapper for the KLT (Kanade-Lucas-Tomasi) feature tracker implemented in OpenCV. Thus to enable this ...
virtual unsigned int getNbPolygon() const
virtual void setClipping(const unsigned int &flags)
virtual void init(const vpImage< unsigned char > &I)
virtual void setFarClippingDistance(const double &dist)
void computeVVS(const unsigned int &nbInfos, vpColVector &w)
virtual vpMbHiddenFaces< vpMbtPolygon > & getFaces()
Model based stereo (or more) tracker using only KLT.
unsigned int getNumberOfCameras() const
virtual void display(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &col, const unsigned int thickness=1, const bool displayFullModel=false)
virtual void setPose(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cdMo)
virtual void setLod(const bool useLod, const std::string &name="")
virtual void setNearClippingDistance(const double &dist)