Camera Calibration
Through assignment 2, we will deepen our understanding of the full stereo vision pipeline.
This assignment will look at the optical distortion free camera calibration components (step 1 and 2) of the full stereo vision pipeline with other components of the pipeline explored in subsequent assignments.
This assignment requires that you:
- 1 Adapt the Python code provided to extract features points from an image of the calibration object.
- 2 Create your own python code to compute the parameters of the Tsai calibration camera calibration algorithm as seen in class.
- 3 Extend your program to compute the camera calibration error (average and standard deviation) in the image plane (in pixels) and in the calibration cube reference frame (in mm) as seen in class.
- 4 Write a short report with tables of results from your calibration and calibration error code.
Detailed Specification of Overall Assignment:
- 1 Given an image of calibration object and the actual measurements in the physical cube of the checker board dimensions
- 2 Create a .txt or .xls file with both 3d coordinates (in mm) of calibration cube feature points (Xw , Yw , Zw ) in mm and the coordinates of their traces in the image
- 3 Perform Tsai calibration internal and external parameters using point 2.
- 4 Compute camera calibration errors both in the cube and in the image
- 5 Use Python 3 to do the programming
- 6 You are supposed to implement calibration based on class material. You can use OpenCV functions to perform linear algebra operations including matrix inversion. The aim is to learn the necessary camera calibration steps by implementing them.
Phase 1: Camera calibration and errors
Due date Monday 16th May, 23:59
According to lectures content, compute Tsai camera calibration parameters
According to lectures content, compute camera calibration errors in the cube and in the image all code a short report outlining the implementation process
Hints
- Follow class material step by step approach to Tsai calibration.
- Make sure that the calibration points you use are distributed over both sides of the cube.
- Error in the image: Use the coordinates of calibration points in the cube M = (X ,Y ,Z )T and find the coordinates (u ̃ ,v ̃ )T of their traces in the image using equation (u ̃ ,v ̃ )T = K(R|T)M . calibration points in the image, and (u,v) , measured -using image processing- traces of calibration points in the image.
- Displaying results: Provide both average and standard deviation for all camera calibration values.
- Displaying results: Only 2 floating point digits is enough in the values you print out.
Calibration error
Error in the image:
1 Use the coordinates of calibration points in the cube M = (X ,Y ,Z )T and find the coordinates (u ̃ ,v ̃ )T of their wwww ee
traces in the image using equation (u ̃ ,v ̃ )T = K(R|T)M . calibration points in the image, and (u,v) , measured -using image processing- traces of calibration points in the image.
Error in the cube:
The calibration error as measured in the cube compares the actual positions of the cube calibration points as physically measured on the cube Mw = (Xw , Yw , Zw ) and estimated positions Mw of the cube calibration points after performing the back projection of image points (traces of the cube calibration points in the image) (u,v) .
Ray-plane intersection
- Transform image points coordinates (based on bottom left origin) (u,v)T into millimetric coordinates (uc,vc)T (based on the image reference frame with origin at the centre of the image)
- Transform (uc , vc )T into the 3D camera reference coordinates (centre at Oc camera optical centre): (uc , vc , f )T
- Transform (uc , vc , f )T into the 3D cube reference coordinates (centre at Oc camera optical centre) by computing
MIW =(R|T)−1(uc,vc,f)T - Transform the optical centre coordinates in the CRF OC into the optical centre coordinates OC W into the 3D camera reference coordinatesWRF:OCW =(R|T)−1OC
Create the parametric equation (in WRF) of the ray [OC W MI W ) ̃
Find Mw as the intersection of the ray [OC W MI W ) with calibration cube planes e.g. in WRF the equation of plane XY is Z = 0
- 7 Compare Mw , and Mw .
- 8 Compute both average and standard deviation of errors in the cube