Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

the images from your camera are uint8, too, but they are in color (3 channels), while you need grayscale (1 channel) images for the block matching. use cvtColor for the conversion:

# help(cv2.cvtColor)
gray1 = cv2.cvtColor(frame1, cv2.COLOR_BGR2GRAY)
gray2 = cv2.cvtColor(frame2, cv2.COLOR_BGR2GRAY)
disparity = stereo.compute(gray1, gray2)