Home > Software engineering >  Stitching stitcher a result is empty???????
Stitching stitcher a result is empty???????

Time:10-16

# include & lt; Iostream>
# include & lt; Opencv2/core/core. Hpp>
# include & lt; Opencv2 highgui/highgui. Hpp>
# include & lt; Opencv2 imgproc/imgproc. Hpp>
# include & lt; Opencv2/stitching/stitcher. Hpp>
using namespace std;
Using the namespace CV;
Bool try_use_gpu=false;
Vector Imgs;
String result_name="dst1. JPG";
Int main (int arg c, char * argv [])
{
Cout & lt; Double t=(double) getTickCount ();
Mat img1=imread (" 11. BMP ");
Mat img2=imread (" 22. BMP ");

Imshow (" p1 "img1);
Imshow (" p2 ", img2);

Imgs. Push_back (img1);
Imgs. Push_back (img2);

Stitcher Stitcher=Stitcher: : createDefault (try_use_gpu);
//use stitch functions for Mosaic
Mat pano;
Stitcher: : the Status Status=Stitcher. Stitch (imgs, pano);
If (pano. Empty ())
Cout & lt; <"Kong" & lt;

Mat pano2=pano. Clone ();
//display the source images, and the result image

if (! Pano2. Empty ()) {
Imshow (" game ", pano2);
}


T=((double) getTickCount () - t)/getTickFrequency ();
Cout & lt; <"Time:" & lt; WaitKey (0);
return 0;
}


Every time to enter
If (pano. Empty ())
Cout & lt; <"Kong" & lt; Inside, this why??

CodePudding user response:

The image is loaded successfully?
https://blog.csdn.net/dcrmg/article/details/52653366

CodePudding user response:

reference 1st floor zgl7903 response:
image loaded successfully?
https://blog.csdn.net/dcrmg/article/details/52653366

Image loaded successfully, a separate imshow read the pictures, the display is normal
  • Related