在做三维的深度学习时,可以利用已有的CAD模型得到点云数据

1.利用pcl库

pcl库中有多个函数可以实现模型的读入和点云的生成。
I/O模块下有三个函数可以载入数据:

pcl::io::loadPCDFile()
pcl::io::loadOBJFile()
pcl::io::loadPLYFile()

同时tools模块下就包含了两个转换函数obj2pcdply2pcd
其中obj2pcd的实现代码如下:

int
main (int argc, char** argv)
{print_info ("Convert a OBJ file to PCD format. For more information, use: %s -h\n", argv[0]);if (argc < 3){printHelp (argc, argv);return (-1);}// Parse the command line arguments for .pcd and .obj filesstd::vector<int> pcd_file_indices = parse_file_extension_argument (argc, argv, ".pcd");std::vector<int> obj_file_indices = parse_file_extension_argument (argc, argv, ".obj");if (pcd_file_indices.size () != 1 || obj_file_indices.size () != 1){print_error ("Need one input OBJ file and one output PCD file.\n");return (-1);}// Load the OBJ fileTicToc tt;print_highlight ("Loading "); print_value ("%s ", argv[obj_file_indices[0]]);// Load the input filevtkSmartPointer<vtkPolyData> polydata;vtkSmartPointer<vtkOBJReader> reader = vtkSmartPointer<vtkOBJReader>::New ();reader->SetFileName (argv[obj_file_indices[0]]);reader->Update ();polydata = reader->GetOutput ();print_info ("[done, "); print_value ("%g", tt.toc ()); print_info (" ms : "); print_value ("%d", polydata->GetNumberOfPoints ()); print_info (" points]\n");bool copy_normals = false;parse_argument (argc, argv, "-copy_normals", copy_normals);PCL_INFO ("Copy normals: %s.\n", copy_normals ? "true" : "false");if (copy_normals){vtkSmartPointer<vtkPolyDataNormals> ng = vtkSmartPointer<vtkPolyDataNormals>::New ();
#if VTK_MAJOR_VERSION < 6ng->SetInput (polydata);
#elseng->SetInputData (polydata);
#endifng->ComputePointNormalsOn ();ng->ComputeCellNormalsOff ();ng->Update ();polydata = ng->GetOutput ();pcl::PointCloud<pcl::PointNormal> cloud;vtkPolyDataToPointCloud (polydata, cloud);// Convert to pcd and savesaveCloud (argv[pcd_file_indices[0]], cloud);}else{ pcl::PointCloud<pcl::PointXYZ> cloud;vtkPolyDataToPointCloud (polydata, cloud);// Convert to pcd and savesaveCloud (argv[pcd_file_indices[0]], cloud);}return (0);
}

ply2pcd代码实现如下:

//https://github.com/PointCloudLibrary/pcl/tree/master/tools
int
main (int argc, char** argv)
{print_info ("Convert a PLY file to PCD format. For more information, use: %s -h\n", argv[0]);if (argc < 3){printHelp (argc, argv);return (-1);}// Parse the command line arguments for .pcd and .ply filesstd::vector<int> pcd_file_indices = parse_file_extension_argument (argc, argv, ".pcd");std::vector<int> ply_file_indices = parse_file_extension_argument (argc, argv, ".ply");if (pcd_file_indices.size () != 1 || ply_file_indices.size () != 1){print_error ("Need one input PLY file and one output PCD file.\n");return (-1);}// Command line parsingbool format = 1;parse_argument (argc, argv, "-format", format);print_info ("PCD output format: "); print_value ("%s\n", (format ? "binary" : "ascii"));// Load the first filepcl::PCLPointCloud2 cloud;if (!loadCloud (argv[ply_file_indices[0]], cloud)) return (-1);// Convert to PLY and savesaveCloud (argv[pcd_file_indices[0]], cloud, format);return (0);
}

2.使用深度图恢复点云

如果在有深度图的情况下,可以使用相机的内参来获取点云数据,下面是利用pcl库的简单算法(from Dominik13993)
tips数据集:
华盛顿大学300个家庭常见物体
斯坦福三维扫描数据集

//详细解释:http://www.pcl-users.org/Getting-strange-results-when-moving-from-depth-map-to-point-cloud-tt4025104.html#a4025141//core process
pointcloud.width = width;
pointcloud.height = height;
pointcloud.points.resize (pointcloud.height * pointcloud.width); int* depth_data = new int[pointcloud.height * pointcloud.width];
//copy the depth values of every pixel in here register float constant = 1.0f / 525;
register int centerX = (pointcloud.width >> 1);
int centerY = (pointcloud.height >> 1);
register int depth_idx = 0;
for (int v = -centerY; v < centerY; ++v)
{ for (register int u = -centerX; u < centerX; ++u, ++depth_idx) { pcl::PointXYZ& pt = pointcloud.points[depth_idx]; pt.z = depth_data[depth_idx] * 0.001f; pt.x = static_cast<float> (u) * pt.z * constant; pt.y = static_cast<float> (v) * pt.z * constant; }
}
pointcloud.sensor_origin_.setZero ();
pointcloud.sensor_orientation_.w () = 0.0f;
pointcloud.sensor_orientation_.x () = 1.0f;
pointcloud.sensor_orientation_.y () = 0.0f;
pointcloud.sensor_orientation_.z () = 0.0f;

3.利用渲染工具

  • Bair的Wisdom数据集,Paper
    以及DexNet数据集

    其中主要使用了三维模型和pybullet物理环境,利用虚拟相机获取深度图像集maskUserGuideP36.
  • 普利斯顿3Dvision实验室数据集
    ShapeNet
    ModelNet
    Sliding Shape
    同样是利用CAD模型生成数据集

