OpenCV中的imread()读出的图形为空


vs2010中配置opencv的情况,不同的版本不一样!

debug版本下:后缀都加个d的lib

#pragma comment(lib,"opencv_core2410d.lib")
#pragma comment(lib,"opencv_highgui2410d.lib")
#pragma comment(lib,"opencv_imgproc2410d.lib")
#pragma comment(lib,"opencv_features2d2410d.lib")
#pragma comment(lib,"opencv_calib3d2410d.lib")
#pragma comment(lib,"opencv_legacy2410d.lib")

同样是lib库的版本不对问题,可能造成:
 
1.未经处理的异常
2.ntdll.dll未能加载符号

release版本的下: 后缀不加d的lib

#pragma comment(lib,"opencv_core2410.lib")
#pragma comment(lib,"opencv_highgui2410.lib")
#pragma comment(lib,"opencv_imgproc2410.lib")
#pragma comment(lib,"opencv_features2d2410.lib")
#pragma comment(lib,"opencv_calib3d2410.lib")
#pragma comment(lib,"opencv_legacy2410.lib")



实际我们在配置OpenCV环境的时候比较麻烦,建议还是使用CMake生成Visual Studio项目比较好,只需要编辑如下的CMakeLists.txt文件:

project( HelloOpenCV )

find_package( OpenCV REQUIRED )
add_executable( HelloOpenCVHelloOpenCV )
target_link_libraries(HelloOpenCV ${OpenCV_LIBS} )




你可能感兴趣的:(图像处理,计算机视觉)