25 : _calibParamsFileName(
"calib_in_params.yml"),
26 _calibIniPath(calibIniPath)
31 "CVTrackedChessboard: could not load calibration parameter",
46 CVFileStorage fs(configString, CVFileStorage::READ | CVFileStorage::MEMORY);
50 Utils::log(
"SLProject",
"Could not open the calibration parameter file: %s", fullCalibIniFile.c_str());
55 fs[
"numInnerCornersWidth"] >>
_boardSize.width;
56 fs[
"numInnerCornersHeight"] >>
_boardSize.height;
71 objectPoints3D.clear();
72 for (
int y = boardSize.height - 1; y >= 0; --y)
73 for (
int x = 0; x < boardSize.width; ++x)
74 objectPoints3D.push_back(
CVPoint3f((
float)x * squareSize,
75 (
float)y * squareSize,
85 assert(!imageGray.empty() &&
"ImageGray is empty");
86 assert(!imageBgr.empty() &&
"ImageBGR is empty");
87 assert(!calib->
cameraMat().empty() &&
"Calibration is empty");
96 int flags = cv::CALIB_CB_FAST_CHECK;
100 _isVisible = cv::findChessboardCorners(imageGray,
112 cv::drawChessboardCorners(imageBgr,
_boardSize, corners2D,
true);
129 cv::SOLVEPNP_ITERATIVE);
vector< cv::Point3f > CVVPoint3f
cv::FileStorage CVFileStorage
vector< cv::Point2f > CVVPoint2f
Live video camera calibration class with OpenCV an OpenCV calibration.
const CVMat & cameraMat() const
const CVMat & distortion() const
CVVPoint3f _boardPoints3D
bool track(CVMat imageGray, CVMat imageBgr, CVCalibration *calib) final
Tracks the chessboard image in the given image for the first sceneview.
void calcBoardCorners3D(const CVSize &boardSize, float squareSize, CVVPoint3f &objectPoints3D)
string _calibParamsFileName
CVTrackedChessboard(string calibIniPath)
bool _isVisible
Flag if marker is visible.
CVMatx44f _objectViewMat
view transformation matrix
static AvgFloat detectTimesMS
Averaged time for video feature detection & description in ms.
bool _drawDetection
Flag if detection should be drawn into image.
static cv::Matx44f createGLMatrix(const CVMat &tVec, const CVMat &rVec)
Create an OpenGL 4x4 matrix from an OpenCV translation & rotation vector.
HighResTimer _timer
High resolution timer.
static AvgFloat poseTimesMS
Averaged time for video feature pose estimation in ms.
float elapsedTimeInMilliSec()
void set(T value)
Sets the current value in the value array and builds the average.
std::string readIntoString(std::string path, SLIOStreamKind kind)
Reads an entire file into a string.
void exitMsg(const char *tag, const char *msg, const int line, const char *file)
Terminates the application with a message. No leak checking.
void log(const char *tag, const char *format,...)
logs a formatted string platform independently