Skip to content

Chuxwa/Mitsuba4PCD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mitsuba4PCD

Mitsuba4PCD is a point cloud rendering tool based on Python and Mitsuba, you can use Mitsuba's rich features to render virtual point cloud scenes. Note: Mitsuba 0.6 is suitable for CPU rendering and Mitsuba 3.0 is suitable for GPU rendering.

Watch the video

Features

  • High-Quality Rendering: Leverage the power of Mitsuba 3.0 to render physically accurate and photorealistic point cloud scenes.
  • Python Integration: Provides an easy-to-use Python API for loading and processing point cloud data.
  • Flexible Rendering Settings: Customize lighting, materials, and camera parameters to suit your specific rendering needs.
  • Extensible: Easily integrate with other data processing and machine learning libraries.

Installation

Ensure you have Mitsuba 3.0 installed.

Or follow my environment setting:

conda create --name m4pcd python=3.10 -y
conda activate m4pcd
pip install -r requirements.txt

Quick Start

Here’s a simple example showing how to use this library to render a point cloud:

# load the data
pcl, colors = process_data(in_path)

for i in range(len(args.axis)):
    pcl = rotate(pcl, args.axis[i], args.yum[i])

# normlize
mins = np.amin(pcl, axis=0)
maxs = np.amax(pcl, axis=0)
pcl = standardize_point(pcl, mins, maxs)
pcl = pcl[:, [2, 0, 1]]
pcl[:, 0] *= -1
pcl[:, 2] += 0.0125

# save the info into xml file
xml_path = os.path.join(args.workdir, out_path + ".xml") 
xml_head = init_head(args)
xml_tail = init_tail(args.radius, np.min(pcl[:, 2]))
xml = xml_head
xml = add_point_cloud(pcl, colors, args.radius, xml)
xml.append(xml_tail)
xml_content = str.join("", xml)
with open(xml_path, "w") as f:
    f.write(xml_content)

# render the picture
render(xml_path)

License

This project is licensed under the MIT License.

Contact

If you have any questions or suggestions, feel free to contact us at wcx0602@mail.ustc.edu.cn.

About

A point cloud rendering tool based on Python and Mitsuba, you can use Mitsuba's rich features to render virtual point cloud scenes. Note: Mitsuba 0.5 is suitable for CPU rendering and Mitsuba 3.0 is suitable for GPU rendering.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors