神经辅助立体匹配
Supported on:RVC4

源代码
Python
PythonGitHub
1import cv2 as cv
2import depthai as dai
3
4FPS = 20
5
6if __name__ == "__main__":
7 device = dai.Device()
8 pipeline = dai.Pipeline(device)
9 if not device.isNeuralDepthSupported():
10 print("Exiting NeuralAssistedStereo example: device doesn't support NeuralDepth.")
11 exit()
12
13 monoLeft = pipeline.create(dai.node.Camera).build(dai.CameraBoardSocket.CAM_B, sensorFps=FPS)
14 monoRight = pipeline.create(dai.node.Camera).build(dai.CameraBoardSocket.CAM_C, sensorFps=FPS)
15
16 monoLeftOut = monoLeft.requestFullResolutionOutput()
17 monoRightOut = monoRight.requestFullResolutionOutput()
18
19 neuralAssistedStereo = pipeline.create(dai.node.NeuralAssistedStereo).build(monoLeftOut, monoRightOut, neuralModel=dai.DeviceModelZoo.NEURAL_DEPTH_NANO)
20
21 depthQueue = neuralAssistedStereo.depth.createOutputQueue()
22
23 with pipeline:
24 pipeline.start()
25 while pipeline.isRunning():
26 depth = depthQueue.get()
27 cv.imshow("Depth", dai.utility.colorizeDepthFrame(depth, 500, 12000, cv.COLORMAP_TURBO, useLog=True).getCvFrame())
28
29 key = cv.waitKey(1)
30 if key == ord('q'):
31 quit()需要帮助?
请前往 OAKChina 官网 获取技术支持或解答您的任何疑问。