当前位置:网站首页>After PCD is converted to ply, it cannot be opened in meshlab, prompting error details: ignored EOF
After PCD is converted to ply, it cannot be opened in meshlab, prompting error details: ignored EOF
2022-07-06 08:35:00 【Will_ Ye】
1. Problem
There is one pcd Point cloud file in format , use pcd_viewer It can be displayed normally , But I want to meshlab Do some editing inside , Found unable to open , Prompt the following error
And then use vim
or gedit
To open it , You'll see the problem , Some point cloud files are large , It may get stuck on the way , But my point cloud file is very small , use gedit test2.ply
, It is shown as follows : so , It's all garbled mistakes , So it can be inferred that , from pcd Turn into ply There is a problem in the process of . Usually we use them
pcl_pcd2ply ./1650511200.015289296.pcd ./test2.ply
To convert pcd and ply, So it is certain that this instruction is ok , So the problem is pcd Where are the papers . If you usually pay attention to import pcd After the document , Many people will do a removal NAN The operation of the value , This is actually the key , Because in pcd In the document , It does save some NAN value , And if we don't remove them first , Direct conversion ply file , This will happen , When you know why , The solution is simple .
2. Solution
The train of thought is : stay pcd turn ply front , First do a removal NAN Value operation , And then we're converting , That's fine . Here is the implementation code :
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
// Dependent functions #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;
}
It's generated at this point test1.ply
You can be in meshlab Successfully opened .
边栏推荐
- 移位运算符
- win10系统中的截图,win+prtSc保存位置
- IOT -- interpreting the four tier architecture of the Internet of things
- China high purity silver nitrate Market Research and investment strategy report (2022 Edition)
- [MySQL] log
- Rviz仿真时遇到机器人瞬间回到世界坐标原点的问题及可能原因
- Summary of MySQL index failure scenarios
- Restful API design specification
- Circular reference of ES6 module
- Synchronized solves problems caused by sharing
猜你喜欢
Chrome浏览器的crash问题
Ruffian Heng embedded bimonthly, issue 49
2. File operation - write
2022 Inner Mongolia latest water conservancy and hydropower construction safety officer simulation examination questions and answers
游戏解包的危害及资源加密的重要性
Use Alibaba icon in uniapp
MySQL learning record 11jdbcstatement object, SQL injection problem and Preparedstatement object
JS inheritance method
【MySQL】锁
个人电脑好用必备软件(使用过)
随机推荐
LDAP應用篇(4)Jenkins接入
Bottom up - physical layer
[MySQL] lock
JVM performance tuning and practical basic theory - Part 1
What is CSRF (Cross Site Request Forgery)?
C language double pointer -- classic question type
CISP-PTE实操练习讲解
C语言深度解剖——C语言关键字
C語言雙指針——經典題型
Ruffian Heng embedded bimonthly, issue 49
sys.argv
Summary of MySQL index failure scenarios
Wincc7.5 download and installation tutorial (win10 system)
根据csv文件某一列字符串中某个数字排序
企微服务商平台收费接口对接教程
sublime text没关闭其他运行就使用CTRL+b运行另外的程序问题
Image, CV2 read the conversion and size resize change of numpy array of pictures
深度剖析C语言指针
Research and investment forecast report of citronellol industry in China (2022 Edition)
生成器参数传入参数