10 #ifndef SENSCALIBRATION_H
11 #define SENSCALIBRATION_H
43 bool calcUndistortionMaps);
73 bool calcUndistortionMaps);
137 bool save(
const string& calibDir,
140 void remap(cv::Mat& inDistorted,
141 cv::Mat& outUndistorted)
const;
148 const cv::Mat& distCoeffs,
150 const cv::Mat& newCameraMatrix,
151 const cv::Size& imgSize,
152 cv::Rect_<float>& inner,
153 cv::Rect_<float>& outer);
213 default:
return "unknown";
221 bool load(
const string& calibDir,
223 bool calcUndistortionMaps);
SENSCalibration(const SENSCalibration &other)
copy constructor
State _state
calibration state enumeration
float boardSquareM() const
int _numCaptured
NO. of images captured.
cv::Mat _undistortMapX
Undistortion float map in x-direction.
SENSCalibration(const cv::Mat &intrinsics, const cv::Size &imageSize, bool mirroredH, bool mirroredV, SENSCameraType camType, const string &computerInfos)
create a calibration using a known camera matrix (intrinsics) without distortion parameters
bool save(const string &calibDir, const string &calibFileName)
Saves the camera calibration parameters to the config file.
bool calibRationalModel()
cv::Mat _cameraMatOrig
3x3 Matrix for intrinsic camera matrix (original from loading or calibration estimation)
SENSCameraType camType() const
void buildUndistortionMaps()
Builds undistortion maps after calibration or loading.
void createFromGuessedFOV(int imageWidthPX, int imageHeightPX, float fovH)
Calculates camera intrinsics from a guessed FOV angle.
SENSCalibration & operator=(const SENSCalibration &other)
copy assignment operator implicitly defined
cv::Mat _cameraMatUndistorted
static void getInnerAndOuterRectangles(const cv::Mat &cameraMatrix, const cv::Mat &distCoeffs, const cv::Mat &R, const cv::Mat &newCameraMatrix, const cv::Size &imgSize, cv::Rect_< float > &inner, cv::Rect_< float > &outer)
get inscribed and circumscribed rectangle
const cv::Mat & distortion() const
int _camSizeIndex
The requested camera size index.
bool undistortMapsValid() const
float cameraFovVDeg() const
const cv::Mat & cameraMat() const
float _reprojectionError
Reprojection error after calibration.
float _cameraFovHDeg
Horizontal field of view in degrees.
@ uncalibrated
The camera is not calibrated (no calibration found)
@ calibrated
The camera is calibrated (mainly this means it has distortion coeffs)
@ guessed
The camera intrinsics where estimated from FOV.
SENSCalibration(const string &calibDir, const string &calibFileName, bool calcUndistortionMaps)
???
void remap(cv::Mat &inDistorted, cv::Mat &outUndistorted) const
Undistorts the inDistorted image into the outUndistorted.
bool calibFixAspectRatio()
float reprojectionError() const
bool load(const string &calibDir, const string &calibFileName, bool calcUndistortionMaps)
Loads the calibration information from the config file.
bool calibZeroTangentDist()
cv::Size _imageSize
Input image size in pixels (after cropping)
string calibrationTime() const
cv::Size imageSizeOriginal() const
SENSCalibration(const cv::Mat &cameraMat, const cv::Mat &distortion, cv::Size imageSize, cv::Size boardSize, float boardSquareMM, float reprojectionError, int numCaptured, const string &calibrationTime, int camSizeIndex, bool mirroredH, bool mirroredV, SENSCameraType camType, string computerInfos, int calibFlags, bool calcUndistortionMaps)
creates a fully defined calibration
~SENSCalibration()
destructor
string _calibrationTime
Time stamp string of calibration.
float boardSquareMM() const
cv::Size imageSize() const
static const int _CALIBFILEVERSION
Global const file format version.
bool calibFixPrincipalPoint()
string calibFileName() const
float cameraFovHDeg() const
float _boardSquareMM
Size of chessboard square in mm.
SENSCalibration(float sensorWMM, float sensorHMM, float focalLengthMM, const cv::Size &imageSize, bool mirroredH, bool mirroredV, SENSCameraType camType, string computerInfos)
create a guessed calibration using sensor size, camera focal length and captured image size
cv::Mat _undistortMapY
Undistortion float map in y-direction.
cv::Size _boardSize
NO. of inner chessboard corners.
float imageAspectRatio() const
void calculateUndistortedCameraMat()
Calculate a camera matrix that we use for the scene graph and for the reprojection of the undistored ...
int numCapturedImgs() const
void adaptForNewResolution(const cv::Size &newSize, bool calcUndistortionMaps)
Adapts an already calibrated camera to a new resolution (cropping and scaling)
float _cameraFovVDeg
Vertical field of view in degrees.
string computerInfos() const
void calcCameraFovFromUndistortedCameraMat()
Calculates the vertical field of view angle in degrees.
SENSCalibration(const cv::Size &imageSize, float fovH, bool mirroredH, bool mirroredV, SENSCameraType type, string computerInfos)
creates a guessed calibration using image size and fovV angle
cv::Size boardSize() const
bool _isMirroredH
Flag if image must be horizontally mirrored.
int calibrationFlags() const
cv::Mat _cameraMat
3x3 Matrix for intrinsic camera matrix
cv::Mat _distortion
4x1 Matrix for intrinsic distortion
bool calibThinPrismModel()
const cv::Mat & cameraMatUndistorted() const
int _calibFlags
OpenCV calibration flags.
string _calibFileName
name for calibration file
cv::Size _imageSizeOrig
original image size (original from loading or calibration estimation)
bool _isMirroredV
Flag if image must be vertically mirrored.