Opencv出现错误:Unhandled exception at 0x747D3F12 in test7_1canny.exe: Microsoft C++ exception

我的程序为读取一张图片然后进行canny边缘检测,程序是书中的例程,自己拷贝过来用时出现错误,如下图所示

Opencv出现错误:Unhandled exception at 0x747D3F12 in test7_1canny.exe: Microsoft C++ exception

发现此错误后找了几个网址都没有解决,最后硬着头皮看了看英文网站的解决方法,其中有一条是看看你的图片是否正确读取,然后我顿时想到我的源文件那里没有放图片......Opencv出现错误:Unhandled exception at 0x747D3F12 in test7_1canny.exe: Microsoft C++ exception

当放上图片后就可以正常运行了,仅此献给那些暂时脑袋短路的童鞋