OpenCV Stitching, C++ - Unhandled exception [closed]

asked 2015-03-11 03:36:49 -0600

ellow7 gravatar image

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?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2020-10-22 17:01:54.058189

Comments

Could be a bug? link. Are you sure the images you imread(..) are read correctly? Just to be sure can you check that... If they are, maybe file a bug report including the images and source code here.

boaz001 gravatar imageboaz001 ( 2015-03-11 04:23:48 -0600 )edit

Im sure they are read correctly, they show up on imshow("test", imread("../../V2.bmp")); I created a bug report here.

ellow7 gravatar imageellow7 ( 2015-03-11 07:06:50 -0600 )edit