Full width home advertisement

OpenCV

HTML

Post Page Advertisement [Top]

        In this tutorial I will explain how OpenCV Stitching module can used in panorama mode as well as scanned mode.
OpenCV Image Stitching

        This Stitcher class operate in two Mode PANORAMA and SCANS. The PANORAMA mode used create panoramas from input image where the input images are horizontally split. The SCANS Mode for stitching scans where input can be horizontally or vertically split.

C++ Code


    vector < Mat > imgs;
    imgs.push_back(imread("img/s1.jpg", IMREAD_COLOR));
    imgs.push_back(imread("img/s2.jpg", IMREAD_COLOR));
    imgs.push_back(imread("img/s3.jpg", IMREAD_COLOR));

    Stitcher::Mode mode = Stitcher::PANORAMA; 
    //mode = Stitcher::SCANS; //enable this mode for stitch scan
    Mat dst;
    Ptr < Stitcher > stitcher = Stitcher::create(mode);
    Stitcher::Status status = stitcher->stitch(imgs, dst);
    if (status != Stitcher::OK)
    {
        cout << "Stitching error code = " << int(status) << endl;
        return 0;
    }

    imshow("result",dst);
    imwrite("strich_rsut_panoram0.jpg", dst);
    waitKey();

Result For PANORAMA Mode

Input

Result

Result For SCANS Mode

Input

Result


No comments:

Post a Comment

Bottom Ad [Post Page]

| Designed by Colorlib