Mistakes in the docstrings of cam2pixel and pixel2cam
See original GitHub issueHey everyone. I was going through the codebase and I noticed a few mistakes in the docstrings of the functions cam2pixel
and pixel2cam
which are available in kornia/geometry/camera/pinhole.py
.
The function cam2pixel
mentions the following about the return value in its docstring:
https://github.com/kornia/kornia/blob/9d594687db704845c3668d76b6e481666277e375/kornia/geometry/camera/pinhole.py#L582-L584
But on reading the code of the function cam2pixel
, it looks like the output is in pixel coordinates. The output can exceed the range [-1, 1]
. The function cam2pixel
is used in kornia/geometry/depth.py
. Here, we can see that the range normalization is applied to pixel_coords_src
, which is the output of cam2pixel
.
Also, the function pixel2cam
mentions the following about the return value in its docstring:
https://github.com/kornia/kornia/blob/9d594687db704845c3668d76b6e481666277e375/kornia/geometry/camera/pinhole.py#L557-L559
But on reading the code of the function pixel2cam
, it seems like the output is in XYZ camera coordinates. The docstring mentioned that the output would be a tensor of (u, v, 1) cam coordinates
which does not make sense. The output seems to be (x, y, z) cam coordinates.
In summary, I think the return value descriptions in the docstrings of cam2pixel
and pixel2cam
are incorrect. I have not tried running the code though, I’m just mentioning my observations based on my reading. Do let me know your thoughts! I would be happy to send in a PR to fix this if the issue is verified.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
Closing since issue was handled in #1211.
Sure, will do!