我能够在网络摄像头上捕捉图像并使用 erget 的 StereoVision 库很好地校准它们。
但是,在尝试执行 tune_blockmatcher 和 images_to_pointcloud 时,我发现以下错误,因为 StereoBM 和 StereoSGBM 类无法导入。
>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'
我正在运行的操作系统是 Windows7,运行 OPENCV 3.4.0 和 Python2.7,安装了带有“pip install StereoVision”的立体视觉库
这个问题有什么解决方案吗?