Using the code 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 fr1, fr2, pano;
bool try_use_gpu = false;
vector<Mat> imgs;
VideoCapture cap(0), cap2(1);
while (true)
{
cap >> fr1;
cap2 >> fr2;
imgs.push_back(fr1.clone());
imgs.push_back(fr2.clone());
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", fr1);
imshow("Frame 2", fr2);
imshow("Stitched Image", pano);
if(waitKey(30) >= 0)
break;
}
return 0;
}
This code throws a status error of 1 out there. I don't know what that means, nor do I know why this thing is having a hard time with webcam feeds. What's the matter?
-Tony