![]() |
SLProject
4.3.020
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
|
#include <SENSCalibrationEstimator.h>
Public Types | |
| enum class | State { Streaming = 0 , Calculating , BusyExtracting , Done , DoneCaptureAndSave , Error } |
Public Member Functions | |
| SENSCalibrationEstimator (SENSCalibrationEstimatorParams params, int camSizeIndex, bool mirroredH, bool mirroredV, SENSCameraType camType, std::string computerInfos, std::string calibDataPath, std::string imageOutputPath, std::string exePath) | |
| ~SENSCalibrationEstimator () | |
| bool | calculate () |
| Initiates the final calculation. More... | |
| bool | updateAndDecorate (cv::Mat imageColor, const cv::Mat &imageGray, bool grabFrame, bool drawCorners=true) |
| < Finds the inner chessboard corners in the given image More... | |
| State | state () |
| int | numImgsToCapture () |
| int | numCapturedImgs () |
| bool | calibrationSuccessful () |
| SENSCalibration | getCalibration () |
| Get resulting calibration. More... | |
| bool | isBusyExtracting () |
| bool | isCalculating () |
| bool | isStreaming () |
| bool | isDone () |
| bool | isDoneCaptureAndSave () |
Static Public Member Functions | |
| static bool | calcCalibration (cv::Size &imageSize, cv::Mat &cameraMatrix, cv::Mat &distCoeffs, const vector< vector< cv::Point2f >> &imagePoints, std::vector< cv::Mat > &rvecs, std::vector< cv::Mat > &tvecs, vector< float > &reprojErrs, float &totalAvgErr, cv::Size &boardSize, float squareSize, int flag, bool useReleaseObjectMethod) |
| Calculates the calibration with the given set of image points. More... | |
Private Member Functions | |
| bool | calibrateAsync () |
| bool | extractAsync () |
| bool | loadCalibParams () |
| Loads the chessboard calibration pattern parameters. More... | |
| void | updateExtractAndCalc (bool found, bool grabFrame, cv::Mat imageGray) |
| void | updateOnlyCapture (bool found, bool grabFrame, cv::Mat imageGray) |
| void | saveImage (cv::Mat imageGray) |
Static Private Member Functions | |
| static double | calcReprojectionErrors (const vector< vector< cv::Point3f >> &objectPoints, const vector< vector< cv::Point2f >> &imagePoints, const std::vector< cv::Mat > &rvecs, const std::vector< cv::Mat > &tvecs, const cv::Mat &cameraMatrix, const cv::Mat &distCoeffs, vector< float > &perViewErrors) |
| Calculates the reprojection error of the calibration. More... | |
| static void | calcBoardCorners3D (const cv::Size &boardSize, float squareSize, std::vector< cv::Point3f > &objectPoints3D) |
| Calculates the 3D positions of the chessboard corners. More... | |
Private Attributes | |
| State | _state = State::Streaming |
| bool | _calibrationSuccessful = false |
| std::future< bool > | _calibrationTask |
| future object for calculation of calibration in async task More... | |
| cv::Mat | _currentImgToExtract |
| vector< vector< cv::Point2f > > | _imagePoints |
| 2D vector of corner points in chessboard More... | |
| cv::Size | _boardSize |
| NO. of inner chessboard corners. More... | |
| float | _boardSquareMM = 10.f |
| Size of chessboard square in mm. More... | |
| int | _numOfImgsToCapture = 20 |
| NO. of images to capture. More... | |
| int | _numCaptured = 0 |
| NO. of images captured. More... | |
| cv::Size | _imageSize |
| Input image size in pixels (after cropping) More... | |
| float | _reprojectionError = -1.f |
| Reprojection error after calibration. More... | |
| SENSCalibrationEstimatorParams | _params |
| int | _camSizeIndex = -1 |
| bool | _mirroredH = false |
| bool | _mirroredV = false |
| SENSCameraType | _camType = SENSCameraType::FRONTFACING |
| std::unique_ptr< SENSCalibration > | _calibration |
| estimated calibration More... | |
| std::string | _calibParamsFileName |
| name of calibration paramters file More... | |
| std::string | _computerInfos |
| std::string | _calibDataPath |
| std::string | _calibImgOutputDir |
| std::string | _exePath |
| bool | _hasAsyncError = false |
| SENSCalibrationEstimatorException | _exception |
Definition at line 37 of file SENSCalibrationEstimator.h.
|
strong |
Definition at line 40 of file SENSCalibrationEstimator.h.
| SENSCalibrationEstimator::SENSCalibrationEstimator | ( | SENSCalibrationEstimatorParams | params, |
| int | camSizeIndex, | ||
| bool | mirroredH, | ||
| bool | mirroredV, | ||
| SENSCameraType | camType, | ||
| std::string | computerInfos, | ||
| std::string | calibDataPath, | ||
| std::string | imageOutputPath, | ||
| std::string | exePath | ||
| ) |
Definition at line 20 of file SENSCalibrationEstimator.cpp.
| SENSCalibrationEstimator::~SENSCalibrationEstimator | ( | ) |
Definition at line 74 of file SENSCalibrationEstimator.cpp.
|
staticprivate |
Calculates the 3D positions of the chessboard corners.
Definition at line 534 of file SENSCalibrationEstimator.cpp.
|
static |
Calculates the calibration with the given set of image points.
Definition at line 226 of file SENSCalibrationEstimator.cpp.
|
staticprivate |
Calculates the reprojection error of the calibration.
Definition at line 302 of file SENSCalibrationEstimator.cpp.
| bool SENSCalibrationEstimator::calculate | ( | ) |
Initiates the final calculation.
Definition at line 82 of file SENSCalibrationEstimator.cpp.
|
private |
Definition at line 160 of file SENSCalibrationEstimator.cpp.
|
inline |
Definition at line 74 of file SENSCalibrationEstimator.h.
|
private |
Definition at line 106 of file SENSCalibrationEstimator.cpp.
|
inline |
|
inline |
Definition at line 77 of file SENSCalibrationEstimator.h.
|
inline |
Definition at line 78 of file SENSCalibrationEstimator.h.
|
inline |
Definition at line 80 of file SENSCalibrationEstimator.h.
|
inline |
Definition at line 81 of file SENSCalibrationEstimator.h.
|
inline |
Definition at line 79 of file SENSCalibrationEstimator.h.
|
private |
Loads the chessboard calibration pattern parameters.
Definition at line 336 of file SENSCalibrationEstimator.cpp.
|
inline |
Definition at line 72 of file SENSCalibrationEstimator.h.
|
inline |
Definition at line 71 of file SENSCalibrationEstimator.h.
|
private |
Definition at line 357 of file SENSCalibrationEstimator.cpp.
|
inline |
Definition at line 67 of file SENSCalibrationEstimator.h.
| bool SENSCalibrationEstimator::updateAndDecorate | ( | cv::Mat | imageColor, |
| const cv::Mat & | imageGray, | ||
| bool | grabFrame, | ||
| bool | drawCorners = true |
||
| ) |
< Finds the inner chessboard corners in the given image
Definition at line 462 of file SENSCalibrationEstimator.cpp.
|
private |
Definition at line 364 of file SENSCalibrationEstimator.cpp.
|
private |
Definition at line 438 of file SENSCalibrationEstimator.cpp.
|
private |
NO. of inner chessboard corners.
Definition at line 122 of file SENSCalibrationEstimator.h.
|
private |
Size of chessboard square in mm.
Definition at line 123 of file SENSCalibrationEstimator.h.
|
private |
Definition at line 138 of file SENSCalibrationEstimator.h.
|
private |
Definition at line 139 of file SENSCalibrationEstimator.h.
|
private |
name of calibration paramters file
Definition at line 136 of file SENSCalibrationEstimator.h.
|
private |
estimated calibration
Definition at line 135 of file SENSCalibrationEstimator.h.
|
private |
Definition at line 116 of file SENSCalibrationEstimator.h.
|
private |
future object for calculation of calibration in async task
Definition at line 118 of file SENSCalibrationEstimator.h.
|
private |
Definition at line 131 of file SENSCalibrationEstimator.h.
|
private |
Definition at line 134 of file SENSCalibrationEstimator.h.
|
private |
Definition at line 137 of file SENSCalibrationEstimator.h.
|
private |
Definition at line 120 of file SENSCalibrationEstimator.h.
|
private |
Definition at line 144 of file SENSCalibrationEstimator.h.
|
private |
Definition at line 140 of file SENSCalibrationEstimator.h.
|
private |
Definition at line 143 of file SENSCalibrationEstimator.h.
|
private |
2D vector of corner points in chessboard
Definition at line 121 of file SENSCalibrationEstimator.h.
|
private |
Input image size in pixels (after cropping)
Definition at line 126 of file SENSCalibrationEstimator.h.
|
private |
Definition at line 132 of file SENSCalibrationEstimator.h.
|
private |
Definition at line 133 of file SENSCalibrationEstimator.h.
|
private |
NO. of images captured.
Definition at line 125 of file SENSCalibrationEstimator.h.
|
private |
NO. of images to capture.
Definition at line 124 of file SENSCalibrationEstimator.h.
|
private |
Definition at line 130 of file SENSCalibrationEstimator.h.
|
private |
Reprojection error after calibration.
Definition at line 127 of file SENSCalibrationEstimator.h.
|
private |
Definition at line 115 of file SENSCalibrationEstimator.h.