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