1 Star 1 Fork 0

Darkce/pcl.js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

title=

用于浏览器的点云库 (PCL),由 WebAssembly 提供支持。

License: MIT Bundle Size npm version Downloads Github Stars jsDelivr Rate this package semantic-release: angular

English | 简体中文

简介

pcl.js 是在浏览器中运行的 Point Cloud Library (PCL),由 EmscriptenWebAssembly 提供支持。Point Cloud Library (PCL) 是一个独立、大型、开源的 2D/3D 图像和点云处理库。

资源

支持的环境

https://developer.mozilla.org/en-US/docs/WebAssembly#browser_compatibility

Edge
Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
Opera
Opera
Opera
Node.js
Deno
Deno
16+ 52+ 57+ 11+ 44+ 11.0.0+ 1.0+

安装

NPM

# NPM
npm install pcl.js

# Yarn
yarn add pcl.js

CDN

开发环境

<script src="https://cdn.jsdelivr.net/npm/pcl.js/dist/pcl.js"><script>

生产环境

<script src="https://cdn.jsdelivr.net/npm/pcl.js/dist/pcl.min.js"><script>

使用

NPM

import PCL from 'pcl.js';

async function main() {
  // 初始化
  const pcl = await PCL.init({
    // 推荐,可选配置,自定义 WebAssembly 文件链接
    url: 'https://cdn.jsdelivr.net/npm/pcl.js/dist/pcl-core.wasm',
    // 也可以传人 WebAssembly 文件的 ArrayBuffer
    // arrayBuffer: ArrayBuffer
  });

  // ...
}

main();

CDN

<script>
async function main() {
  // 初始化,PCL 是全局对象
  const pcl = await PCL.init({
    // 推荐,可选配置,自定义 WebAssembly 文件链接
    url: 'https://cdn.jsdelivr.net/npm/pcl.js/dist/pcl-core.wasm',
    // 也可以传人 WebAssembly 文件的 ArrayBuffer
    // arrayBuffer: ArrayBuffer
  });

  // ...
}

main();
</script>

简单示例

import PCL from 'pcl.js';

async function main() {
  const pcl = await PCL.init({
    url: 'https://cdn.jsdelivr.net/npm/pcl.js/dist/pcl-core.wasm',
  });

  // 获取 PCD 文件
  const pcd = await fetch('https://cdn.jsdelivr.net/gh/luoxuhai/pcl.js@master/data/rops_tutorial/points.pcd').then(res => res.arrayBuffer());
  // 写入 PCD 文件
  pcl.fs.writeFile('/test.pcd', pcd);
  // 加载 PCD 文件,返回点云对象
  const pointCloud = pcl.io.loadPCDFile('/test.pcd');

  // 使用 PassThrough 过滤器过滤点云
  // 参考: https://pcl.readthedocs.io/projects/tutorials/en/master/passthrough.html#passthrough
  const pass = new pcl.filters.PassThrough();
  pass.setInputCloud(pointCloud);
  pass.setFilterFieldName('z');
  pass.setFilterLimits(0.0, 1.0);
  pass.filter(pointCloud);

  // 将过滤后的点云对象保存为 PCD 文件
  pcl.io.savePCDFileASCII('/test-filtered.pcd', pointCloud);
  // 读取 PCD 文件内容, 内容为 ArrayBuffer
  const pcd = pcl.fs.readFile('/test-filtered.pcd');

  // 删除所有 PCD 文件
  pcl.fs.unlink('/test.pcd')
  pcl.fs.unlink('/test-filtered.pcd')
  // ...
}

main();

资源大小

PCL.js Version: latest

资源 链接 大小
pcl.js https://cdn.jsdelivr.net/npm/pcl.js/dist/pcl.js ~32.3k gzip’d
pcl-core.wasm https://cdn.jsdelivr.net/npm/pcl.js/dist/pcl-core.wasm ~198k gzip’d

模块

  • features
  • filters 50%
  • geometry
  • io 50%
  • kdtree
  • keypoints
  • octree
  • outofcore
  • recognition
  • registration 10%
  • sample_consensus
  • search
  • segmentation
  • surface

协议

MIT

MIT License Copyright (c) 2022 luoxuhai Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

☁️ 用于在 Web 上运行点云库 (PCL) 的 JavaScript 库,由 WebAssembly 提供支持。 展开 收起
MIT
取消

发行版 (1)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Darkce/pcl.js.git
git@gitee.com:Darkce/pcl.js.git
Darkce
pcl.js
pcl.js
master

搜索帮助

Cb406eda 1850385 E526c682 1850385