无法运行tune_blockmatcher和image_to_pointcloud程序 [英] Unable to run tune_blockmatcher and image_to_pointcloud programs

查看:161
本文介绍了无法运行tune_blockmatcher和image_to_pointcloud程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我能够使用网络摄像头捕获图像并对其进行很好的校准

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

但是,在尝试执行tune_blockmatcher和images_to_pointcloud时,我发现以下错误,因为StereoBM和StereoSGBM类无法导入.

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是Windows7,运行OPENCV 3.4.0和Python2.7,并通过"pip install StereoVision"安装了立体声视觉库

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

此问题有解决方案吗?

推荐答案

您面临此问题,因为Daniel Lee提供的StereoVision框架不适用于OpenCV3.

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

首先,从您的计算机上卸载OpenCV 3.

First of all, uninstall OpenCV 3 from your machine.

然后安装OpenCV 2并重试:您的问题将消失.

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

希望这对您有帮助

这篇关于无法运行tune_blockmatcher和image_to_pointcloud程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