OpenNI深度图获取点云数据

最近搞了个奥比中光的深度摄像头,需要通过摄像头获取点云数据,先后查阅了很多资料。

自己写了几个功能的C++程序:

1.采集点云数据(我这里设置的是0.8米以内,具体数值可以自己更改)
2.在控制台输入!号,设置采集数据存放的根目录
3.在控制台按空格键,输入在根目录下要新建的用户文件夹
4.在控制台按回车键,保存当前点云数据
5.在depth显示窗口按Esc退出程序

/*************************
OpenNI2 Point-cloud collect program
Author: Danqing Miao, 2018.11
*************************/

#include <stdlib.h>    
#include <iostream>    
#include <string>   
#include <fstream> 
#include <direct.h>
#include "OpenNI.h"    
#include "opencv2/core/core.hpp"    
#include "opencv2/highgui/highgui.hpp"    
#include "opencv2/imgproc/imgproc.hpp"

//获取键盘输入
#include <conio.h>
#include <Windows.h>
using namespace std;
using namespace cv;
using namespace openni;
typedef struct {
	float x;
	float y;
	float z;
} vector3f;

#define SAMPLE_READ_WAI
  • 1
    点赞
  • 29
    收藏
    觉得还不错? 一键收藏
  • 12
    评论
评论 12
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值