-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Rendering point clouds with perspective camera and specified intrinsics with Pulsar backend #1811
Comments
I found out from this other issue #1352 (comment) that if I include the use the code from PR #1369, point clouds align between pulsar and pytorch3d. I'll be trying out this version on the data presented above and close the issue if it works as expected. |
This code with the pull request installed produces the expected output:
Now I'll be trying to render with the basic pulsar interface rather than the unified interface, as it was mentioned in #1352 (comment) it should run faster with fewer conversions. |
Hi there!
Goal:
I am attempting to use PyTorch3d with Pulsar to render images from point clouds of an outdoor scene.
Setup:
The ground truth image from the camera looks like this (720x1280 resolution):
The RGB image is loaded from a numpy file named "rgb_img_save.npy" in the attached zip folder.
I collected the depth image from the same camera and saved it as "depth_img_save.npy" under the attached zip folder.
I also have the camera extrinsics (position and orientation) in a 4x4 transformation matrix saved as "mat_pose_save.npy" in the attached zip folder (at the bottom of this issue).
My camera intrinsics as defined as follows:
WIDTH = 1_280
HEIGHT = 720
FOCAL_LENGTH = 529.
PRINCIPAL_PT_X = 631.0499
PRINCIPAL_PT_Y = 348.0125
Sanity Check with PyTorch3D
As a sanity check, I project the RGB image into the world coordinates using the
pytorch3d.implicitron.tools.point_cloud_utils.get_rgbd_point_cloud
function, and render the image back into 2D withpytorch3d.renderer.PointsRenderer:
The rendered image looks correct! (The red and blue channels are flipped, but that's ok)
Attempting to use Pulsar backend to render image
I then tried to perform the same reprojection and achieve the same result using Pulsar to speed up the rendering.
I originally used the same camera definition.
The rendered picture is just the background green pixels.
I then tried redefining the camera from scratch, starting with ignoring the principal point, and just incorporating the focal length.
It looks like the spheres are there; just really big. So I kept scaling the focal length down.
Setting
focal_length=focal_length_torch*.0015
in the above code:Now we're getting closer! But I'm still not sure what the actual focal length Pulsar expects, nor the principal point, because the edges are still the background.
I also tried using the basic Pulsar backend (without the unified framework). So, I first got the camera parameters in the basic Pulsar format by using
pytorch3d.utils.pulsar_from_cameras_projection
on the original perspective camera definition above:But the output is a completely blank image (white).
Would anyone have any suggestions for how the Pulsar camera should be defined using the original camera intrinsics to get the expected ground truth image? Truly appreciate your time and help! Thanks!
github_issue_files.zip
The text was updated successfully, but these errors were encountered: