• 大小: 1KB
    文件类型: .py
    金币: 1
    下载: 0 次
    发布日期: 2021-05-29
  • 语言: Python
  • 标签: opencv  openni  

资源简介

win10+python3环境下使用opencv调用华硕Xtion pro live深度摄像头 .详细配置教程见https://blog.csdn.net/weixin_43002202/article/details/90753992

资源截图

代码片段和文件信息

from openni import openni2
import numpy as np
import cv2

openni2.initialize()

dev = openni2.Device.open_any()
print(dev.get_device_info())

depth_stream = dev.create_depth_stream()
color_stream = dev.create_color_stream()
depth_stream.start()
color_stream.start()


while True:
    # 显示深度图
    frame = depth_stream.read_frame()
    dframe_data = np.array(frame.get_buffer_as_triplet()).reshape([240 320 2])
    dpt1 = np.asarray(dframe_data[: : 0] dtype=‘float32‘)
    dpt2 = np.asarray(dframe_data[: : 1] dtype=‘float32‘)
    dpt2 *= 25

评论

共有 条评论