PC Skeletor 项目使用文档
pc-skeletorSkeletonization of 3D Point Clouds项目地址:https://gitcode.com/gh_mirrors/pc/pc-skeletor
1. 项目的目录结构及介绍
PC Skeletor 项目的目录结构如下:
pc-skeletor/
├── github/
│ └── workflows/
├── img/
├── pc_skeletor/
├── tests/
├── .gitattributes
├── .gitignore
├── .gitmodules
├── LICENSE
├── MANIFEST.in
├── README.md
├── example_tree.py
├── pyproject.toml
├── requirements.txt
├── setup.py
├── setup_env.sh
目录介绍
github/workflows/
: 包含 GitHub Actions 的工作流配置文件。img/
: 存放项目相关的图像文件。pc_skeletor/
: 项目的主要代码目录,包含核心功能实现。tests/
: 包含项目的测试代码。.gitattributes
: Git 属性配置文件。.gitignore
: Git 忽略文件配置。.gitmodules
: Git 子模块配置文件。LICENSE
: 项目的许可证文件。MANIFEST.in
: 打包清单文件。README.md
: 项目说明文档。example_tree.py
: 示例代码文件。pyproject.toml
: 项目配置文件。requirements.txt
: 项目依赖文件。setup.py
: 项目安装脚本。setup_env.sh
: 环境设置脚本。
2. 项目的启动文件介绍
项目的启动文件是 example_tree.py
,该文件包含了如何使用 PC Skeletor 进行点云骨架提取的示例代码。以下是该文件的简要介绍:
import open3d as o3d
import numpy as np
from pc_skeletor import Dataset
from pc_skeletor import LBC
# 下载示例数据集
downloader = Dataset()
trunk_pcd_path, branch_pcd_path = downloader.download_semantic_tree_dataset()
# 读取点云数据
pcd_trunk = o3d.io.read_point_cloud(trunk_pcd_path)
pcd_branch = o3d.io.read_point_cloud(branch_pcd_path)
pcd = pcd_trunk + pcd_branch
# 进行 Laplacian-Based Contraction (LBC)
lbc = LBC(point_cloud=pcd)
lbc.run()
# 保存结果
lbc.save_swc('skeleton.swc')
该文件展示了如何下载示例数据集、读取点云数据、进行骨架提取以及保存结果。
3. 项目的配置文件介绍
项目的配置文件主要包括 pyproject.toml
和 setup.py
。
pyproject.toml
该文件是 Python 项目的配置文件,用于定义项目的构建系统和其他元数据。以下是该文件的简要内容:
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "pc-skeletor"
version = "1.3.0"
description = "Python library for extracting a curved skeleton from 3d point clouds using Laplacian-Based Contraction and Semantic Laplacian-Based Contraction"
authors = [
{ name="Philipp Schlegel" }
]
license = { file="LICENSE" }
readme = "README.md"
requires-python = ">=3.6"
dependencies = [
"open3d",
"numpy"
]
setup.py
该文件是 Python 项目的安装脚本,用于定义项目的安装过程和依赖项。以下是该文件的简要内容:
from setuptools import setup, find_packages
setup(
name='pc-skeletor',
version='1.3.0',
description='Python library for extracting a curved skeleton from 3d point clouds using Laplacian-Based Contraction and Semantic Laplacian-Based Contraction',
author='Philipp Schlegel',
license='GNU General Public License v3 or later (GPLv3+)',
packages=find_packages(),
install_requires=[
'open3d',
pc-skeletorSkeletonization of 3D Point Clouds项目地址:https://gitcode.com/gh_mirrors/pc/pc-skeletor