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
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