我目前正在使用 d435,我想按照我的代码显示 IR 图像(左侧和右侧,但目前只关注一个):import pyrealsense2 as rsimport numpy as npimport cv2# We want the points object to be persistent so we can display the #last cloud when a frame dropspoints = rs.points()# Create a pipelinepipeline = rs.pipeline()#Create a config and configure the pipeline to streamconfig = rs.config()config.enable_stream(rs.stream.infrared, 1, 1280, 720, rs.format.y8, 30)# Start streamingprofile = pipeline.start(config)# Streaming looptry: while True: # Get frameset of color and depth frames = pipeline.wait_for_frames() ir1_frame = frames.get_infrared_frame(1) # Left IR Camera, it allows 1, 2 or no input image = np.asanyarray(ir1_frame) cv2.namedWindow('IR Example', cv2.WINDOW_AUTOSIZE) cv2.imshow('IR Example', image) key = cv2.waitKey(1) # Press esc or 'q' to close the image window if key & 0xFF == ord('q') or key == 27: cv2.destroyAllWindows() breakfinally: pipeline.stop()一切正常,直到该行:cv2.imshow('IR Example', image)我收到错误:类型错误:不支持 mat 数据类型 = 17我找到了这个链接: TypeError: src data type = 17 is not supported但我仍然不知道如何显示我的图像。有没有人有一些想法?请分享,我是opencv的新手。image.shape = ()image.dtype = dtype('O')
添加回答
举报
0/150
提交
取消