2 Star 7 Fork 8

jerry.xu / CloudViewer

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

CloudViewer

版本更新

V 1.0.1

  1. 新增 Save as binary 功能。将点云保存为二进制文件,载入速度更加快。
  2. 优化 Console 窗口。OpenAdd 点云文件时,Console 窗口会显示载入点云所花的时间。
  3. 优化 文件对话框OpenAddSave点云文件时,会默认从上次目录打开,而不是 V 1.0.0中每次都从桌面目录打开。

CloudViewer 简介

CloudViewer (点云可视化软件)是一款面向三维点云数据处理、点云开发专业人员及爱好者的三维点云可视化软件,该软件具备以下功能:

  1. 点云 IO。常见点云格式文件(如 ply, pcd 和 obj)的读取、保存、删除清空及可视化。

  2. 点云的基本操作。设置点云颜色,合并多个点云,点云格式转换等。

  3. 可视化的基本操作。设置视图窗口背景颜色,设置点云的可视化尺寸,设置坐标系的显示,设置视图方位(Main view, Left view, Top view),网格面片显示,网格线框显示等。

  4. 模型生成。生成简单立方排布的点云以及基本三维模型,该功能主要用于测试。

  5. 软件界面基本功能。软件由: [1] 菜单栏、[2] 工具栏、[3] 资源管理树、[4] 属性管理器、[5] 输出窗口、[6] 状态栏、[7] 视图窗口以及 [8] RGB 窗口组成。其中部分都是停靠窗口,可以在菜单栏的视图选项设置是否显示,方便用户自定义软件界面。软件还提供 Windows 和 Darcula 两大主题,其中 Darcula 主题为默认主题,仿照 Visual Studio 和 Android Studio 相应暗系主题设计,极具极客风范。不过为了适应大部分用户,本手册中的示例都是在 Windows 主题下操作的。

CloudViewer 下载及声明

  1. 软件下载CloudViewer 下载 (软件大小 23.7 MB,目前仅支持 Windows 系统)。
  2. Github 源码:https://github.com/nightn/CloudViewer (欢迎 Star 和 Fork)
  3. 使用手册:http://nightn.com/2017/04/15/cloudviewer/
  4. 开发环境:CloudViewer 是用 Windows 10 (64 位) 系统下的 Mircosoft Visual Studio Professional 2013,结合使用 Qt 5.7.0 (64 位) 及 PCL 1.8.0 (64 位) 等开源库进行开发的。
  5. 资源使用:软件所使用的图片资源均来源于 www.easyicon.net
  6. 声明:本软件用作分享与学习,若转载请注明出处,勿作任何商业用途。

CloudViewer 使用

1. 点云 IO

点云 IO 操作主要包括 Open, Add, Save, ClearChange 等。

1.1 打开点云

[重要说明] 点云存放路径不能有中文字符,否则点云不能正常打开!

点云是由很多个具有三维坐标 x, y, z 的点组成的数据格式,除了位置信息外,点云还可以包含颜色信息(点云的 RGB 值)、透明信息、法线信息等。目前常用的点云格式有 pcd, ply 以及 obj 格式。打开这三种格式的点云主要通过 Qt 库的文件对话框和 PCL 库中载入点云数据的相关 API 实现。

点云 IO 的常用操作可以在 File 菜单及工具栏中找到:

打开动作 Open 的实现效果如下图,支持多选进行批量打开。

1.2 添加点云

点云处理中,有时需要同时对多个点云在同一视图窗口进行可视化和处理。添加点云 Add 每次可以添加一个或多个点云文件,而不会清空后台已经缓存的点云数据,也不会清空视图窗口已经显示的点云模型。理论上,添加点云的数量没有限制。Add 实现效果如下图(为了便于区分,将点云设置成了不同颜色):

1.3 保存点云

保存点云 Save 有两个特点:

  • 多类型保存Open 可以实现对 pcd, ply 和 obj 等格式文件的多类型打开,Save 也可以将文件保存成 pcd, ply 等多种类型,这样也就实现了点云的格式转换功能:

  • 多文件保存。CloudViewer 还能将视图窗口显示的所有点云保存为同一个文件,实现了多文件的合并保存。

1.4 清空点云

清空点云 Clear 可将视图窗口中的所有点云模型及后台缓存数据清空。

1.5 点云格式转换

格式转换 Change 暂时未做实现。因为通过 OpenSave 就可以完成点云格式转换。

2. 点云基本操作

点云基本操作会直接影响点云文件的内容,基本功能包括改变点云颜色点云格式转换点云合并等。

2.1 改变点云颜色

点云中的点不但具有三维信息(x, y, z 坐标),还具有颜色信息(R, G, B),为了更形象地描述点云模型,抑或是为了区分不同点云模型,出于这样的目的,我们需要对点云模型的颜色进行修改。具体包括的功能为:

  • 调整RGB值改变单一点云文件颜色。

  • 在多个点云同时显示时,通过在资源管理树的item进行选择,实现对某一个选定的点云进行颜色变换。

  • 既可以通过滑块控件设置RGB,又可以通过颜色对话框来选择具体颜色。

  • 随机上色功能。

2.2 点云格式转换

点云文件的格式种类非常多,常见的能用 PCL 库直接处理的包括 ply, pcd 等,三维扫描仪保存的 wrl 格式。我们往往需要对点云格式进行转换,但是目前存在的主流点云软件,如 Geomagic Studio,Rapidform,MeshLab 等对点云格式转换的支持并不令人满意(比如 Geomagic Studio 能够导入ply文件并对其进行操作,但却不能保存为 ply,只能保存为 wrl。然后需要利用 MeshLab 将 wrl 转换为 ply,最后还需要利用自己写的程序将 ply 转为 pcd,过程非常麻烦!)

