Ask Your Question

Revision history [back]

this code works with my image :

    vector<Mat> imgs;
    Mat img = imread("f:/images/pano/pano1.jpg");
    if (img.empty())
    {
        cout << "Check image path";
        return -1;
    }
    imgs.push_back(img);
    img = imread("f:/images/pano/pano2.jpg");
    if (img.empty())
    {
        cout << "Check image path";
        return -1;
    }
    imgs.push_back(img);

    Mat pano;
    Ptr<Stitcher> stitcher = Stitcher::create();
    Stitcher::Status status = stitcher->stitch(imgs, pano);

    if (status != Stitcher::OK)
    {
        cout << "Can't stitch images, error code = " << int(status) << endl;
        return EXIT_FAILURE;
    }
    //![stitching]
    imshow("r", pano);
    waitKey();

you can find a full example here

this code works with my image :

    vector<Mat> imgs;
    Mat img = imread("f:/images/pano/pano1.jpg");
    if (img.empty())
    {
        cout << "Check image path";
        return -1;
    }
    imgs.push_back(img);
    img = imread("f:/images/pano/pano2.jpg");
    if (img.empty())
    {
        cout << "Check image path";
        return -1;
    }
    imgs.push_back(img);

    Mat pano;
    Ptr<Stitcher> stitcher = Stitcher::create();
    Stitcher::Status status = stitcher->stitch(imgs, pano);

    if (status != Stitcher::OK)
    {
        cout << "Can't stitch images, error code = " << int(status) << endl;
        return EXIT_FAILURE;
    }
    //![stitching]
    imshow("r", pano);
    waitKey();

you can find a full example here

Image are here http://answers.opencv.org/question/181271/i-am-trying-to-stitch-a-few-images-and-getting-assertion-errors/