~paparazzi-uav/paparazzi/v5.0-manual

« back to all changes in this revision

Viewing changes to sw/ext/opencv_bebop/opencv/samples/cpp/tutorial_code/features2D/AKAZE_tracking/stats.h

  • Committer: Paparazzi buildbot
  • Date: 2016-05-18 15:00:29 UTC
  • Revision ID: felix.ruess+docbot@gmail.com-20160518150029-e8lgzi5kvb4p7un9
Manual import commit 4b8bbb730080dac23cf816b98908dacfabe2a8ec from v5.0 branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef STATS_H
 
2
#define STATS_H
 
3
 
 
4
struct Stats
 
5
{
 
6
    int matches;
 
7
    int inliers;
 
8
    double ratio;
 
9
    int keypoints;
 
10
 
 
11
    Stats() : matches(0),
 
12
        inliers(0),
 
13
        ratio(0),
 
14
        keypoints(0)
 
15
    {}
 
16
 
 
17
    Stats& operator+=(const Stats& op) {
 
18
        matches += op.matches;
 
19
        inliers += op.inliers;
 
20
        ratio += op.ratio;
 
21
        keypoints += op.keypoints;
 
22
        return *this;
 
23
    }
 
24
    Stats& operator/=(int num)
 
25
    {
 
26
        matches /= num;
 
27
        inliers /= num;
 
28
        ratio /= num;
 
29
        keypoints /= num;
 
30
        return *this;
 
31
    }
 
32
};
 
33
 
 
34
#endif // STATS_H