AttributeError: module ‘cv2’ has no attribute ‘createStereoBM’ – I got this error


while creating depth map I got an error that says “AttributeError: module ‘cv2’ has no attribute ‘createStereoBM'” for the following python code snippet.

import numpy as np
import cv2
left = cv2.imread('images/left.jpg',0)
right = cv2.imread('images/right.jpg',0)
stereo = cv2.createStereoBM(numDisparities=16, blockSize=15)
disparity = stereo.compute(left_image,right_image)

on line number 5.

can anyone here debug it?

Answered question

use ‘StereoBM_create’ instead of ‘createStereoBM’ line no.5 of the code will be

stereo = cv2.StereoBM_create(numDisparities=16, blockSize=15)

check here

Changed status to publish
You are viewing 1 out of 1 answers, click here to view all answers.