当前位置:网站首页>pcd转ply后在meshlab无法打开,提示 Error details: Unespected eof
pcd转ply后在meshlab无法打开,提示 Error details: Unespected eof
2022-07-06 08:22:00 【Will_Ye】
1. Problem
有一个pcd格式的点云文件,用pcd_viewer可以正常显示,但是想在meshlab里面做些编辑,发现无法打开,提示如下的错误
然后用vim或gedit来打开它,就会发现问题,有些点云文件很大,可能卡死在半路,但是我这个点云文件很小,用gedit test2.ply,显示如下:
可见,都是乱码的错误,所以可以推断,从pcd转成ply的过程处问题了。一般我们都是用pcl_pcd2ply ./1650511200.015289296.pcd ./test2.ply来转换pcd和ply,所以可以确定的是这个指令是没问题的,所以问题出在pcd文件那里。如果平时有留意导入pcd文件后,很多人都会做一个去除NAN值的操作,这一点其实很关键,因为在pcd文件里,确实会保存一些NAN值,而如果我们不先去除它们,直接转成ply文件,就会出现上述的情况,知道原因后,解决就简单了。
2. Solution
思路是:在pcd转ply前,先做一次去除NAN值操作,然后在进行转换,就没问题了。以下是实现代码:
int PCD2PLY_W_removeNAN(string pcdPath, string savePath)
pcl::PCLPointCloud2 cloud_ori;
if (loadPCDFile(pcdPath, cloud_ori) < 0)
{
cout << "Error: cannot load the PCD file!!!" << endl;
return -1;
}
// remove NaN type points
//依赖函数 #include <pcl/filters/filter.h>
std::vector<int> mapping;
pcl::removeNaNFromPointCloud(*cloud_ori, *cloud_ori, mapping);
string savePath = "/home/will/test1.ply";
pcl::PLYWriter writer;
writer.write(savePath,*cloud_ori);
return 0;
}
这时生成的test1.ply就能在meshlab顺利打开了。
边栏推荐
- [MySQL] lock
- sys. argv
- Wincc7.5 download and installation tutorial (win10 system)
- 2022 Inner Mongolia latest construction tower crane (construction special operation) simulation examination question bank and answers
- Analysis of Top1 accuracy and top5 accuracy examples
- [luatos-air551g] 6.2 repair: restart caused by line drawing
- ESP series pin description diagram summary
- Use Alibaba icon in uniapp
- NFT smart contract release, blind box, public offering technology practice -- jigsaw puzzle
- 【云原生】手把手教你搭建ferry开源工单系统
猜你喜欢

JVM performance tuning and practical basic theory - Part 1

C language - bit segment

Nft智能合约发行,盲盒,公开发售技术实战--合约篇

"Designer universe" Guangdong responds to the opinions of the national development and Reform Commission. Primary school students incarnate as small community designers | national economic and Informa
![[research materials] 2022 China yuancosmos white paper - Download attached](/img/b4/422dff0510bbe67f3578202d6e80b7.jpg)
[research materials] 2022 China yuancosmos white paper - Download attached
![Verrouillage [MySQL]](/img/ce/9f8089da60d9b3a3f92a5e4eebfc13.png)
Verrouillage [MySQL]

Beijing invitation media

JVM performance tuning and practical basic theory - Part 1

指针进阶---指针数组,数组指针

leetcode刷题 (5.28) 哈希表
随机推荐
Verrouillage [MySQL]
C language - bit segment
Easy to use tcp-udp_ Debug tool download and use
CISP-PTE实操练习讲解
[research materials] 2022 China yuancosmos white paper - Download attached
2022 Inner Mongolia latest water conservancy and hydropower construction safety officer simulation examination questions and answers
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
TiDB备份与恢复简介
Nft智能合约发行,盲盒,公开发售技术实战--合约篇
Migrate data from a tidb cluster to another tidb cluster
Nacos Development Manual
Introduction to number theory (greatest common divisor, prime sieve, inverse element)
2022.02.13 - NC001. Reverse linked list
Asia Pacific Financial Media | "APEC industry +" Western Silicon Valley invests 2trillion yuan in Chengdu Chongqing economic circle to catch up with Shanghai | stable strategy industry fund observatio
The State Economic Information Center "APEC industry +" Western Silicon Valley will invest 2trillion yuan in Chengdu Chongqing economic circle, which will surpass the observation of Shanghai | stable
将 NFT 设置为 ENS 个人资料头像的分步指南
Huawei cloud OBS file upload and download tool class
Configuring OSPF load sharing for Huawei devices
Circular reference of ES6 module
Mobile Test Engineer occupation yyds dry goods inventory