I need to derive disparity map from two images. I am using Python3.7 on Win10, PyCharm, and opencv-python=4.5.1.48. The following is my code.
import cv2
image_file1 = r'cam1.jpg'
image_file2 = r'cam2.jpg'
image_left = cv2.imread(image_file1, 0)
image_right = cv2.imread(image_file2, 0)
image_left = cv2.resize(image_left, (0,0), fx=0.25, fy=0.25)
image_right = cv2.resize(image_right, (0,0), fx=0.25, fy=0.25)
stereo = cv2.StereoBM(numDisparities=16, blockSize=15)
disparity = stereo.compute(image_left,image_right)
However, I got no result, and only the information as following:
Process finished with exit code -1073741819 (0xC0000005).
No error information, and no exception information. Can anybody help me on this? Thank you very much.