CloudViewer 目前实现了多种点云格式的相互转换(wrl文件的转换还有待进一步开发),通过打开并另存为即可实现三种不同点云格式之间的相互转换,打开和保存的实现可以参见上述部分。如下图:

2.3 合并点云

点云合并 = “多点云打开” + “多点云保存”。上述打开和保存功能已经实现了点云合并功能,在此不再赘述。

3. 可视化基本操作

可视化基本操作主要包括设置背景颜色设置点云的可视化尺寸设置视图方位(Main view, Left view, Top view),网格面片显示以及网格线框显示等。

3.1 设置背景颜色

视图窗口中的点云颜色可以更改,背景颜色亦然,效果如下:

3.2 设置点云可视化尺寸

点云由很多点构成,每个点本身具有颜色信息,但是没有尺寸大小的信息。但需要以不同大小进行显示,这是可视化的任务,不涉及对点云本身的修改。设置点云可视化尺寸功能效果如下,分别对应size = 1, 2, 3时点云的大小,为了不影响点云操作,允许的最大尺寸为10(因为点的尺寸越大,渲染速度越慢,对点云的操作也不方便)。

3.3 设置视图方位

设置可视化的视图方位提供了三种不同的视图,主视图(Main View),左视图(Left View)和俯视图(Top View),通过选择相应的视图方位,实现对点云更加快捷的操作。设置视图方位效果如下:

3.4 网格面片显示及网格线框显示

PCL库中提供了非常强大的点云处理功能。在CloudViewer中,实现了点云的网格面片显示和网格线框显示,实现分为三步:点云法线估计,曲面重建和网格显示。显示效果如下:

  • 网格面片显示:

  • 网格线框显示:

4. 模型生成

4.1 立方点云生成

这是一个非常简单但很实用的功能,当你没有点云数据时,可以通过这个功能,生成一个由50000个点随机排布成的立方,如下图所示:

4.2 基本三维模型生成

仅实现了球体的生成。球体生成效果如下图所示:

5. 其他功能

5.1 停靠窗口的显示与隐藏

CloudViewer 包含四个停靠窗口:资源管理树(Data Manager)、属性管理器(Property Manager)、输出窗口(Console)以及RGB窗口(RGB Manager)。通过 View 菜单的选项可以实现停靠窗口的显示及隐藏。

5.2 Console 窗口

输出窗口提供了记录你的操作日志,方便查看,通过右击选择 Clear 可以进行清空,如果你觉得输出窗口没有必要,也可以通过右击选择 Disable consoleEnable console 来禁用或使用输出窗口。

5.3 资源管理树

资源管理树显示了当前打开的所有点云,可以通过单选或多选,然后右键,进行点云的隐藏、显示、删除设置颜色等操作,非常快捷。

5.4 属性管理器

属性管理器记录了选中点云的一些属性:选中点云的点的数量、RGB 信息,还包括打开的点云的总个数,及所有点云点的数量等。

5.5 关于

通过 Help 可以访问我的博客,查看 CloudViewer 的使用手册(后续会出开发手册)。About 界面记录了 CloudViewer 的版本信息和开发者信息。

CloudViewer 总结

CloudViewer 作为一款点云可视化软件,提供了多点云类型,多文件的读取和写入,并实现了点云类型的转换及点云模型的合并。在此基础上,还提供了丰富的可视化操作,如设置点云颜色及尺寸,设置显示背景颜色,点云的网格面片显示,点云的网格线框显示等;此外,还提供了简单的模型生成及绘制功能,如生成立方随机排布的点云模型,绘制基本三维模型如球体和圆柱体等。在界面上,综合运用了 VTK 显示窗口,停靠窗口,文件树窗口,列表窗口,菜单栏,工具栏,状态栏等一系列 Qt 控件,并建立了功能丰富的多种信号槽联系。

在实际测试中,点云的读取和处理速度也非常快,在本机打开包含 50000 个点的点云文件,耗时不超过1秒,打开包含 170000 个点的点云文件,耗时 3 秒左右。而且在程序设计中,综合考虑了各种用户可能会执行的违规操作,为了防止软件崩溃,对多种错误操作进行了合理反馈。

CloudViewer 还有进一步提升的空间。作为一款点云可视化软件,在后期开发中应该会加入少量三维点云处理的功能,如多角度拍摄的点云进行拼接,点云三角化及光学渲染等。最后,比较重要的一点是,软硬件结合,由于实验室常用微软的 Kinect2.0 获取点云数据,但是微软自带的 SDK 采集到的数据不能很好的反应点云的颜色信息(颜色是根据深度信息来确定的,而不是物体的实际颜色),因此,还可以考虑增加 CloudViewer 与 Kinect 连接及实时可视化的功能。相信随着更多功能的添加,CloudViewer 能够更加胜任在实际实验中的点云获取,点云可视化和点云处理的方方面面。

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright {yyyy} {name of copyright owner} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

基于 Qt 和 PCL 开发的点云可视化软件 展开 收起
C++
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C++
1
https://gitee.com/xuxincode/CloudViewer.git
git@gitee.com:xuxincode/CloudViewer.git
xuxincode
CloudViewer
CloudViewer
master

搜索帮助