Decompose a 3x4 projection matrix into K, R, and C
[K, R, C] = KRC_from_P(P [, noscale])
KRC_from_P decomposes a 3x4 camera matrix
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
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.
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.