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

0

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)
cv2.imshow(disparity)

on line number 5.

can anyone here debug it?

Answered question
1

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

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

check here https://blog.raabnits.com/computer-science/101/create-depth-map-from-stereo-images-implemented-using-python/

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