from openni import openni2
import numpy as np
import cv2
def mousecallback(event,x,y,flags,param):
if event==cv2.EVENT_LBUTTONDBLCLK:
print(y, x, dpt[y,x])
if __name__ == "__main__":
openni2.initialize()
dev = openni2.Device.open_any()
print(dev.get_device_info())
depth_stream = dev.create_depth_stream()
depth_stream.start()
color_stream = dev.create_color_stream()
color_stream.start()
#cap = cv2.VideoCapture(0)
cv2.namedWindow('depth')
cv2.setMouseCallback('depth',mousecallback)
cv2.namedWindow('color')
cv2.setMouseCallback('color',mousecallback)
while True:
frame = depth_stream.read_frame()
python调用astra深度相机进行影像显示
最新推荐文章于 2024-01-02 17:44:14 发布