你好stackoverflow社区:)
我需要帮助。我在python网站上编写了一个简单的程序,当我运行这个程序时,它会说:
重要错误:没有名为cv2的模块import cv2
import numpy as np
#read image into matrix.
m = cv2.imread("python.png")
#get image properties.
w,h,bpp = np.shape(m)
#print image properties.
print "width: " + str(w)
print "height: " + str(h)
print "bpp: " + str(bpp)
我已经试过安装openCV,但似乎没有正确安装,这是我安装它所遵循的教程。当我试图安装依赖项时,它说:E:Package 'libtbb-dev' has no installation candidate
E: unable to locate package libfaac-dev
我忽略了那个包,进入下一步(下载openCV 2.4.9)。
当我试图使用cmake生成Makefile时,我得到了下一个警告Could not find a package configuration file provided by "Qt5Core" with any of the following names:
Qt5CoreConfig.cmake
qt5core-config.cmake
Add the installation prefix of "Qt5Core" to CMAKE_PREFIX_PATH or set "Qt5Core_DIR" to a directory containing one of the above files. If "Qt5Core" provides a separate development package or SDK, be sure it has been installed.
Call Stack (most recent call first)
CMakeLists.txt:466 (include)
下一个包也是如此:Qt5GuiConfig.cmake网站
qt5gui-config.cmake网站
Qt5WidgetsConfig.cmake网站
qt5widgets-config.cmake软件
Qt5TestConfig.cmake测试配置
qt5test-config.cmake测试
qt5当前配置.cmake
qt5当前配置.cmake
最后这个错误出现了:CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:97 (MESSAGE):
Could NOT find Qt4 (missing: QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE
QT_RCC_EXECUTABLE QT_INCLUDE_DIR QT_LIBRARY_DIR QT_QTCORE_INCLUDE_DIR
QT_QTCORE_LIBRARY QT_QTGUI_INCLUDE_DIR QT_QTGUI_LIBRARY
QT_QTTEST_INCLUDE_DIR QT_QTTEST_LIBRARY QT_UIC_EXECUTABLE)
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:288 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-2.8/Modules/FindQt4.cmake:1200 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
cmake/OpenCVFindLibsGUI.cmake:34 (find_package)
CMakeLists.txt:466 (include)
我已经搜索了所有的文件系统,但是找不到上面的文件。我还看到,如果出了什么问题,我必须返回,通过安装额外的包来纠正错误,然后再次运行cmake。但是,如何安装这些额外的软件包呢?
我运行了下一个命令,所有库都已安装并更新到最新版本。sudo apt-get update
sudo apt-get updgrade
sudo apt-get install libopencv-dev
sudo apt-get install python-opencv
有人能帮助我得到一个可用的OpenCV安装尽可能简单。我真的很感激。我被困在这个项目里了。
另外,我也找不到一个cv2.so文件我到处搜索。。。我使用了下一个命令:sudo find/name "cv2*"
谢谢你。