Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

projectPixelTo3dRay works differently in C++ and Python APIs #296

Open
francofusco opened this issue Oct 10, 2019 · 2 comments
Open

projectPixelTo3dRay works differently in C++ and Python APIs #296

francofusco opened this issue Oct 10, 2019 · 2 comments

Comments

@francofusco
Copy link

Hello, I just wanted to point out that the API for the PinholeCameraModel is slightly different in Python and C++ regarding the method projectPixelTo3dRay. In the Python API, it returns a unit vector while in C++ it returns the 3D point lying on the ray and having z=1.

Having a look at the documentation of the two languages the difference is expected and documented, with the C++ documentation saying:

In 1.4.x, the vector has z = 1.0. Previously, this function returned a unit vector.

However, wouldn't it make sense to have the same behavior also in Python? Perhaps the normalization can be left as an additional feature by adding a boolean parameter normalize.

@arpitpatel901
Copy link

+1

@ranjitkathiriya
Copy link

ranjitkathiriya commented Jan 21, 2021

vector = self.camera_model.projectPixelTo3dRay((X,Y))
ray_z = [el / vector[2] for el in vector]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants