I am collecting disparity frames using the gen2-collecting-training-data and using subpixel modeand median filter. Any idea how I can calculate depth from this? The results I am getting for depth do not correlate to the data being collected
This is how I am collecting the disparity frames:
"disparity": lambda item: cv2.applyColorMap((item.getFrame() / 11.921568627 ).astype(np.uint8), cv2.COLORMAP_JET)
This is how I am calculating the depth from the disparity frames
disparity_map = disparity_dai
focal = disparity_map.shape[1] / (2. * math.tan(math.radians(fov / 2)))
depthScaleFactor = baseline * focal
depthFrame_dai = (depthScaleFactor / disparity_map).astype(np.uint8)
depth_map = disparity_map