使用华硕Xtion Pro和OpenCV查看黑框而不是深度图像
See a black frame instead of a depth image with ASUS Xtion Pro and OpenCV
我实际上可以从我的华硕Xtion获得RGB图像,但无法获得任何深度图像。我看到的是黑色图像,没有出现错误。
OpenNI给出的示例SimpleView有效,所以我想它不是传感器,不是库,OpenCV似乎可以正常工作。
知道吗?
这是我的代码:
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
using namespace cv;
using namespace std;
int main( int argc, char* argv[] )
{
cout << "Device opening ..." << endl;
VideoCapture captureStream;
captureStream.open(CV_CAP_OPENNI_ASUS);
if( !captureStream.isOpened() ){
cout << "Can not open capture object." << endl;
return -1;
}
for(;;){
Mat depth;
if( !captureStream.grab() ){
cout << "ASUS Xtion can not grab images." << endl;
return -1;
}else
if( captureStream.retrieve( depth, CV_CAP_OPENNI_DEPTH_MAP) )
imshow("depth",depth);
if( waitKey( 30 ) == 27 ) break;
}
return 0;
}
谢谢!
OpenCV 示例代码实际上使用以下代码来检索和显示深度图:
Mat depth;
capture.retrieve( depth, CV_CAP_OPENNI_DEPTH_MAP )
const float scaleFactor = 0.05f;
Mat show;
depth.convertTo( show, CV_8UC1, scaleFactor );
imshow( "depth map", show );
相关文章:
- 以C++访问 HoloLens 2 深度图像
- 如何使用OpenCV同时显示"深度"和"颜色"视频图像
- OpenCV 实感 16 位深度图像
- 如何使用OPENCV C 将24位转换为8位深度PNG图像
- C 矩阵乘法 - 从深度图像中恢复3D坐标
- 如何使用opencvc++拍摄动态视频图像和深度图像
- 如何在OpenCV中对齐Kinect的RGB和深度图像
- OpenGL图像加载64位深度
- 如何将三维点云转换为深度图像
- 使用华硕Xtion Pro和OpenCV查看黑框而不是深度图像
- 从深度图像中获取3D点云
- 图像深度和通道之间的差异
- 将rgb深度图像转换为oni文件
- 有人使用kinect-v2的openNI获取了深度图像
- 绘制深度图像的直方图
- 如何使用opengl或dx从网格中生成深度(高度)图像
- 从.oni文件中获取平面图像和深度图像之间的对应关系
- 将Kinect深度图像转换为真实世界坐标
- 将 Kinect 深度图像转换为真实世界的尺寸
- 尝试从深度图像中提取手部轮廓时出现无效矩阵错误