cv::Point3f 与pcl::PointXYZ初始化


对pcl::PointCloudpcl::PointXYZ和std::vectorcv::Point3f v_point添加值

#include <opencv2/opencv.hpp>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>

int main(int argc, char** argv)
{
  pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
  std::vector<cv::Point3f> v_point;
  cloud->points.emplace_back(pcl::PointXYZ(1.0, 1.0, 1.0)); //first way
  cloud->push_back(pcl::PointXYZ(1.0, 1.0, 1.0)); //second way
  v_point.emplace_back(cv::Point3f(1.0, 1.0, 1.0));
  std::cout << "cloud size: " << cloud->size() << std::endl;
  std::cout << "v_point size: " << v_point.size() << std::endl;
  return 0;
}


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM