Path: blob/master/apps/interactive-calibration/calibController.hpp
16337 views
// This file is part of OpenCV project.1// It is subject to the license terms in the LICENSE file found in the top-level directory2// of this distribution and at http://opencv.org/license.html.34#ifndef CALIB_CONTROLLER_HPP5#define CALIB_CONTROLLER_HPP67#include "calibCommon.hpp"89#include <stack>10#include <string>11#include <ostream>1213namespace calib {1415class calibController16{17protected:18cv::Ptr<calibrationData> mCalibData;19int mCalibFlags;20unsigned mMinFramesNum;21bool mNeedTuning;22bool mConfIntervalsState;23bool mCoverageQualityState;2425double estimateCoverageQuality();26public:27calibController();28calibController(cv::Ptr<calibrationData> data, int initialFlags, bool autoTuning,29int minFramesNum);3031void updateState();3233bool getCommonCalibrationState() const;3435bool getFramesNumberState() const;36bool getConfidenceIntrervalsState() const;37bool getRMSState() const;38bool getPointsCoverageState() const;39int getNewFlags() const;40};4142class calibDataController43{44protected:45cv::Ptr<calibrationData> mCalibData;46std::stack<cameraParameters> mParamsStack;47std::string mParamsFileName;48unsigned mMaxFramesNum;49double mAlpha;5051double estimateGridSubsetQuality(size_t excludedIndex);52public:53calibDataController(cv::Ptr<calibrationData> data, int maxFrames, double convParameter);54calibDataController();5556void filterFrames();57void setParametersFileName(const std::string& name);58void deleteLastFrame();59void rememberCurrentParameters();60void deleteAllData();61bool saveCurrentCameraParameters() const;62void printParametersToConsole(std::ostream &output) const;63void updateUndistortMap();64};6566}6768#endif697071