clarification on radius in FoVOrthographicCameras #1658
alexantonyarokiaraj
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to set up three lines, each line oriented along the coordinate axis. The axes range from -128 to 128 containing 256 points. The camera is orthographic and am trying to render an image of 256 by 256 pixels. I set the radius to 1, expecting to see 256 circles in each coordinate axis.
The image is see is not what I expected. I have attached the images with radius=1. and radius = 0.05
What am I doing wrong ?
`#Set up Data
num_points = 256
lim = 128
x_points = [[x, 0, 0] for x in np.linspace(-lim, lim, num_points)]
y_points = [[0, y, 0] for y in np.linspace(-lim, lim, num_points)]
z_points = [[0, 0, z] for z in np.linspace(-lim, lim, num_points)]
lines = x_points + y_points + z_points
colors = [[1.0, 0.0, 0.0, 1] for _ in range(num_points*3)]
verts = torch.Tensor(lines).to(device)
rgb = torch.Tensor(colors).to(device)
point_cloud = Pointclouds(points=[verts], features=[rgb])
#Setup Image Capture
R, T = look_at_view_transform(dist=100, elev=0, azim=0)
cameras = FoVOrthographicCameras(device=device, R=R, T=T, znear=0.01, max_y=128,min_y=-128,max_x=128,min_x=-128)
raster_settings = PointsRasterizationSettings( image_size=256, radius = 1., points_per_pixel = 1)
rasterizer = PointsRasterizer(cameras=cameras, raster_settings=raster_settings)
renderer = PointsRenderer(rasterizer=rasterizer,compositor=AlphaCompositor())
#Render Image
![radius_1](https://private-user-images.githubusercontent.com/26625574/275364488-66ab881f-6b71-47ea-b1e5-5b6bb63f6253.PNG?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ4ODU1MjQsIm5iZiI6MTcyNDg4NTIyNCwicGF0aCI6Ii8yNjYyNTU3NC8yNzUzNjQ0ODgtNjZhYjg4MWYtNmI3MS00N2VhLWIxZTUtNWI2YmI2M2Y2MjUzLlBORz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI4VDIyNDcwNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWYxMWZhZjcxNzE3N2ViZjEyOGUzM2U3YTEzOGI4Yjg1NjYzMmM4N2RhZTZjZThlZDA0Yjg3YmI2YmIzZTBhMzcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.00WRbH3oP7pv1veXyj2rrGDktJoh_k141WprOectcsU)
![radius_1](https://private-user-images.githubusercontent.com/26625574/275364496-4afb3c1b-8b30-45a9-9764-ad17fc51b954.PNG?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ4ODU1MjQsIm5iZiI6MTcyNDg4NTIyNCwicGF0aCI6Ii8yNjYyNTU3NC8yNzUzNjQ0OTYtNGFmYjNjMWItOGIzMC00NWE5LTk3NjQtYWQxN2ZjNTFiOTU0LlBORz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI4VDIyNDcwNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTIyOTdjZWVkYWU1YzgxMWMwMzlkNTU3MTk3ZWViNzgxODFkZDVmNGU4YjA3NDIwYjRlOWQwM2EwYWEzYTNkOTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.840RmYIZcdEFKHPik8O7fSSAmhrhcZ07Ue5G8XC7G2A)
![radius_0_05](https://private-user-images.githubusercontent.com/26625574/275364508-e733fd39-8540-4bb8-a368-9905357653c8.PNG?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ4ODU1MjQsIm5iZiI6MTcyNDg4NTIyNCwicGF0aCI6Ii8yNjYyNTU3NC8yNzUzNjQ1MDgtZTczM2ZkMzktODU0MC00YmI4LWEzNjgtOTkwNTM1NzY1M2M4LlBORz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI4VDIyNDcwNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJiYmFkZjJjODc3NTUxM2NjMzE3NTgzZmEzYmQwMTkwNjBjZDI3NTE0ZDJiNzg0ZGQ5MzhmNTMxYjMzZGY2MzcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.aH_Kj4j5ghl7ptdrUPVeMji_C15WSH-Nf6R653CXBJw)
images = renderer(point_cloud)
plt.figure(figsize=(10, 10))
plt.imshow(images[0, ..., :3].cpu().numpy())
plt.axis
("off")
plt.show()`
Beta Was this translation helpful? Give feedback.
All reactions