我试图建立这个立体视觉障碍的距离检测系统使用的教程,但不断击中砖墙,可以使用一些建议,请。
在运行disparity2depth或回避文件时,我在两个纠偏 线条上都会得到相同的xml文件读取错误和重新映射错误。
\[error:0@2.333\] global D:\\a\\opencv-python\\opencv-python\\opencv\\modules\\core\\src\\persistence.cpp (505) cv::FileStorage::Impl::open Can't open file: '../data/stereo_rectify_maps
.xml' in read mode
\[error:0@2.336\] global D:\\a\\opencv-python\\opencv-python\\opencv\\modules\\core\\src\\persistence.cpp (505) cv::FileStorage::Impl::open Can't open file: '../data/depth_estimation_pa
rams_py.xml' in read mode
Traceback (most recent call last):
File "C:\\Users\\XXXXXXXXXX\\ObstacleAvoidSystem\\Depth-Perception-Using-Stereo-Camera\\disparity2depth_calib.py", line 84, in \<module\>
Left_nice= cv2.remap(imgL_gray,
cv2.error: OpenCV(4.6.0) D:\\a\\opencv-python\\opencv-python\\opencv\\modules\\imgproc\\src\\imgwarp.cpp:1703: error: (-215:Assertion failed) !\_map1.empty() in function 'cv::remap'尝试了不同的cv2.FileStorage.open (文件名、标志),但返回了类似的错误。在写模式下打开也会返回类似的错误(如上面所示)。
我还通过研究类似的(间接)错误(例如这一个 )尝试了完整的目录路径,并得到了以下错误:
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
如有任何建议,将不胜感激!
发布于 2022-11-09 09:09:49
问题在于妇女发展委员会。
assert os.path.exists("data/stereo_rectify_maps.xml"), os.getcwd()
解决了这个问题。一开始,该语句没有传递/返回任何内容,这使我认为该文件可能已损坏。但是,在重新加载IDE并再次运行之后,该语句返回它正在寻找的路径。
https://stackoverflow.com/questions/74258524
复制相似问题