title: Stitching Two Webcam Feeds Together in OpenCV
body: <p>Using the code below:</p>
  
  <pre><code>#include &lt;opencv2/opencv.hpp&gt;
  #include &lt;opencv2/stitching/stitcher.hpp&gt;
  #include &lt;iostream&gt;
  #include &lt;vector&gt;
  
  using namespace std;
  using namespace cv;
  
  int main(int argc, char *argv[])
  {
      Mat fr1, fr2, pano;
      bool try_use_gpu = false;
      vector&lt;Mat&gt; imgs;
      VideoCapture cap(0), cap2(1);
  
      while (true)
      {
          cap &gt;&gt; fr1;
          cap2 &gt;&gt; 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 &lt;&lt; "Error stitching - Code: " &lt;&lt;int(status)&lt;&lt;endl;
              return -1;
          }
  
          imshow("Frame 1", fr1);
          imshow("Frame 2", fr2);
          imshow("Stitched Image", pano);
  
          if(waitKey(30) &gt;= 0) 
              break;
      }
      return 0;
  }
  </code></pre>
  
  <p>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?</p>
  
  <p>-Tony</p>