AttributeError: module 'cv2.cv2' has no attribute 'STEREO_BM_NARROW_PRESET'

Hi

I am trying to get this tool running:

When I try to execute the script I get an error on Windows:

C:\Users\mikh2\AppData\Local\Programs\Python\Python39\Scripts>python tune_blockmatcher --help
Traceback (most recent call last):
  File "C:\Users\mikh2\AppData\Local\Programs\Python\Python39\Scripts\tune_blockmatcher", line 34, in <module>
    from stereovision.blockmatchers import StereoBM, StereoSGBM
  File "C:\Users\mikh2\AppData\Local\Programs\Python\Python39\lib\site-packages\stereovision\blockmatchers.py", line 111, in <module>
    class StereoBM(BlockMatcher):
  File "C:\Users\mikh2\AppData\Local\Programs\Python\Python39\lib\site-packages\stereovision\blockmatchers.py", line 117, in StereoBM
    "stereo_bm_preset": cv2.STEREO_BM_NARROW_PRESET}
AttributeError: module 'cv2.cv2' has no attribute 'STEREO_BM_NARROW_PRESET'

This tool is over 5 years old. Have the dependencies changed in the meantime? Can I fix this? Or do I need to revert to an older version of OpenCV or Python? Thanks.

Hi,
that’s opencv2 I think
read this link

Okay, thanks.

How do I revert to an older version of OpenCV? I’m not sure how to uninstall Python packages, or how to install alternate packages.

You can find old release on github Releases · opencv/opencv · GitHub