SLProject
4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
|
#include <CVCalibrationEstimator.h>
Public Types | |
enum class | State { Streaming = 0 , Calculating , BusyExtracting , Done , DoneCaptureAndSave , Error } |
Public Member Functions | |
CVCalibrationEstimator (CVCalibrationEstimatorParams params, int camSizeIndex, bool mirroredH, bool mirroredV, CVCameraType camType, string computerInfos, string calibDataPath, string imageOutputPath, string exePath) | |
~CVCalibrationEstimator () | |
bool | calculate () |
Initiates the final calculation. More... | |
bool | updateAndDecorate (CVMat imageColor, const CVMat &imageGray, bool grabFrame, bool drawCorners=true) |
< Finds the inner chessboard corners in the given image More... | |
State | state () |
int | numImgsToCapture () |
int | numCapturedImgs () |
bool | calibrationSuccessful () |
CVCalibration | getCalibration () |
Get resulting calibration. More... | |
bool | isBusyExtracting () |
bool | isCalculating () |
bool | isStreaming () |
bool | isDone () |
bool | isDoneCaptureAndSave () |
Static Public Member Functions | |
static bool | calcCalibration (CVSize &imageSize, CVMat &cameraMatrix, CVMat &distCoeffs, const CVVVPoint2f &imagePoints, CVVMat &rvecs, CVVMat &tvecs, vector< float > &reprojErrs, float &totalAvgErr, CVSize &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 CVVVPoint3f &objectPoints, const CVVVPoint2f &imagePoints, const CVVMat &rvecs, const CVVMat &tvecs, const CVMat &cameraMatrix, const CVMat &distCoeffs, vector< float > &perViewErrors) |
Calculates the reprojection error of the calibration. More... | |
static void | calcBoardCorners3D (const CVSize &boardSize, float squareSize, CVVPoint3f &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 |
CVVVPoint2f | _imagePoints |
2D vector of corner points in chessboard More... | |
CVSize | _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... | |
CVSize | _imageSize |
Input image size in pixels (after cropping) More... | |
float | _reprojectionError = -1.f |
Reprojection error after calibration. More... | |
CVCalibrationEstimatorParams | _params |
int | _camSizeIndex = -1 |
bool | _mirroredH = false |
bool | _mirroredV = false |
CVCameraType | _camType = CVCameraType::FRONTFACING |
CVCalibration | _calibration |
estimated calibration More... | |
string | _calibParamsFileName |
name of calibration paramters file More... | |
string | _computerInfos |
string | _calibDataPath |
string | _calibImgOutputDir |
string | _exePath |
bool | _hasAsyncError = false |
CVCalibrationEstimatorException | _exception |
Definition at line 43 of file CVCalibrationEstimator.h.
|
strong |
Definition at line 46 of file CVCalibrationEstimator.h.
CVCalibrationEstimator::CVCalibrationEstimator | ( | CVCalibrationEstimatorParams | params, |
int | camSizeIndex, | ||
bool | mirroredH, | ||
bool | mirroredV, | ||
CVCameraType | camType, | ||
string | computerInfos, | ||
string | calibDataPath, | ||
string | imageOutputPath, | ||
string | exePath | ||
) |
Definition at line 15 of file CVCalibrationEstimator.cpp.
CVCalibrationEstimator::~CVCalibrationEstimator | ( | ) |
Definition at line 70 of file CVCalibrationEstimator.cpp.
|
staticprivate |
Calculates the 3D positions of the chessboard corners.
Definition at line 532 of file CVCalibrationEstimator.cpp.
|
static |
Calculates the calibration with the given set of image points.
Definition at line 222 of file CVCalibrationEstimator.cpp.
|
staticprivate |
Calculates the reprojection error of the calibration.
Definition at line 298 of file CVCalibrationEstimator.cpp.
bool CVCalibrationEstimator::calculate | ( | ) |
Initiates the final calculation.
Definition at line 78 of file CVCalibrationEstimator.cpp.
|
private |
Definition at line 156 of file CVCalibrationEstimator.cpp.
|
inline |
Definition at line 80 of file CVCalibrationEstimator.h.
|
private |
Definition at line 102 of file CVCalibrationEstimator.cpp.
|
inline |
|
inline |
Definition at line 83 of file CVCalibrationEstimator.h.
|
inline |
Definition at line 84 of file CVCalibrationEstimator.h.
|
inline |
Definition at line 86 of file CVCalibrationEstimator.h.
|
inline |
Definition at line 87 of file CVCalibrationEstimator.h.
|
inline |
Definition at line 85 of file CVCalibrationEstimator.h.
|
private |
Loads the chessboard calibration pattern parameters.
Definition at line 332 of file CVCalibrationEstimator.cpp.
|
inline |
Definition at line 78 of file CVCalibrationEstimator.h.
|
inline |
Definition at line 77 of file CVCalibrationEstimator.h.
|
private |
Definition at line 353 of file CVCalibrationEstimator.cpp.
|
inline |
Definition at line 73 of file CVCalibrationEstimator.h.
bool CVCalibrationEstimator::updateAndDecorate | ( | CVMat | imageColor, |
const CVMat & | imageGray, | ||
bool | grabFrame, | ||
bool | drawCorners = true |
||
) |
< Finds the inner chessboard corners in the given image
Definition at line 460 of file CVCalibrationEstimator.cpp.
|
private |
Definition at line 362 of file CVCalibrationEstimator.cpp.
|
private |
Definition at line 436 of file CVCalibrationEstimator.cpp.
|
private |
NO. of inner chessboard corners.
Definition at line 128 of file CVCalibrationEstimator.h.
|
private |
Size of chessboard square in mm.
Definition at line 129 of file CVCalibrationEstimator.h.
|
private |
Definition at line 144 of file CVCalibrationEstimator.h.
|
private |
Definition at line 145 of file CVCalibrationEstimator.h.
|
private |
name of calibration paramters file
Definition at line 142 of file CVCalibrationEstimator.h.
|
private |
estimated calibration
Definition at line 141 of file CVCalibrationEstimator.h.
|
private |
Definition at line 122 of file CVCalibrationEstimator.h.
|
private |
future object for calculation of calibration in async task
Definition at line 124 of file CVCalibrationEstimator.h.
|
private |
Definition at line 137 of file CVCalibrationEstimator.h.
|
private |
Definition at line 140 of file CVCalibrationEstimator.h.
|
private |
Definition at line 143 of file CVCalibrationEstimator.h.
|
private |
Definition at line 126 of file CVCalibrationEstimator.h.
|
private |
Definition at line 150 of file CVCalibrationEstimator.h.
|
private |
Definition at line 146 of file CVCalibrationEstimator.h.
|
private |
Definition at line 149 of file CVCalibrationEstimator.h.
|
private |
2D vector of corner points in chessboard
Definition at line 127 of file CVCalibrationEstimator.h.
|
private |
Input image size in pixels (after cropping)
Definition at line 132 of file CVCalibrationEstimator.h.
|
private |
Definition at line 138 of file CVCalibrationEstimator.h.
|
private |
Definition at line 139 of file CVCalibrationEstimator.h.
|
private |
NO. of images captured.
Definition at line 131 of file CVCalibrationEstimator.h.
|
private |
NO. of images to capture.
Definition at line 130 of file CVCalibrationEstimator.h.
|
private |
Definition at line 136 of file CVCalibrationEstimator.h.
|
private |
Reprojection error after calibration.
Definition at line 133 of file CVCalibrationEstimator.h.
|
private |
Definition at line 121 of file CVCalibrationEstimator.h.