【目次】
利用条件などは利用者において確認してください
【サイト内の関連ページ】:
参考Webページ
謝辞:このページで使用しているソフトウエア類の作者に感謝します
システム Python を使うことができる(その場合,Python のインストールは行わない)
システム Python を用いるときは,pip, setuptools の更新は次のコマンドで行う.
sudo apt -y update sudo apt -y install python3-pip python3-setuptools
Ubuntu で,システム Python 以外の Python をインストールしたい場合は pyenv が便利である: 別ページで説明している.
Python の URL: http://www.python.org/
【Python, pip の使い方】
Python, pip は,次のコマンドで起動できる.
【Python 開発環境のインストール】
JupyterLab, spyder, nteract (Python 開発環境) のインストールは, Windows でコマンドプロンプトを管理者として実行し, 次のコマンドを実行.
python -m pip install -U pip setuptools jupyterlab jupyter jupyter-console jupytext nteract_on_jupyter spyder
詳しくは,: 別ページで説明している.
JupyterLab, spyder, nteract (Python 開発環境) のインストール: : 別ページで説明している.
Git の URL: https://git-scm.com/
7-Zip の URL: https://sevenzip.osdn.jp/
sudo apt -y update sudo apt -y install git p7zip-full
Windows での マイクロソフト C++ ビルドツール (Build Tools) のインストール手順: 別ページで説明している.
davidcaron/pclpy を使いたい.次のページによれば,バージョンは 1.9.1 が指定されている.
davidcaron/pclpy の URL: https://github.com/davidcaron/pclpy
sudo apt -y update sudo apt -y install libboost-all-dev libeigen3-dev libvtk7-dev libflann-dev cd/usr/local sudo rm -rf pcl-pcl-1.9.1 cd /tmp curl -O -L https://github.com/PointCloudLibrary/pcl/archive/refs/tags/pcl-1.9.1.tar.gz cd /usr/local sudo tar -xvzof /tmp/pcl-1.9.1.tar.gz sudo chown -R $USER pcl-pcl-1.9.1 cd pcl-pcl-1.9.1 mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release .. make -j2 sudo make install
davidcaron/pclpy の URL: https://github.com/davidcaron/pclpy
mkdir c:\pytools cd c:\pytools rmdir /s /q pclpy
sudo mkdir /usr/local/pytools cd /usr/local/pytools sudo rm -rf pclpy
cd pclpy python -m pip install -r requirements-dev.txt
cd pclpy sudo apt -y install python3-pybind11 python3-inflection python3-unidecode python3-pytest sudo pip3 install -r requirements-dev.txt
Ubuntu の場合
sudo chown -R $USER /usr/local/pytools/pclpy cd /usr/local/pytools/pclpy PYTHON=python3 bash scripts/download_pcl.sh PYTHON=python3 bash scripts/generate_points_and_bindings.sh # scripts/generate_hpp_point_types.sh cd generators PCL_REPO_PATH=/usr/local/pcl-pcl-1.9.1 PYTHONPATH=/usr/local/pytools/pclpy python3 generate_point_types.py cd .. python3 setup.py build sudo python3 setup.py install
https://github.com/davidcaron/pclpy/blob/master/README.md に記載の Python プログラムを実行してみる
エラーメッセージが出なければOKとする
import pclpy
from pclpy import pcl
point_cloud = pclpy.read("/usr/local/pclpy/tests/test_data/street.las", "PointXYZRGBA")
mls = pcl.surface.MovingLeastSquaresOMP.PointXYZRGBA_PointNormal()
tree = pcl.search.KdTree.PointXYZRGBA()
mls.setSearchRadius(0.05)
mls.setPolynomialFit(False)
mls.setNumberOfThreads(12)
mls.setInputCloud(point_cloud)
mls.setSearchMethod(tree)
mls.setComputeNormals(True)
output = pcl.PointCloud.PointNormal()
mls.process(output)