通过kinect实现3d扫描建立打印模型(processing、skanect、ReconstructMe)
http://www.sigvc.org/bbs/thread-722-1-1.html
在本文中将详细梳理使用Kinect进行3d扫描的过程,一共包含3种实现方法:processing编程实现、skanect软件实现、ReconstructMe软件实现。RecontructMe只能基于32位系统的驱动与kinect连接,而skanect与processing不论是32位还是64位都可以较好的兼容。
Comparison of ReconstructMe, KinectFusion and Skanect:
我们首先来看ReconstructMe:
ReconstructMe是基于32位系统的,但是在64位操作系统下仍旧使用32位的kinect驱动以及ReconstructMe。
ReconstructMe官方网址:http://reconstructme.net/
官网中针对不同的用户,有免费版以及收费版两种软件,具体下载地址为:http://reconstructme.net/projects/reconstructme-console/
下载完成以后,先不要安装,在安装ReconstructMe之前我们首先需要安装Kinect的驱动,具体步骤如下:
- 下载32位openni驱动包,下载地址:
Dropbox下载地址:
https://www.dropbox.com/s/n55mr8q1j0nzyru/Sensor%20Driver%20Package%
20×86%201.5.2.zip
坚果云下载地址:
https://jianguoyun.com/c/pubfile/uGqA8e_Y18lRqUluPrFMdXnCzq3o0ko9_Eh_5yDu-3U
2.解压驱动包,首先安装OpenNI,再然后是SensorKinect,然后是SensorPrimesense。(在安装之前,一定要把原来kinect的驱动卸载掉)
3.全部安装完成以后,重启
4.将你的Kinect连接上电脑,可以通过查看控制面板中的设备管理器,检查你的电脑是否已 经识别Kinect.
5.确认Kinect已经能和电脑通信之后,安装下载好的ReconstructMe,安装完以后运行目录中的Start ReconstructMe Scan OpenNI.bat,注意不是ReconstructMe.exe。然后根据提示进行操作即可
附图:
接下来是通过skanect进行3d扫描 :
Skanect官方网址: http://skanect.manctl.com
下载地址: http://manctl.com/products.html (页面中含有详细的安装步骤,但是一些链接已经失效,在后面的安装步骤中含有其他下载链接)
详细安装步骤:
- 下载skanect
- 下载kinect驱动包:
Dropbox下载地址:
https://www.dropbox.com/s/734160v5imqyd5d/kinect%20driver%20package%20for%2064bit.zip
坚果云下载地址:
https://jianguoyun.com/c/pubfile/sm_vNwOtndapU8ya3p46l6BXj-ujPkDmnt7JrTnhjoc
3. 下载完驱动包以后,首先安装OpenNI,然后是NITE,再然后是sensor(此文件也就是Primesense),最后是SensorKinect.
4.把kinect通过USB连接到电脑,检查控制面板中的设备管理器,判断是否已经连接成功。
5.安装skanect并运行skanect.exe
( 备注 :
1. 若基于32位操作系统,当使用skanect应下载之前ReconstructMe的所需的驱动,并附加NITE(具体安装顺序如上所示):
dropbox下载: https://www.dropbox.com/s/alvz98xzchlhlqj/NITE-Win32-1.5.2.21-Dev.zip
坚果云下载:
https://jianguoyun.com/c/pubfile/pw4suN5cAEsSIyTDyMGLaoAIw3Dfc6baECBR_1udBkY
2. 若运行skanect时,提示未查找到openni.dll则需根据你安装的目录找到openni.dll并复制到system32中!)
附图:
最后一种方法是通过processing编程实现 ,对于使用过Processing或者java的人比较适用。虽然自己之前没有接触过java,但还是尝试了一下,欢迎大家一起折腾,具体步骤:
- 首先还是需要安装Kinect的驱动(本人亲测为安装64位的驱动,如果你使用的操作系统是32位的还需安装NITE,因为后面调用processing库是需使用到)
- Processing的simple-openni库下载及安装:
http://code.google.com/p/simple-openni/downloads/list
(木有接触过processing的,百度一下即可找到,下载该软件并根据官网指示了解如何安装库文件)
3.Coding!
Processing代码:
- import processing.opengl.*;
- import SimpleOpenNI.*;
- import kinectOrbit.*;
- KinectOrbit myOrbit;
- SimpleOpenNI kinect;
- String turnTableAngle = "0";
- ArrayList scanPoints = new ArrayList(); // PointCloud
- ArrayList scanColors = new ArrayList(); // Object Colors
- ArrayList objectPoints = new ArrayList(); // PointCloud
- ArrayList objectColors = new ArrayList(); // Object Colors
- float baseHeight = ; // Height of the Model's base//1
- float modelWidth = ;//2
- float modelHeight = ;//3
- PVector axis = new PVector(0, baseHeight, );//4
- int scanLines = 200;
- int scanRes = 1;
- float[] shotNumber = new float[3];
- int currentShot = 0;
- public void setup()
- {
- size(800, 600, OPENGL);
- // Orbit
- myOrbit = new KinectOrbit(this, 0, "kinect");
- myOrbit.drawCS(true);
- myOrbit.drawGizmo(true);
- myOrbit.setCSScale( );//5
- myOrbit.drawGround(true);
- // Simple-openni
- kinect = new SimpleOpenNI(this);
- kinect.setMirror(false);
- kinect.enableDepth();
- kinect.enableRGB();
- kinect.alternativeViewPointDepthToImage();
- for (int i = 0; i < shotNumber.length; i++)
- {
- shotNumber<i> = i * (2 * PI) / shotNumber.length;
- }
- }
- public void draw()
- {
- kinect.update(); // Update Kinect data
- background(0);
- myOrbit.pushOrbit(this); // Start Orbiting
- drawPointCloud(5);
- updateObject(scanLines, scanRes);
- if(currentShot>0&¤tShot<4)
- {
- scan();
- }
- drawObjects();
- drawBoundingBox(); // Draw Box Around Scanned Objects
- kinect.drawCamFrustum(); // Draw the Kinect cam
- myOrbit.popOrbit(this); // Stop Orbiting
- }
- void drawPointCloud(int steps)
- {
- // draw the 3D point depth map
- int index;
- PVector realWorldPoint;
- stroke(255);
- for (int y = 0; y < kinect.depthHeight(); y += steps)
- {
- for (int x = 0; x < kinect.depthWidth(); x += steps)
- {
- index = x + y * kinect.depthWidth();
- realWorldPoint = kinect.depthMapRealWorld()[index];
- stroke(150);
- point(realWorldPoint.x, realWorldPoint.y, realWorldPoint.z);
- }
- }
- }
- void drawObjects()
- {
- pushStyle();
- strokeWeight(4);
- for (int i = 1; i < objectPoints.size(); i++)
- {
- stroke(objectColors.get(i).x, objectColors.get(i).y, objectColors.get(i).z);
- point(objectPoints.get(i).x, objectPoints.get(i).y, objectPoints.get(i).z + axis.z);
- }
- for (int i = 1; i < scanPoints.size(); i++)
- {
- stroke(scanColors.get(i).x, scanColors.get(i).y, scanColors.get(i).z);
- point(scanPoints.get(i).x, scanPoints.get(i).y, scanPoints.get(i).z + axis.z);
- }
- popStyle();
- }
- void drawBoundingBox()
- {
- stroke(255, 0, 0);
- line(axis.x, axis.y, axis.z, axis.x, axis.y + 100, axis.z);
- noFill();
- pushMatrix();
- translate(axis.x, axis.x + baseHeight + modelHeight / 2, axis.z);
- box(modelWidth, modelHeight, modelWidth);
- popMatrix();
- }
- void scan()
- {
- for (PVector v : scanPoints)
- {
- boolean newPoint = true;
- for (PVector w : objectPoints)
- {
- if (v.dist(w) < 1)
- newPoint = false;
- }
- if (newPoint)
- {
- objectPoints.add(v.get());
- int index = scanPoints.indexOf(v);
- objectColors.add(scanColors.get(index).get());
- }
- }
- }
- void updateObject(int scanWidth, int step)
- {
- int index;
- PVector realWorldPoint;
- scanPoints.clear();
- scanColors.clear();
- float angle=(currentShot-1)*2*PI/3;
- rotateY(angle);
- line(0,0,100,0);//draw a line at the base of the bounding box to indicate the rotation
- int xMin = (int) (kinect.depthWidth() / 2 - scanWidth / 2);
- int xMax = (int) (kinect.depthWidth() / 2 + scanWidth / 2);
- for (int y = 0; y < kinect.depthHeight(); y += step)
- {
- for (int x = xMin; x < xMax; x += step)
- {
- index = x + (y * kinect.depthWidth());
- realWorldPoint = kinect.depthMapRealWorld()[index];
- color pointCol = kinect.rgbImage().pixels[index];
- if (realWorldPoint.y < modelHeight + baseHeight && realWorldPoint.y > baseHeight)
- {
- if (abs(realWorldPoint.x - axis.x) < modelWidth / 2)
- { // Check x
- if (realWorldPoint.z < axis.z + modelWidth / 2 && realWorldPoint.z > axis.z -modelWidth / 2)
- { // Check z
- PVector rotatedPoint;
- realWorldPoint.z -= axis.z;
- realWorldPoint.x -= axis.x;
- rotatedPoint = vecRotY(realWorldPoint, angle);
- scanPoints.add(rotatedPoint.get());
- scanColors.add(new PVector(red(pointCol), green(pointCol), blue(pointCol)));
- }
- }
- }
- }
- }
- }
- PVector vecRotY(PVector vecIn, float phi)
- {
- // Rotate the vector around the y-axis
- PVector rotatedVec = new PVector();
- rotatedVec.x = vecIn.x * cos(phi) - vecIn.z * sin(phi);
- rotatedVec.z = vecIn.x * sin(phi) + vecIn.z * cos(phi);
- rotatedVec.y = vecIn.y;
- return rotatedVec;
- }
- public void keyPressed() {
- switch(key)
- {
- case 's':
- currentShot++;
- break;
- case 'c': // Clear the object points
- objectPoints.clear();
- objectColors.clear();
- currentshot=0;
- break;
- case 'e': // Export the object points
- exportPly('0');
- break;
- case '+': // Increment the number of scanned lines
- scanLines++;
- println(scanLines);
- break;
- case '-': // Decrease the number of scanned lines
- scanLines--;
- println(scanLines);
- break;
- }
- }
代码下载地址:
Dropbox下载:https://www.dropbox.com/s/90fttmvheag2k2r/scan.pde
坚果云下载:https://jianguoyun.com/c/pubfile/GHAf-ZzTMjgr1KNNinHgpWf7QKdTmBu2Z-2SIU_YbE8
收工!
通过kinect实现3d扫描建立打印模型(processing、skanect、ReconstructMe)相关推荐
- kinect fusion 3D扫描
原文连接:http://www.zhaochao.net/index.php/2016/01/14/11/ kinect fusion 3D扫描 1.先看3D扫描效果图 2.环境要求 Kinect F ...
- 3D建模,打印正当时
昨天参观了一家做牙齿的工厂,用3D扫描建立牙齿模型,然后利用3D打印来打印出牙模,后面的工艺当然还是传统的,但行业中走在前面的已经开始根据口腔扫描然后直接打印牙齿.不过在工业化路上,这种直接打印牙齿还 ...
- diy作品——3D扫描+打印
临毕业了,将大学7年的diy整理下,纪念这段时光.这是本人去年6-7月的作品,基于xilinx公司zynq芯片 的3d扫描和打印.物体处于一个步进电机控制的旋转平台上,采用线激光扫到物体表面,然后用加 ...
- 谷歌公布13GB 3D扫描数据集:17大类、1030个家用物品
来源丨机器之心 编辑丨极市平台 近年来,深度学习技术使得计算机视觉和机器人领域的许多进展成为可能,但训练深度模型需要各种各样的输入,以泛化到新的场景. 此前,计算机视觉领域已经利用网页抓取技术收集了数 ...
- 谷歌开源GSO:3D扫描数据集:17大类、1030个家用物品、13GB
点击下方卡片,关注"CVer"公众号 AI/CV重磅干货,第一时间送达 作者:Laura Downs等 转载自:机器之心编译 | 编辑:蛋酱.泽南 谷歌的研究者提出了 Goog ...
- 三维重构 c++_桐柏3d打印模型生产厂家【博通三维】-博通三维
桐柏3d打印模型生产厂家[博通三维] 无锡博通三维科技有限公司是一家依逆向工程为主要综合性设计公司,公司服务项目有产品工业设计.蓝光三维扫描.激光抄数.零部件微细度检测.产品复杂曲面C检测.规格零部件 ...
- 3D打印与3D扫描的未来在哪里
作为一个程序员应该对新技术有所追求,现在3D打印与3D扫描技术发展飞速,所以决定取了解一些.使用建模工具是CATIA.CATIA v5r20是法国达索公司推出的一款CAD/CAE/CAM一体化软件,该 ...
- solidworks工具集_【第1975期】SolidWorks!从3D扫描到3D打印的一站式设计工具
SolidWorks!从3D扫描到3D打印的一站式设计工具 针对SolidWorks用户群,3D Systems公司专门开发了两款定制软件:Geomagic for SolidWorks逆向设计和3D ...
- three.js制作3d模型工具_浙江3D打印模型制作收费标准▁来图定制
河南万润增材智造有限公司旨在工业三维打印领域改变人类的工作方式和设计理念,为全国各大地区提供3D打印设备及3D打印服务,上海.天津.北京.重庆.海南省.浙江省.江苏省等地都有我们的合作伙伴. 在日新月 ...
最新文章
- 22 岁专访库克、B 站 3 天涨粉百万,他将毕设树莓派扫描仪升级,繁星散落在校空!...
- Windows server 2008 处理多用户在登陆时显示问题
- C# 中几个关键词的使用
- 物料编码原则外部分配还是内部分配
- pyspark intersection代码示例
- Tcp连接arp协议详解
- springboot ajax返回html
- fx 线程 弹窗_JFXPanel和FX Platform线程陷阱
- 拼多多市值一夜蒸发759亿元,黄峥丝毫不慌...
- 设计师作品交流社区,让你的原创设计作品展示给世界
- 性能测试之JMeter接口关联【JSON提取器】详解
- 更新了 pe_xscan 和 ClosePc
- QAM调制 - IQ正交调制及星座图
- [SUCTF 2019]EasyWeb 1
- 计算机显示无法格式化,电脑提示windows无法完成格式化怎么办
- 计算机网络:常见的网络拓扑结构
- iOS内存扫描工具实现
- [渝粤教育] 中国地质大学 人力资源开发与管理 复习题 (2)
- 甘特图模板--项目管理模板
- 哪位有利用matlab中的s函数编写的光伏系统mppt仿真程序,Simulink的MPPT的S函数程序...