void CameraIntrinsics::ImageToDirection(double u_distorted, double v_distorted,
                                        double *u_normalized,
                                        double *v_normalized) const {
  CHECK_NOTNULL(u_normalized);
  CHECK_NOTNULL(v_normalized);

  // Make a homogeneous image space point.
  Vector3d p_distorted;
  p_distorted << u_distorted, v_distorted, 1.0;

  // Multiply the distorted homogeneous image space point by the inverse
  // of the camera intrinsic matrix to get a distorted ray.
  const Vector3d p = CameraIntrinsics::Kinv() * p_distorted;

  // Undistort the ray to get the normalized direction vector.
  Undistort(p(0), p(1), u_normalized, v_normalized);
}
Esempio n. 2
0
bool CvCalibFilter::Undistort( IplImage** srcarr, IplImage** dstarr )
{
    return Undistort( (CvMat**)srcarr, (CvMat**)dstarr );
}