% K = calib
% returns camera calibration matrix
% the camera was used to capture image sequences
%

function K = calib



ipar = [  1.0728606e+001  9.9957942e-001  1.5707963e+000  3.9279392e+002  2.8602728e+002  1.3200000e-002 ...
	  1.3200000e-002 -2.2881479e-007];

f       = ipar(1);
k_u     = 1/ipar(6);	% scale factor in u
k_v     = 1/ipar(7);	% scale factor in v
K       = zeros(3,3);
K(1,1)  = f*k_u;
K(1,2)  = f*k_u*cos(ipar(3));
K(1,3)  = ipar(4);		% u_coordinate of principal point
K(2,2)  = f*k_v/sin(ipar(3));
K(2,3)  = ipar(5);		% v_coordinate of principal point
K(3,3)  = 1;
k1		= ipar(8);		% radial distorsion parameter
k2		= k1;			% the second camera is the same

