日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 人文社科 > 生活经验 >内容正文

生活经验

将pcd格式的点云数据去掉第四维度Itensity信息仍保存为pcd格式

發(fā)布時(shí)間:2023/11/27 生活经验 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 将pcd格式的点云数据去掉第四维度Itensity信息仍保存为pcd格式 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
#include "pch.h"
#include <iostream>//標(biāo)準(zhǔn)C++庫中的輸入輸出類相關(guān)的頭文件
#include <string.h>
#include <pcl/io/auto_io.h>//pcd讀寫類相關(guān)的頭文件int main(int argc, char** argv)
{std::string filename = "F:\\cout-saved\\back_1.pcd";
//創(chuàng)建一個(gè)pcl::PointCloud<pcl::PointXYZI>boost共享指針并進(jìn)行實(shí)例化pcl::PointCloud<pcl::PointXYZI>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZI>);
//打開點(diǎn)云文件if (pcl::io::loadPCDFile(filename, *cloud) < 0){std::cout << "open file error" << std::endl;Sleep(3000);return -1;}pcl::PointCloud<pcl::PointXYZ>::Ptr new_cloud(new pcl::PointCloud<pcl::PointXYZ >);new_cloud->width = cloud->width;new_cloud->height = cloud->height;new_cloud->points.resize(cloud->points.size());for (int i = 0; i < cloud->points.size(); ++i){new_cloud->points[i].x = cloud->points[i].x;new_cloud->points[i].y = cloud->points[i].y;new_cloud->points[i].z = cloud->points[i].z;}if (pcl::io::savePCDFile("F:\\cout-saved\\back_1_remove.pcd", *new_cloud) < 0){std::cout << "save file error" << std::endl;Sleep(3000);return -1;}else{std::cout << "save file success" << std::endl;Sleep(3000);return 0;}
}

上述代碼功能為:將點(diǎn)云數(shù)據(jù)的Pcd格式數(shù)據(jù)包含XYZI的刪除掉I,仍保存為Pcd格式。此點(diǎn)云數(shù)據(jù)有(841行X777列)=653457個(gè)點(diǎn)

總結(jié)

以上是生活随笔為你收集整理的将pcd格式的点云数据去掉第四维度Itensity信息仍保存为pcd格式的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。