Skip to content

Pulsar perspective camera bug? Rendering same perspective camera gets different results using PulsarRenderer and PointRenderer #590

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

Closed
Rima121212 opened this issue Mar 9, 2021 · 5 comments
Assignees

Comments

@Rima121212
Copy link

Rendering the same Pointclouds instance with the same PerspectiveCameras parameter returns a different results when using PointsRenderer and PulsarRenderer. It seems that the pulsar rendering result is offseted along the x and y axis from the PointsRenderer output. I'm attaching an image below.

The rasterizer used is a bit different, as the code complains otherwise. I'm attaching a sample code below.
Also, browsing at the pulsar code it seems like it might only support orthographic projection at the moment, and doesn't use the given focal length parameter. Is that correct? This could explain the issue but seems to be undocumented.

Instructions To Reproduce the Issue:

#cam - PerspectiveCamera with R,T,focal_length, and principal point provided
cam = PerspectiveCameras(device=device,focal_length=focal_length,
principal_point=principal_point,R=R,T=T,)
#Points
raster_settingsPoints = PointsRasterizationSettings(
image_size=nxy,
radius=0.001,
bin_size=128,
)
rasterizerPoints = PointsRasterizer(cameras=cam,raster_settings=raster_settingsPoints)
rendererPoints = PointsRenderer(
rasterizer=rasterizerPoints,
compositor=NormWeightedCompositor()
)
imagePoints = rendererPoints(point_cloudPoints,
bg_col=torch.ones((3,),dtype=torch.float32,device=device),)[0].cpu()

#Pulsar
vert_rad_init = 0.001*torch.ones(pts_init.shape[0],dtype=torch.float32,device=device)
raster_settingsPulsar = PointsRasterizationSettings(
image_size=nxy,
radius=vert_rad_init,
)
rasterizerPulsar = PointsRasterizer(cameras=cam,raster_settings=raster_settingsPulsar)
renderer = PulsarPointsRenderer(rasterizer=rasterizerPulsar).to(device)
gamma = 0.1
imagePulsar = renderer(
point_cloudPulsar,
gamma=(gamma,),
zfar=(45.0,),
znear=(0.1,),
radius_world=True,
bg_col=torch.zeros((3,),dtype=torch.float32,device=device),
focal_length=cam.focal_length,
principal_point=cam.principal_point,
R=cam.R,
T=cam.T,
)[0]

Thank you in advance for your reply!

@Rima121212
Copy link
Author

Pairs4Facebook

@classner
Copy link
Contributor

Hi @Rima121212 !

Indeed, there is a confirmed bug in the transformation of camera parameters in the unified interface. We are aware of the problem and have a plan to address this by replacing the current transformation with a step-wise transformation PyTorch3D -> OpenCV -> Pulsar, whereas both parts PyTorch3D->OpenCV (#522, inverse) and OpenCV->Pulsar (#519) are well tested on their own.

@Rima121212
Copy link
Author

Thank you for your reply! It will be nice to have this functionality :-)

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Jun 23, 2021
@github-actions
Copy link

This issue was closed because it has been stalled for 5 days with no activity.

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

No branches or pull requests

4 participants