跳转到主要内容

Python .e57文件读取器/写入器

项目描述

pye57

PyPI PyPI - Python Version GitHub

Python对LibE57Format的包装,用于读取和写入.e57点云文件

示例用法

import numpy as np
import pye57

e57 = pye57.E57("e57_file.e57")

# read scan at index 0
data = e57.read_scan(0)

# 'data' is a dictionary with the point types as keys
assert isinstance(data["cartesianX"], np.ndarray)
assert isinstance(data["cartesianY"], np.ndarray)
assert isinstance(data["cartesianZ"], np.ndarray)

# other attributes can be read using:
data = e57.read_scan(0, intensity=True, colors=True, row_column=True)
assert isinstance(data["cartesianX"], np.ndarray)
assert isinstance(data["cartesianY"], np.ndarray)
assert isinstance(data["cartesianZ"], np.ndarray)
assert isinstance(data["intensity"], np.ndarray)
assert isinstance(data["colorRed"], np.ndarray)
assert isinstance(data["colorGreen"], np.ndarray)
assert isinstance(data["colorBlue"], np.ndarray)
assert isinstance(data["rowIndex"], np.ndarray)
assert isinstance(data["columnIndex"], np.ndarray)

# the 'read_scan' method filters points using the 'cartesianInvalidState' field
# if you want to get everything as raw, untransformed data, use:
data_raw = e57.read_scan_raw(0)

# writing is also possible, but only using raw data for now
e57_write = pye57.E57("e57_file_write.e57", mode='w')
e57_write.write_scan_raw(data_raw)
# you can specify a header to copy information from
e57_write.write_scan_raw(data_raw, scan_header=e57.get_header(0))

# the ScanHeader object wraps most of the scan information:
header = e57.get_header(0)
print(header.point_count)
print(header.rotation_matrix)
print(header.translation)

# all the header information can be printed using:
for line in header.pretty_print():
    print(line)

# the scan position can be accessed with:
position_scan_0 = e57.scan_position(0)

# the binding is very close to the E57Foundation API
# you can modify the nodes easily from python
imf = e57.image_file
root = imf.root()
data3d = root["data3D"]
scan_0 = data3d[0]
translation_x = scan_0["pose"]["translation"]["x"]

安装

在linux、Windows或Apple Silicon上

python -m pip install pye57

在macOS上带有Intel CPU的情况下,您可以尝试从源代码构建(高级用户)

从源代码构建(供开发者使用)

克隆带有所需子模块的存储库

克隆一个新的存储库,包括libe57Format子模块

git clone https://github.com/davidcaron/pye57.git --recursive

如果存储库已经之前被克隆,但没有使用--recursive标志

cd pye57 # go to the cloned repository
git submodule init # this will initialise the submodules in the repository
git submodule update # this will update the submodules in the repository

Linux上的依赖项

首先安装libxerces-c-dev。

sudo apt install libxerces-c-dev

Windows上的依赖项

要获取xerces-c,您可以尝试从源代码构建或如果您使用conda

conda install -y xerces-c

MacOS上的依赖项

要获取xerces-c,运行

bash ./scripts/install_xerces_c.sh

从存储库源运行pip install

cd pye57
python -m pip install .

卸载

再次使用pip

python -m pip uninstall pye57

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息

源代码分发

pye57-0.4.15.tar.gz (473.1 kB 查看哈希值)

上传时间 源代码

构建分发

pye57-0.4.15-cp313-cp313-win_amd64.whl (1.1 MB 查看哈希值)

上传时间 CPython 3.13 Windows x86-64

pye57-0.4.15-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.5 MB 查看哈希值)

上传时间 CPython 3.13 manylinux: glibc 2.17+ x86-64

pye57-0.4.15-cp313-cp313-macosx_11_0_arm64.whl (2.6 MB 查看哈希值)

上传时间 CPython 3.13 macOS 11.0+ ARM64

pye57-0.4.15-cp312-cp312-win_amd64.whl (1.1 MB 查看哈希值)

上传时间 CPython 3.12 Windows x86-64

pye57-0.4.15-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.5 MB 查看哈希值)

上传时间 CPython 3.12 manylinux: glibc 2.17+ x86-64

pye57-0.4.15-cp312-cp312-macosx_11_0_arm64.whl (2.6 MB 查看哈希值)

上传时间 CPython 3.12 macOS 11.0+ ARM64

pye57-0.4.15-cp311-cp311-win_amd64.whl (1.1 MB 查看哈希值)

上传时间 CPython 3.11 Windows x86-64

pye57-0.4.15-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.5 MB 查看哈希值)

上传时间 CPython 3.11 manylinux: glibc 2.17+ x86-64

pye57-0.4.15-cp311-cp311-macosx_11_0_arm64.whl (2.6 MB 查看哈希值)

上传时间 CPython 3.11 macOS 11.0+ ARM64

pye57-0.4.15-cp310-cp310-win_amd64.whl (1.1 MB 查看哈希值)

上传时间: CPython 3.10 Windows x86-64

pye57-0.4.15-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.5 MB 查看哈希值)

上传时间: CPython 3.10 manylinux: glibc 2.17+ x86-64

pye57-0.4.15-cp310-cp310-macosx_11_0_arm64.whl (2.6 MB 查看哈希值)

上传时间: CPython 3.10 macOS 11.0+ ARM64

pye57-0.4.15-cp39-cp39-win_amd64.whl (1.1 MB 查看哈希值)

上传时间: CPython 3.9 Windows x86-64

pye57-0.4.15-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.5 MB 查看哈希值)

上传时间: CPython 3.9 manylinux: glibc 2.17+ x86-64

pye57-0.4.15-cp39-cp39-macosx_11_0_arm64.whl (2.6 MB 查看哈希值)

上传时间: CPython 3.9 macOS 11.0+ ARM64

pye57-0.4.15-cp38-cp38-win_amd64.whl (1.1 MB 查看哈希值)

上传时间: CPython 3.8 Windows x86-64

pye57-0.4.15-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.5 MB 查看哈希值)

上传时间: CPython 3.8 manylinux: glibc 2.17+ x86-64

pye57-0.4.15-cp38-cp38-macosx_11_0_arm64.whl (2.6 MB 查看哈希值)

上传时间: CPython 3.8 macOS 11.0+ ARM64

支持