Hello,
I'm trying to add depth data to the mjpeg_streaming_wifi example.
#Stereo3D
monoLeft = pipeline.create(dai.node.MonoCamera)
monoRight = pipeline.create(dai.node.MonoCamera)
depth = pipeline.create(dai.node.StereoDepth)
depthSPI = pipeline.create(dai.node.SPIOut)
depthSPI.setStreamName("depthSPI")
# Properties of stereo
monoLeft.setResolution(dai.MonoCameraProperties.SensorResolution.THE_400_P)
monoLeft.setBoardSocket(dai.CameraBoardSocket.LEFT)
monoRight.setResolution(dai.MonoCameraProperties.SensorResolution.THE_400_P)
monoRight.setBoardSocket(dai.CameraBoardSocket.RIGHT)
# Create a node that will produce the depth map (using disparity output as it's easier to visualize depth this way)
depth.setDefaultProfilePreset(dai.node.StereoDepth.PresetMode.HIGH_DENSITY)
# Options: MEDIAN_OFF, KERNEL_3x3, KERNEL_5x5, KERNEL_7x7 (default)
depth.initialConfig.setMedianFilter(dai.MedianFilter.KERNEL_3x3)
depth.setLeftRightCheck(lr_check)
depth.setExtendedDisparity(extended_disparity)
depth.setSubpixel(subpixel)
_The information i need is pretty simple like in the depth_preview example:_
q = device.getOutputQueue(name="disparity", maxSize=4, blocking=False)
inDisparity = q.get() # blocking call, will wait until a new data has arrived
frame = inDisparity.getFrame()
**frame = (frame * (255 / depth.initialConfig.getMaxDisparity())).astype(np.uint8)**
But I'm struggling a bit whats the best way to send the so called "frame" data here. Also how to change the main.cpp and file_server.cpp for the esp32.
Is there an other example? Or do you have any suggestions?