2015-11-15 12:54:01 -0600 | asked a question | camera calibration accuracy Hi everyone, I am calibrating my camera and I get quite bad results. As of now, I blame that my camera is bad or I am doing something wrong. The main functions I use are: findChessboardCorners, cornerSubPix, findCirclesGrid, calibrateCamera and solvePnP (as very well described in the opencv documentation for camera calibration) So I started to evaluate how the algorithm for camera calibration works if I add 'perfect' data.
I used 3D CAD modelling software (Rhinoceros3D) and modelled my grids with absolute accuracy, i.e. square sizes and the distances between are exactly 10 mm . My calibration pattern lies on OXY plane. Because 3D cad software has perspective view, I can easily render the results on the screen as it is in the reality. So I generated images as I would capture them in the real world.
This scenario is the perfect case - the pattern is absolutely precise, there is no distortion and there is no camera in the world to produce such good results. Chessboard 8x10 My next step is to calibrate camera. I passed the images and from calibrateCamera function I get error of 0.115208 px for chessboard and 0.030177 px for asymmetric grid. Then what I need to do is to evaluate how good the calibration is. For the same set of images I use solvePnP ( used solvePnPRansac with the same results) to locate where the camera is. I made clear solve - no initial guess for the camera position (as this is a new position in the space of the camera). Using rot and trans of the results, I construct a cartesian coordinate system, pass a ray from camera origin, through the UNDISTORTED points and intersect with plane OXY. The problem is that I get significant offset of around 0.15 mm, which means that locating my camera in 3D is wrong. I want to use this as base to do 'camera - projector calibration', but if I get such a big error in the 'perfect' scenario, this will never get good results with real camera/projector. Another test which I did was: The problem is that for LOCATION accuracy I get error 0.165423 mm and for SYSTEMATIC accuracy I get error 0.035441 mm. These errors are two high . I would expect for both LOCATION and SYSTEMATIC accuracy to get something like 0 ... (more) |