hengli / camodocal

CamOdoCal: Automatic Intrinsic and Extrinsic Calibration of a Rig with Multiple Generic Cameras and Odometry
Other
1.16k stars 389 forks source link

why ScaramuzzaCamera's liftProjective return xc[0], xc[1], -z #76

Open renjingc opened 6 years ago

renjingc commented 6 years ago

void OCAMCamera::liftProjective(const Eigen::Vector2d& p, Eigen::Vector3d& P) const { // Relative to Center Eigen::Vector2d xc(p[0] - mParameters.center_x(), p[1] - mParameters.center_y());

// Affine Transformation
// xc_a = inv(A) * xc;
Eigen::Vector2d xc_a(
    m_inv_scale * (xc[0] - mParameters.D() * xc[1]),
    m_inv_scale * (-mParameters.E() * xc[0] + mParameters.C() * xc[1])
);

double phi = std::sqrt(xc_a[0] * xc_a[0] + xc_a[1] * xc_a[1]);
double phi_i = 1.0;
double z = 0.0;

for (int i = 0; i < SCARAMUZZA_POLY_SIZE; i++)
{
    z += phi_i * mParameters.poly(i);
    phi_i *= phi;
}

P << xc[0], xc[1], -z;

}

why return xc[0], xc[1], -z I think maybe is xc_a[0], xc_a[1], -z

ouyangandy commented 4 years ago

i think you r right