Smoothig-PCL-Python (70%)

C++ μ½”λ“œλŠ” [이곳]μ—μ„œ λ‹€μš΄λ‘œλ“œ κ°€λŠ₯ν•©λ‹ˆλ‹€. 원본 μ½”λ“œλŠ” [이곳]을 μ°Έκ³  ν•˜μ˜€μŠ΅λ‹ˆλ‹€. μƒ˜ν”ŒνŒŒμΌμ€ [bunny.pcd]을 μ‚¬μš©ν•˜μ˜€μŠ΅λ‹ˆλ‹€. Jupyter 버젼은 [이곳]μ—μ„œ 확인 κ°€λŠ₯ ν•©λ‹ˆλ‹€.

!python --version 
!pip freeze | grep pcl
Python 2.7.15rc1
python-pcl==0.3
import numpy as np
import pcl
import random

cloud = pcl.load('bunny.pcd')
print('cloud(size) = ' + str(cloud.size))

# Create a KD-Tree
tree = cloud.make_kdtree()

# Output has the PointNormal type in order to store the normals calculated by MLS
mls = cloud.make_moving_least_squares()
mls.set_Compute_Normals (True)
mls.set_polynomial_fit (True)
mls.set_Search_Method (tree)
mls.set_search_radius (0.03) # Use all neighbors in a radius of 3cm.


# // Reconstruct
mls_points = mls.process ()

print('cloud(size) = ' + str(mls_points.size))

pcl.save_PointNormal(mls_points, 'bunny-mls.pcd')
cloud(size) = 397
cloud(size) = 397

λ…Έμ΄μ¦ˆ μ œκ±°ν›„ Upsampling을 μˆ˜ν–‰ ν•˜λ―€λ‘œ, 제거된 λ…Έμ΄μ¦ˆκ°€ λ§Žμ„κ²½μš° 포인트 μˆ˜λŠ” 였히렀 κ°μ†Œ ν• μˆ˜ μžˆμŠ΅λ‹ˆλ‹€.

Last updated

Was this helpful?