Unhandled exception at memory location in stitcher code opencv

你说的曾经没有我的故事 提交于 2019-12-25 14:02:42

问题


I am trying to debug the example for stitching images at this site.

Here is my complete code.

#include < stdio.h >  
#include < opencv2\opencv.hpp >  
#include < opencv2\stitching\stitcher.hpp >

#ifdef _DEBUG  
#pragma comment(lib, "opencv_core300d.lib")   
#pragma comment(lib, "opencv_imgproc300d.lib")   //MAT processing  
#pragma comment(lib, "opencv_highgui300d.lib")  
#pragma comment(lib, "opencv_stitching300d.lib")

#else  
#pragma comment(lib, "opencv_core300.lib")  
#pragma comment(lib, "opencv_imgproc300.lib")  
#pragma comment(lib, "opencv_highgui300.lib")  
#pragma comment(lib, "opencv_stitching300.lib")
#endif  

using namespace cv;
using namespace std;


void main()
{
    vector< Mat > vImg;
    Mat rImg;

    vImg.push_back(imread("./stitching_img/1.jpg"));
    vImg.push_back(imread("./stitching_img/2.jpg"));
    vImg.push_back(imread("./stitching_img/3.jpg"));
    vImg.push_back(imread("./stitching_img/4.jpg"));
    vImg.push_back(imread("./stitching_img/5.jpg"));
    vImg.push_back(imread("./stitching_img/6.jpg"));


    Stitcher stitcher = Stitcher::createDefault();


    unsigned long AAtime = 0, BBtime = 0; //check processing time
    AAtime = getTickCount(); //check processing time

    Stitcher::Status status = stitcher.stitch(vImg, rImg);

    BBtime = getTickCount(); //check processing time 
    printf("%.2lf sec \n", (BBtime - AAtime) / getTickFrequency()); //check processing time

    if (Stitcher::OK == status)
        imshow("Stitching Result", rImg);
    else
        printf("Stitching fail.");

    waitKey(0);

}

However I am getting an error:

First-chance exception at 0x00007FFFB36A8B9C in opencvtest1.exe: Microsoft C++ exception: cv::Exception at memory location 0x0000003F09CBD6B0. Unhandled exception at 0x00007FFFB36A8B9C in opencvtest1.exe: Microsoft C++ exception: cv::Exception at memory location 0x0000003F09CBD6B0.

I searched for unhandled exceptions but every answer suggests specific solutions to those problems so couldn't figure out what is going wrong in my particular case.

Please help me figure out what is it that I am doing wrong in the code.

来源:https://stackoverflow.com/questions/32433746/unhandled-exception-at-memory-location-in-stitcher-code-opencv

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!