Skip to content

OuyangJunyuan/PointCloudRenderer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Point Cloud Renderer

Update

  • 2023-03-10:
    • Currently, it is compatible with mitsuba3.
    • Support GIF recording for moving views or points.

Preparation

pip install -r requirements.txt

Preliminary

  • point cloud format: the extension is npy (saved by numpy ), storing a list of [x,y,z,...].
  • coordinate definition:
    • left: x
    • up:z
    • screen facing out: y

single image rendering

python scripts/once.py \
-f workspace/demo/car.npy \             
-o ./workspace/demo/results/car_single \ 
--format xyzi \   
--color_by i --color_normalize \
--pose 0 0 0 0 0 -180
--preview 

arguments:

  • -f: path to input point cloud
  • -o: path to output image
  • --format: the format of the given point cloud, e.g., xyz/xyzi/xyzrgbs/...
  • --color_by: which data field is used to render colors when the point cloud file does not provide rgb field for each point.
  • --color_normalize: normalize color_by
  • --pose: the pose [x y z r p y] of the given points (in degrees).
  • --preview: for quickly rendering.

besides, you can modify the config file config.yaml to adjust the size of images or other parameters of the renderer:

  • sample: sample per pixel, the higher, the better rendering quality.

a rotating object

python scripts/anim_obj_axis.py \
-f workspace/demo/car.npy \
-o ./workspace/demo/results/car_rot_z \
--pose 0 0 0 0 0 -180 \
--axis 3 0 360 5 \
--fps 15

arguments:

  • -axis: [axis order(x:1,y:2,z:3), begin, end ,interval]
  • -fps: the frames per second for gif animation.

given pose list

python scripts/anim_obj.py \
-f workspace/demo/car.npy \
-o ./workspace/demo/results/car_rot_z \
--pose 0 0 0 0 0 -180 \
--pose_file ./workspace/demo/poses.txt  \
--fps 15

traveling in scene

python scripts/anim_view.py \
-f workspace/demo/car.npy \
-o ./workspace/demo/results/car_views \
--pose 0 0 0 0 0 -180 \
--view_file ./workspace/demo/views.txt  \
--fps 2

arguments:

  • --view_file: store a list of (camera_x,camera_y,camera_z,target_x,targe_y,targe_z)

Further development

  1. The official reference link is given inline the code about scene definition.
  2. Edit the scene: ref
  3. for more properties of plugins please refer this link.

Acknowledge

This script deeply based onMitsuba2PointCloudRenderer and PointFlowRenderer and is an easy-to-use version.

About

a point cloud renderer based on mitsuba3

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages