Stitching Two Webcam Feeds
Hello,
I'm new to OpenCV 2.4.4 and the Stitcher Module, and am struggling to get this test to work. The code is below:
#include <opencv2/opencv.hpp>
#include <opencv2/stitching/stitcher.hpp>
#include <iostream>
#include <vector>
using namespace std;
using namespace cv;
int main(int argc, char *argv[])
{
Mat frame1, frame2, pano;
bool try_use_gpu = false;
vector<Mat> imgs;
VideoCapture cap(0), cap2(1);
while (true)
{
cap >> frame1;
cap2 >> frame2;
imgs.push_back(frame1);
imgs.push_back(frame2);
Stitcher test = Stitcher::createDefault(try_use_gpu);
Stitcher::Status status = test.stitch(imgs, pano);
if (status != Stitcher::OK)
{
cout << "Error stitching - Code: " <<int(status)<<endl;
return -1;
}
imshow("Frame 1", frame1);
imshow("Frame 2", frame2);
imshow("Stitched Image", pano);
if(waitKey(30) >= 0)
break;
}
return 0;
}
I get the errors:
First-chance exception at 0x0f3c7fe7 in StitchingTest.exe: 0xC0000005: Access violation writing location 0x00000038. First-chance exception at 0x0f3c8331 in StitchingTest.exe: 0xC0000005: Access violation reading location 0x00000014. Unhandled exception at 0x0f3c8331 in StitchingTest.exe: 0xC0000005: Access violation reading location 0x00000014. The program '[8416] StitchingTest.exe: Native' has exited with code 0 (0x0)
What did I do wrong? Thanks!
-Tony
EDIT: Solved the initial error - I was missing the "d" in the stitching Linker dependency.
SECOND ERROR: The stitcher status returns 1 - what does that mean?