Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

get this error " error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow' " while implementing image stitching

int main() 
  {
try
{
    bool try_use_gpu = false;
    vector<Mat>imgs; 
    Mat pano;
    imgs.push_back(imread("newyork1.jpg"));
    imgs.push_back(imread("newyork2.jpg"));

    //Stitcher::Mode mode = Stitcher::PANORAMA;
    //Ptr<Stitcher> stitcher = Stitcher::create(mode, try_use_gpu);
    Stitcher stitcher = Stitcher::createDefault(try_use_gpu);
    Stitcher::Status status = stitcher.stitch(imgs, pano);

    if (status != Stitcher::OK)
      cout << "Panorama unsuccessful" << endl;
    else {
    imshow("panorama", pano);
    waitKey(0);
    imwrite("panoramaimg.jpg", pano);
        return 0;
    }

i think there might be a problem with my image , any help pls

get this error " error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow' " while implementing image stitching

int main() { try { bool try_use_gpu = false; vector<mat>imgs; Mat pano; imgs.push_back(imread("newyork1.jpg")); imgs.push_back(imread("newyork2.jpg"));

int main() 
  {
try
{
    bool try_use_gpu = false;
    vector<Mat>imgs; 
    Mat pano;
    imgs.push_back(imread("newyork1.jpg"));
    imgs.push_back(imread("newyork2.jpg"));

    //Stitcher::Mode mode = Stitcher::PANORAMA;
    //Ptr<Stitcher> stitcher = Stitcher::create(mode, try_use_gpu);
    Stitcher stitcher = Stitcher::createDefault(try_use_gpu);
    Stitcher::Status status = stitcher.stitch(imgs, pano);

    if (status != Stitcher::OK)
      cout << "Panorama unsuccessful" << endl;
    else {
    imshow("panorama", pano);
    waitKey(0);
    imwrite("panoramaimg.jpg", pano);
        return 0;
    }

i think there might be a problem with my image , any help pls

image description

image description