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

What is R and T? #1086

Closed
UestcJay opened this issue Feb 22, 2022 · 2 comments
Closed

What is R and T? #1086

UestcJay opened this issue Feb 22, 2022 · 2 comments

Comments

@UestcJay
Copy link

UestcJay commented Feb 22, 2022

when I use PointsRenderer, :
cameras = FoVOrthographicCameras(device=device, R=R, T=T, znear=0.01), is the R and T extrinsics of the camera? I want to render point cloud in world to a view, Is this all right?
` R = torch.from_numpy(extrinsics_ref[:3,:3][np.newaxis,:,:])

    T = torch.from_numpy(extrinsics_ref[:3,3][np.newaxis,:])

    cameras = FoVPerspectiveCameras(device='cpu', R=R, T=T, znear=0.01)
    raster_settings = PointsRasterizationSettings(
        image_size=(128,160),
        radius=0.03,
        points_per_pixel=10
    )

    rasterizer = PointsRasterizer(cameras=cameras, raster_settings=raster_settings)

    renderer = PointsRenderer(
        rasterizer=rasterizer,
        compositor=AlphaCompositor()
    )

    verts = torch.from_numpy(xyz_ref.T.astype(np.float32)).to('cpu')

    rgb = torch.from_numpy(resized_img_src).to('cpu')

    point_cloud = Pointclouds(points=[verts], features=[rgb])

    images = renderer(point_cloud)` 
@bottler
Copy link
Contributor

bottler commented Feb 22, 2022

Yes, R and T are the extrinsics, defining the camera location. https://pytorch3d.org/docs/cameras may be helpful.

@UestcJay
Copy link
Author

UestcJay commented Feb 22, 2022 via email

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