calibController.hpp 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // This file is part of OpenCV project.
  2. // It is subject to the license terms in the LICENSE file found in the top-level directory
  3. // of this distribution and at http://opencv.org/license.html.
  4. #ifndef CALIB_CONTROLLER_HPP
  5. #define CALIB_CONTROLLER_HPP
  6. #include "calibCommon.hpp"
  7. #include <stack>
  8. #include <string>
  9. #include <ostream>
  10. namespace calib {
  11. class calibController
  12. {
  13. protected:
  14. cv::Ptr<calibrationData> mCalibData;
  15. int mCalibFlags;
  16. unsigned mMinFramesNum;
  17. bool mNeedTuning;
  18. bool mConfIntervalsState;
  19. bool mCoverageQualityState;
  20. double estimateCoverageQuality();
  21. public:
  22. calibController();
  23. calibController(cv::Ptr<calibrationData> data, int initialFlags, bool autoTuning,
  24. int minFramesNum);
  25. void updateState();
  26. bool getCommonCalibrationState() const;
  27. bool getFramesNumberState() const;
  28. bool getConfidenceIntrervalsState() const;
  29. bool getRMSState() const;
  30. bool getPointsCoverageState() const;
  31. int getNewFlags() const;
  32. };
  33. class calibDataController
  34. {
  35. protected:
  36. cv::Ptr<calibrationData> mCalibData;
  37. std::stack<cameraParameters> mParamsStack;
  38. std::string mParamsFileName;
  39. unsigned mMaxFramesNum;
  40. double mAlpha;
  41. double estimateGridSubsetQuality(size_t excludedIndex);
  42. public:
  43. calibDataController(cv::Ptr<calibrationData> data, int maxFrames, double convParameter);
  44. calibDataController();
  45. void filterFrames();
  46. void setParametersFileName(const std::string& name);
  47. void deleteLastFrame();
  48. void rememberCurrentParameters();
  49. void deleteAllData();
  50. bool saveCurrentCameraParameters() const;
  51. void printParametersToConsole(std::ostream &output) const;
  52. void updateUndistortMap();
  53. };
  54. }
  55. #endif