OpenCV新手调试出现的两个常见的报错

OpenCV新手调试出现的两个常见的报错

	基本的OpenCV2.4+VS配置可自行搜索,下面是配置好了后运行报错的几个情况:
1.由于图片路径错误报错,显示:

0x000007FEFD3AA06D 处(位于 CV_Test1.exe 中)有未经处理的异常: Microsoft C++ 异常: cv::Exception,位于内存位置 0x00000000002CF6A0 处。
OpenCV新手调试出现的两个常见的报错_第1张图片
此处解决办法是将图片放到main.cpp所在目录下在运行程序即可。

2.由于连接器->输入->附加依赖项配置错误导致报错:
常见报错为找不到xxx.dll.此处要配置正确的lib文件。

OpenCV新手调试出现的两个常见的报错_第2张图片
比如OpenCV2.4.13版本的debug模式附加依赖项为
opencv_ml2413d.lib
opencv_calib3d2413d.lib
opencv_contrib2413d.lib
opencv_core2413d.lib
opencv_features2d2413d.lib
opencv_flann2413d.lib
opencv_gpu2413d.lib
opencv_highgui2413d.lib
opencv_imgproc2413d.lib
opencv_legacy2413d.lib
opencv_objdetect2413d.lib
opencv_ts2413d.lib
opencv_video2413d.lib
opencv_nonfree2413d.lib
opencv_ocl2413d.lib
opencv_photo2413d.lib
opencv_stitching2413d.lib
opencv_superres2413d.lib
opencv_videostab2413d.lib

2.4.8版本的debug模式配置的附加依赖项为:
opencv_ml248d.lib
opencv_calib3d248d.lib
opencv_contrib248d.lib
opencv_core248d.lib
opencv_features2d248d.lib
opencv_flann248d.lib
opencv_gpu248d.lib
opencv_highgui248d.lib
opencv_imgproc248d.lib
opencv_legacy248d.lib
opencv_objdetect248d.lib
opencv_ts248d.lib
opencv_video248d.lib
opencv_nonfree248d.lib
opencv_ocl248d.lib
opencv_photo248d.lib
opencv_stitching248d.lib
opencv_superres248d.lib
opencv_videostab248d.lib

其规律就是2413d.lib表示2.4.13版本的debug库,248d.lib表示2.4.8版本的debug库。带d的表示debug版本,不带d的为release版本的库。

你可能感兴趣的:(OpenCV,图像处理)