简体   繁体   中英

OpenCV Stitching, C++ - Unhandled exception

Im trying to stitch three images together. To do this, I chose OpenCV 2.4.10 and Microsoft Visual C++ 2010 Express.
The Images are 1500x1500px and in CV_8UC3 when read.
Im building for 32bit and already got a few other things working with OpenCV, so I guess the project is set up correctly with paths etc..

The odd thing is, that I get this error only sometimes , and only if I try to stitch more than two images .

Here the error message:

Unhandled exception at 0x5841dcaa in Stitching Test.exe: 0xC0000005: Access violation reading location 0x00000004.

After that I get automatically to line 99 of "Chores.cpp" or line 189 of "TaskCollection.cpp", so i think thats the source of the error. (Path C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\crt\\src)

And here the code:

#include <iostream>

//OPENCV
#include <opencv2\core\core.hpp>
#include <opencv2\highgui\highgui.hpp>
#include <opencv2\imgproc\imgproc.hpp>
//OPENCV STITCHING
#include <opencv2\stitching\stitcher.hpp>

using namespace std;
using namespace cv;

int main(){
    Mat panoramaImage;
    vector<Mat> inputImages;

    inputImages.push_back(imread("../../V1.bmp"));
    inputImages.push_back(imread("../../V2.bmp"));
    inputImages.push_back(imread("../../V3.bmp"));

    Stitcher stitcher = Stitcher::createDefault();
    Stitcher::Status stitcherStatus = stitcher.stitch(inputImages, panoramaImage);

    imshow("Stitching Result", panoramaImage); 
    waitKey(0);

    return 0;
}

Someone got a suggestion?

Issue solved - I found out that I had "_DEBUG;" in my preprocessor definitions while running on release. Still very odd that the error only occured sometimes...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM