Full width home advertisement

728+3

OpenCV

HTML

Post Page Advertisement [Top]

728+3
        In this tutorial I will explain how OpenCV Stitching module can used in panorama mode as well as scanned mode.
stitching_scan

        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

s1
s2
s3

Result

strich_rsut_panoram

Result For SCANS Mode

Input

s4
s5
s6

Result

strich_rsut_scan

728+3

No comments:

Post a Comment

Bottom Ad [Post Page]

| Designed by Colorlib