problems with the ray in projectPixelTo3dRay
According to the API, the return value is "the unit vector in the camera coordinate frame in the direction of rectified pixel" (from 1.4 is not unit, but with unit z component). I expected that multiplying such a vector by a scalar z would give me the 3D point with depth z that projects into the input pixel. However, when i back-project such a vector the result is not the input pixel:
cv::Point2d pixel(r,c);
cv::Point3d ray = model.projectPixelTo3dRay(pixel);
cv::Point3d point = ray * z;
cv::Point2d back_pixel = model.project3dToPixel(point);
I would expect back_pixel be equal to pixel for any z, but it only happens for z=1. Have I misunderstood something?