$search
00001 00005 #ifndef _THERMALVIS_TRACKS_H_ 00006 #define _THERMALVIS_TRACKS_H_ 00007 00008 #include "general_resources.hpp" 00009 #include "opencv_resources.hpp" 00010 #include "camera.hpp" 00011 #include "tools.hpp" 00012 00014 struct indexedFeature { 00015 int imageIndex; 00016 Point2f featureCoord; 00017 00018 indexedFeature(const int& i, const Point2f& f) { 00019 imageIndex = i; 00020 featureCoord = f; 00021 } 00022 00023 00024 }; 00025 00027 struct featureTrack { 00028 00029 vector<indexedFeature> locations; 00030 bool isTriangulated; 00031 00032 featureTrack(); 00033 00035 void set3dLoc(const Point3d& loc); 00036 00038 void reset3dLoc(const Point3d& loc); 00039 Point3d get3dLoc(); 00040 00041 void addFeature(indexedFeature& feat) { 00042 locations.push_back(feat); 00043 } 00044 00045 Point2f getCoord(unsigned int cam_idx); 00046 00047 protected: 00048 Point3d xyzEstimate; 00049 00050 }; 00051 00052 void addMatchToVector(vector<featureTrack>& featureTrackVector, int index1, const Point2f& point1, int index2, const Point2f& point2); 00053 00054 void drawFeatureTracks(Mat& src, Mat& dst, vector<featureTrack>& tracks, const Scalar& tColor, const Scalar& kColor, int index, unsigned int history = 10); 00055 00056 void redistortTracks(const vector<featureTrack>& src, vector<featureTrack>& dst, const Mat& cameraMatrix, const Mat& distCoeffs, unsigned int latest, const Mat& newCamMat=Mat::eye(3,3,CV_64FC1), unsigned int history = 5); 00057 00058 bool createTrackMatrix(const vector<featureTrack>& src, Mat& dst, int latest = -1); 00059 00060 void assignHistoricalPoints(const vector<featureTrack>& src, unsigned int idx_1, unsigned int idx_2, vector<Point2f>& dst); 00061 #endif