【发布时间】:2018-02-20 13:10:49
【问题描述】:
我正在我的Ubuntu14.04机器上的PycharmCE2017中构建一个基于python3.4和opencv3.0的项目。运行下面的代码时,
import cv2
if __name__ == "__main__":
savePath = "/home/s/Desktop/Imgcov/"
filename = savePath + "depth.xml"
fs = cv2.FileStorage(filename, cv2.FILE_STORAGE_READ)
matrix = fs.getNode("data")
我得到错误:
AttributeError: 'cv2.FileStorage' object has no attribute 'getNode'
我该如何解决这个问题?任何提示表示赞赏。
【问题讨论】:
-
试试
fs['data'],或查看here -
不幸的是,错误变成了
TypeError: 'cv2.FileStorage' object is not subscriptable。我会查看您发布的链接。谢谢,@Miki -
AttributeError已随着 opencv-python 软件包的安装而被删除。但是,运行示例代码后,matrix为空。
标签: python-3.x opencv3.0