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

The units of nearVal and farVal parameters for computation of Depth Images #2665

Closed
GoktugGuvercin opened this issue Mar 12, 2020 · 4 comments

Comments

@GoktugGuvercin
Copy link

We aim to generate RGB and Depth images of objects by using pybullet. Then, we plan to generate 3D point clouds of those objects by using these two kinds of images. Unfortunately, there is no built-in function for point cloud generation in pybullet.

However, we do not know the measure units of nearVal and farVal parameters used in computation of projection matrix. Is it millimeter or meter ?

@erwincoumans
Copy link
Member

See the example here with point clouds, it has some info about near/far:
https://github.com/bulletphysics/bullet3/blob/master/examples/pybullet/examples/pointCloudFromCameraImage.py

For discussion, please use the forums at http://pybullet.org

@bestgodok
Copy link

We aim to generate RGB and Depth images of objects by using pybullet. Then, we plan to generate 3D point clouds of those objects by using these two kinds of images. Unfortunately, there is no built-in function for point cloud generation in pybullet.

However, we do not know the measure units of nearVal and farVal parameters used in computation of projection matrix. Is it millimeter or meter ?

Do you know how to generate the Depth images?I used the API getCameraImage, but it returns values between 0 and 1

@jamesbraza
Copy link
Contributor

@GoktugGuvercin did you ever figure out the units? I have the same question as you.

Looking through the pointCloudFromCameraImage.py file there is not a single mention of units, and I am not finding any relevant forum posts either.

@jamesbraza
Copy link
Contributor

Okay, as suggested above, I made a forum post here: https://pybullet.org/Bullet/phpBB3/viewtopic.php?f=9&t=13345


Also, to answer @bestgodok:

I used the API getCameraImage, but it returns values between 0 and 1

getCameraImage returns a 5-item tuple object, I am not sure what you did. Try downloading and locally running the pointCloudFromCameraImage.py or getCameraImageTest.py files with a debugger, and then inspect the return from getCameraImage... should return a bunch of things. Personally, I find PyCharm's built-in debugger is great.

Also, for what it's worth, getCameraImage's returns are documented in the PyBullet Quickstart Guide here. Hope this helps.

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

4 participants