TODO from Sharon

4.点云数据库

参考:三维点云数据集总结


icon from easyicon


ref:
pcl:http://pointclouds.org/documentation/
pcl.cn:http://www.pclcn.org
zhihu:https://www.zhihu.com/question/37577447

利用三维模型生成点云总结相关推荐

  1. PCL——从点云到网格(一)利用OpenNI2和深度相机生成点云

    最近做毕设,学习了一下PCL的使用(C++).这几篇博客就记录一下自己做毕设的时候利用深度相机得到点云,最后生成Mesh的过程.效果应该不是最好的,但是先把流程记录下来,自己下次看的时候就知道大体流程 ...

  2. Open3d利用彩色图和深度图生成点云进行室内三维重建

    上一次得到的点云图在累加多张后配准会出现少量离群的点云,效果很差,于是考虑从 ICL-NUIM dataset这个数据集获得官方的室内图进行三维重建,数据集网址如下: ICL-NUIM RGB-D B ...

  3. 既可生成点云又可生成网格的超网络方法 ICML

    点击上方"3D视觉工坊",选择"星标" 干货第一时间送达 本文发表在 ICML 2020 中,题目是Hypernetwork approach to gener ...

  4. 【BIM模型生成点云数据】revit转obj格式,全网最详细最简单的步骤了!

    最近,学习到了一种新方法,用于制作点云数据集,那就是----用BIM三维模型转obj格式之后导入到cloudcompare生成点云数据.该方式适合做仿真实验,也可以用于三维建模的精度对比. 关键性问题 ...

  5. python图像识别步骤_利用百度智能云结合Python体验图像识别(转载来自qylruirui)

    利用百度智能云结合Python体验图像识别 只要注册了百度账号就可以轻松体验百度智能云中图像识别功能的魅力! 1. 所需要的工具 一个百度账号(大家都有哈) 一个可以运行python代码的编译器(Py ...

  6. 利用matlab点云工具处理点云

    利用matlab处理点云 本文主要分享利用matlab点云工具的相关模块来处理点云,并通过点云轮廓对点云体积进行简单的估计测量. 目录 利用matlab处理点云 目录 主要的操作流程图 2具体流程 1 ...

  7. python 菜品识别_利用百度智能云结合Python体验图像识别(来自qylruirui)

    利用百度智能云结合Python体验图像识别 只要注册了百度账号就可以轻松体验百度智能云中图像识别功能的魅力! 1. 所需要的工具 一个百度账号(大家都有哈) 一个可以运行python代码的编译器(Py ...

  8. 对话即平台:利用人工智能以及云平台打造你的智能机器人

    内容来源:2017年3月11日,微软中国技术顾问佘泽鹏在"HTML5梦工场 & 微软开发者沙龙第02期--北京"进行<对话即平台:利用人工智能以及云平台打造你的智能机 ...

  9. 微信早安,利用uniCloud阿里云的云函数实现定时推送

    最近比较火的微信早安,看了一下小红书 @猪咪不是猪的教程,也动手做了一下,并做了一下实现定时的优化与符合我自己需求的修改.由于本人并不很熟悉python,所以部分修改是基于教程源码做修改的,在此也感谢 ...

最新文章

  1. cent卸载mysql_centos 7.x 安装/卸载MySQL
  2. 如何快速而准确的获取生物体的遗传信息一直是生命科学 中的一个非常重要的研究点
  3. wps office oa控件 痕迹_WPS大更新,Office的付费功能免费用,我不会是最后一个知道的吧?...
  4. android自动更新列表,Android数据库表结构自动升级
  5. 交换与路由技术课程期末上机测试题目二
  6. Matlab计算机视觉/图像处理工具箱(待续)
  7. HTML中三种定位relative,absolute,fixed后,盒子的百分比宽度及位置易错点
  8. MySQL通过命令修改密码
  9. 996 都升不了职的程序员该如何拯救?
  10. Deep Learning Tutorial - Multilayer perceptron
  11. jquery获得select option的值 和对select option的操作
  12. cad在线转换低版本_资源分享/CAD版本转换器
  13. VUE PDF上传预览下载(vue-pdf)
  14. 北京邮电大学计算机专业考研复试经验分享
  15. 【毕业设计】46-基于单片机的智能卫浴系统设计(原理图工程+仿真工程+源代码+答辩论文+答辩PPT)
  16. 国外广告联盟:玩转国外CPC网站作弊
  17. 安卓手机电池信息的获取与显示
  18. 反编译+混淆的攻守战
  19. Towards End-to-End Lane Detection: an Instance SegmentationApproach
  20. 机器学习回归之商品x的网络消费购买预测实例(sklearn)包含数据集的训练与预测

热门文章

  1. python人像精细分割_人像抠图 - 发丝级人像分割 - 照片人物特效 - 极链科技
  2. PPT模板(淘宝花钱买来的,免费分享给大家)
  3. spark-submit的使用
  4. L13操作系统之树(过程)
  5. phpcmsV9各种模板页面调用文章 hits 点击量和评论量 - 代码总结分类
  6. vuejs项目如何修改node_mudule为公用文件?
  7. js一个按钮弹出两个按钮_车内常见按钮,你却一个不认识?一分钟带你认识车内常见按钮...
  8. 搜狗输入法电脑版_搜狗输入法Mac版更新:找不到哪里下载?看这里
  9. ZYI PHP授权系统开源
  10. SkyCaiji蓝天数据采集发布系统源码v2.3