The FreeD input streams support an optional OpenCVLensCalibration input file that allows for zoom based dynamic calibration of the camera distortion based on the received FreeD zoom information (the Camera Zoom value defined in the FreeD D1 packet). It is loaded in the according input field of the stream in the AV Config. The calibration information expected by the system is described in an xml file that contains several calibration points for various FreeD zoom values. Each calibration point needs to contain the FreeD zoom value it represents and the OpenCV distortion calibration data. The format is as follows:
<ArrayOfCalibrationPoint> <CalibrationPoint> <fov_in>1360</fov_in> <camMtx> <ArrayOfDouble> <double>847.3111639116114</double> <double>0</double> <double>379.40236093564715</double> </ArrayOfDouble> <ArrayOfDouble> <double>0</double> <double>822.80221331836481</double> <double>393.53597245545404</double> </ArrayOfDouble> <ArrayOfDouble> <double>0</double> <double>0</double> <double>1</double> </ArrayOfDouble> </camMtx> <distCoeffs> <double>0.5660727432427104</double> <double>-1.0907387126549155</double> <double>0.061961060442317681</double> <double>0.0051947429188215133</double> <double>0</double> </distCoeffs> <fovX>40.099494209406345</fovX> <fovY>30.953099365417138</fovY> <aspect>0.96077780710667848</aspect> </CalibrationPoint> </ArrayOfCalibrationPoint>
A CalibrationPoint entry needs to be created for each FreeD zoom value that is calibrated. Inside the CalibrationPoint entry the following variables can be set:
The implementation is based on and optimised for OpenCV camera calibration.
For each frame Ventuz takes the current FreeD zoom value, compares it to the calibration points in the calibration file and interpolates the distortion between the calibration points using the zoom value. Interpolation is done on the result side in UVSpace, not on the input side.