1 #ifndef RELIABILITYPATCHTRACKINGMODEL_H 2 #define RELIABILITYPATCHTRACKINGMODEL_H 7 #include <QSharedPointer> 9 #include <opencv2/core.hpp> 10 #include <opencv2/features2d.hpp> 11 #include <opencv2/xfeatures2d.hpp> 13 #include "reliabilitysinglemodelinterface.h" 57 std::deque<ReliabilityPatch>::iterator begin();
58 std::deque<ReliabilityPatch>::iterator end();
59 std::deque<ReliabilityPatch>::reverse_iterator rbegin();
60 std::deque<ReliabilityPatch>::reverse_iterator rend();
68 void resetMaxLength(
int);
73 std::deque<ReliabilityPatch> instances;
74 unsigned int maxLength;
82 std::deque<point2D<double> >::iterator begin();
83 std::deque<point2D<double> >::iterator end();
84 std::deque<point2D<double> >::reverse_iterator rbegin();
85 std::deque<point2D<double> >::reverse_iterator rend();
93 void resetMaxLength(
int);
96 friend std::ostream& operator<<(std::ostream&,const point2D<double> &);
98 std::deque<point2D<double> > points;
99 unsigned int maxLength;
121 void setGlobalReliability();
122 double getGlobalDisplacement(
int &dx,
int &dy);
132 virtual void initInstanceAttributes();
136 virtual void initDynamicsAttributes();
139 virtual void copy(SpReliabilitySingleModelInterface);
142 virtual void copy_structure(SpReliabilitySingleModelInterface);
145 virtual void setParameters(QDomNode &i_parameters);
160 virtual bool updateInstance(
BoundingBox &, std::set<SpRMMHypothesis, hypothesesOrderedByBestProbabilityOperator> &);
170 virtual void updateModelDynamics();
173 virtual void setProbabilityAndReliability();
176 virtual void setForwardInterface();
179 virtual bool draw(QPainter &painter);
181 virtual bool draw(QPainter &painter,
int r,
int g,
int b);
189 getSegmentation getResegmentPointer(QString segAlternative,
int &threshold);
195 bool getStrongPosition(
int ix,
int iy,
int &ox,
int &oy, cv::KeyPoint &op);
197 bool refillStrongPosition(
int ix,
int iy, cv::KeyPoint &op);
209 void updateAttributeDynamics(
double data,
double RData,
double acuity,
212 void updateAttributeDynamicsNoData(
double estimate,
double acuity,
double currentCooling,
229 void insertPatch(
BoundingBox &bbox,
enum Bound bound,
int row,
int col);
230 void refillPatch(
BoundingBox &bbox,
enum Bound bound,
int row,
int col);
234 void preparePatches();
235 bool distantToExistingPatches(
int x,
int y,
float response,
bool &worst,
int &wx,
int &wy);
236 bool distantToExistingPatches(
int x,
int y,
double distance);
237 bool distantToExistingPatches(
int x,
int y);
238 void getFREAKDescriptors();
239 void refillFREAKDescriptors(Bound bound);
241 void computeFreak(std::vector<cv::KeyPoint>& points, cv::Mat &descriptors);
243 double illuminationReliability(uchar Y);
244 double BhattacharyyaDistance(cv::Mat &h1, cv::Mat &h2);
250 double displacementCoherenceReliability(
double distance);
252 void deleteWeakPatches();
260 void setHighlyReliablePatches();
261 void setWeakPatches();
262 void removeEquallyConverged();
263 void setInstancesDisplacement();
266 double contrastGaussianMean(
int x,
int y, QImage &cn);
267 double contrastGaussianMeanFG(
int x,
int y, QImage *cn, QImage *fg);
269 void printTrackedPatches();
270 void printTrackedPatch(
unsigned int id);
272 std::map<int, std::map<int, ReliabilityPatch> > patches;
273 std::deque<ReliabilityPatch *> new_patches;
274 std::vector<cv::KeyPoint> new_keypoints;
276 std::map<uchar, cv::Mat> new_segmentations;
278 std::deque<ReliabilityPatchTracking> tracked_patches;
279 std::vector<ReliabilityPatchTracking *> reliable_patches;
282 int m_generationStep;
283 int m_topPatchesSize;
284 int m_maxDimensionChange;
289 double m_minimalPatchReliability;
290 int m_refillDistance;
291 QString m_auxSegmentation;
294 int patches_initial_count;
295 double refPatchesRate;
298 unsigned int tracked_patch_id;
299 std::vector<int> gdx;
300 std::vector<int> gdy;
306 cv::Mat current_fg_eroded;
309 static const double R_MIN;
310 static const bool USE_GAUSSIAN;
311 static const int GAUSSIAN_SIZE;
312 static const bool USE_FG;
313 static const bool USE_SQUARE_DISTANCE;
314 static const bool USE_MAX;
315 static const bool USE_MEAN;
316 static const bool USE_MAX_WEIGHTED;
317 static const bool USE_MEAN_WEIGHTED;
319 static const int GF7[];
320 static const int GF5[];
321 static const int GF3[];
323 static getSegmentation m_seg;
324 static bool availableSeg;
325 static int m_referenceThreshold;
327 double m_minimalAttributeVelocityReliability;
328 double m_minimalAttributeAccelerationReliability;
329 double m_minimalWidth;
330 double m_minimalHeight;
332 bool m_useReliability;
333 bool m_useFeatureMap;
340 bool m_build2DBoundReliabilityImage;
341 bool m_activateProjectedBlobCorrection;
342 double localMaxBound;
344 cv::Ptr<cv::xfeatures2d::FREAK> freak;
350 typedef QSharedPointer<ReliabilityPatchTrackingModel> SpReliabilityPatchTrackingModel;
353 #endif // RELIABILITYPATCHTRACKINGMODEL_H Definition: geometric.h:20
Definition: reliabilityattribute.h:101
Definition: ReliabilityPatchTrackingModel.h:103
Definition: reliabilitysinglemodelinterface.h:96
Definition: ReliabilityPatchTrackingModel.h:20
Definition: ReliabilityPatchTrackingModel.h:77
Definition: reliabilityattribute.h:10
An object of this class is instantiated at main code, and this object is used by every class to push ...
Definition: Datapool.h:39
Definition: reliabilityattribute.h:76
Definition: gtstructures.h:32
Definition: ReliabilityPatchTrackingModel.h:29
Definition: ReliabilityPatchTrackingModel.h:52
Definition: BackgroundRecLigth.h:20