資源簡介
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
評論
共有 條評論