Closed iMeleon closed 5 months ago
uv = camera.img_from_cam(image.cam_from_world * point3D.xyz)example from docs is not working
uv = camera.img_from_cam(image.cam_from_world * point3D.xyz)
why function img_from_cam accept 2d point? maybe it should accept 3d point? image.cam_from_world * point3D.xyz produces 3d point in camera space, yes?
camera.img_from_cam(np.array([1,2,3])) TypeError: img_from_cam(): incompatible function arguments. The following argument types are supported: 1. (self: pycolmap.Camera, arg0: numpy.ndarray[numpy.float64[2, 1]]) -> numpy.ndarray[numpy.float64[2, 1]] 2. (self: pycolmap.Camera, arg0: numpy.ndarray[numpy.float64[m, 2]]) -> numpy.ndarray[numpy.float64[m, 2]] 3. (self: pycolmap.Camera, arg0: List[colmap::Point2D]) -> numpy.ndarray[numpy.float64[m, 2]]
The documentation is incorrect, it should be:
p = image.cam_from_world * point3D.xyz uv = camera.img_from_cam(p[:2] / p[-1])
We should overload img_from_cam to accept a 3D vector as well.
img_from_cam
uv = camera.img_from_cam(image.cam_from_world * point3D.xyz)
example from docs is not workingwhy function img_from_cam accept 2d point? maybe it should accept 3d point? image.cam_from_world * point3D.xyz produces 3d point in camera space, yes?