Unable to run tune_blockmatcher and image_to_pointcloud programs

允我心安 提交于 2019-12-11 04:15:26

问题


I am able to capture images on webcams and calibrate them well using StereoVision library from erget.

But, while trying for execution of tune_blockmatcher and images_to_pointcloud, i found below errors as StereoBM and StereoSGBM classes are unable to import.

>import cv2
>from stereovision.blockmatchers import StereoBM, StereoSGBM
Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
 File "C:\Python27\lib\site-packages\stereovision\blockmatchers.py", line 111,
in <module>
   class StereoBM(BlockMatcher):
 File "C:\Python27\lib\site-packages\stereovision\blockmatchers.py", line 117,
in StereoBM
   "stereo_bm_preset": cv2.STEREO_BM_NARROW_PRESET}
AttributeError: 'module' object has no attribute 'STEREO_BM_NARROW_PRESET'
>`

C:\s\StereoVision-master\stereovision>python tune_blockmatcher.py
Traceback (most recent call last):
  File "tune_blockmatcher.py", line 34, in <module>
    from stereovision.blockmatchers import StereoBM, StereoSGBM
  File "build\bdist.win-amd64\egg\stereovision\blockmatchers.py", line 111, in <
module>
    class StereoBM(BlockMatcher):
  File "build\bdist.win-amd64\egg\stereovision\blockmatchers.py", line 117, in S
tereoBM
    "stereo_bm_preset": cv2.STEREO_BM_NARROW_PRESET}
AttributeError: 'module' object has no attribute 'STEREO_BM_NARROW_PRESET'

OS i am running is Windows7, running OPENCV 3.4.0 and Python2.7, installed stereovision library with 'pip install StereoVision'

Any solution for this issue ?


回答1:


You are facing this issue because the StereoVision framework provided by Daniel Lee does not work with OpenCV 3.

First of all, uninstall OpenCV 3 from your machine.

Then install OpenCV 2 and retry: your problem will be gone.

Hope this helps



来源:https://stackoverflow.com/questions/48923084/unable-to-run-tune-blockmatcher-and-image-to-pointcloud-programs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!