Ask Your Question
0

calibration from points instead of chessboard

asked 2018-06-06 11:12:01 -0600

charles.fox gravatar image

updated 2018-06-06 11:14:10 -0600

All the camera calibration tools I have found so far are based on chessboards. But I have some data where I know the 3D and 2D locations of a load of non-chessboard points in images (X and Y matrices) and I would like to calibrate for radial distortion and camera matrix directly from them. Do we have a way to do this in CV? Like, perhaps the chessboard functions are calling something internally with X and Y matrices - after doing the chessboard detection -- which I could call directly ? I would like to just call a function callibrateMyCamera(X,Y) with a large number of these known points and get back a 4*3 camera matrix M plus whatever is needed for the radial distortion.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2018-06-06 13:26:14 -0600

C++: double calibrateCamera(InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints, Size imageSize, InputOutputArray cameraMatrix, InputOutputArray distCoeffs, OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs, int flags=0, TermCriteria criteria=TermCriteria( TermCriteria::COUNT+TermCriteria::EPS, 30, DBL_EPSILON) )

This function uses only arrays of points, although in commentaries you may read:

The function estimates the intrinsic camera parameters and extrinsic parameters for each of the views. The algorithm is based on [Zhang2000] and [BouguetMCT]. The coordinates of 3D object points and their corresponding 2D projections in each view must be specified. That may be achieved by using an object with a known geometry and easily detectable feature points. Such an object is called a calibration rig or calibration pattern, and OpenCV has built-in support for a chessboard as a calibration rig (see findChessboardCorners() ). Currently, initialization of intrinsic parameters (when CV_CALIB_USE_INTRINSIC_GUESS is not set) is only implemented for planar calibration patterns (where Z-coordinates of the object points must be all zeros). 3D calibration rigs can also be used as long as initial cameraMatrix is provided.

I guess that an arbitrary set of points may be insufficient for calculations. You can experiment with yours. It returns reprojection error.

edit flag offensive delete link more

Comments

thanks -- that's extremely useful !

charles.fox gravatar imagecharles.fox ( 2018-06-06 13:34:48 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-06-06 11:12:01 -0600

Seen: 2,453 times

Last updated: Jun 06 '18