CAMERA CALIBRATION:	
"See also Documents/FileFormats.pdf"

proj??.dat files (One file for each camera) 

Explanation: 

1) Intrinsic parameters:

K=  fc1   0       cc1
    0     fc2     cc2
    0	  0        1

with 

-focal length:

fc= [fc1 fc2]

-Principal Point:

cc=[cc1 cc2]

# Focal length: The focal length in pixels is stored in the 2x1 vector fc.
# Principal point: The principal point coordinates are stored in the 2x1 vector cc. (In pixels too !!) 

Important Convention: Pixel coordinates are defined such that [0;0] is the center of the upper left pixel of the image. 
As a result, [nx-1;0] is center of the upper right corner pixel, [0;ny-1] is the center of the lower left corner pixel
and [nx-1;ny-1] is the center of the lower right corner pixel where nx and ny are the width and height of the image 
(for the images of the first example, nx=640 and ny=480). One matlab function provided in the toolbox computes that 
direct pixel projection map. This function is project_points2.m. This function takes in the 3D coordinates of a set 
of points in space (in world reference frame or camera reference frame) and the intrinsic camera parameters (fc,cc,kc,alpha_c),
and returns the pixel projections of the points on the image plane. See the information given in the function. 


2) Extrinsic parameters:

Rotation and translation: 

M=   R   t
     0   1

M is the transformation from the world coordinate system (the calibration cube) and the camera frame. 
If M= [A | b] then the camera center in world coordinates is -A^-1*b



3) Projection matrix (Extrinsic + intrinsic]

P = [K |0]  * M 



MATLAB FILES (OPTIONAL, NOT NEEDED)
The w?.m and c?.m are calibration files.

- The c?.m contain only the intrinsics.
- The w?.m contain the intrinsics and also the parameters after extrinsic calibration. 

The w?.m files should be used to obtain the projection matrices. proj??.dat

- getprojection('w1','outputfile');