<< SIP - Scilab Image Processing Toolbox SIP - Scilab Image Processing Toolbox arclength >>

SIP - Scilab Image Processing Toolbox >> SIP - Scilab Image Processing Toolbox > KRC_from_P

KRC_from_P

Decompose a 3x4 projection matrix into K, R, and C

Calling Sequence

[K, R, C] = KRC_from_P(P [, noscale])

Parameters

P
3x4 real matrix.
K
3x3 upper triangular real matrix of intrinsic parameters
R
3x3 rotation matrix
C
3x1 vector indicating the camera center in world coordinates
noscale
Optional parameter. If present, then no scaling will be done in order to guarantee that K(1,1) > 0 and K(3,3) = 1.

Description

Function KRC_from_P decomposes a 3x4 camera matrix P into intrinsic parameters K, rotation R, and center of projection C. A decomposition is chosen for which det(R) = 1 and K is scaled so that K(3,3) = 1 and K(1,1) > 0. The optional parameter noscale prevents this scaling. Note also that you might want to enforce K(2,2) > 0, and depending on your convention for the camera coordinate system you might have to multiply the result by certain matrices to change signs.

Examples

K = [1200    0.3     500  
      0      1200    600
      0       0       1 ];
R = eye(3,3);
T = [3; 4; 5];
P = K*[R T]
[KK,RR,CC] = KRC_from_P(P)
// note that CC = -R'T.

Authors

Availability

The latest version of the Scilab Image Processing toolbox can be found at

http://siptoolbox.sourceforge.net

See Also


<< SIP - Scilab Image Processing Toolbox SIP - Scilab Image Processing Toolbox arclength >>