stats.h 665 B

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