Camera matrix calculation with affine bias compensation