Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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?