Stitching Images android.OpenCV newbie

asked 2015-09-28 20:53:45 -0500

Hello,

Im trying to take some pictures in my android phone and stitch them together.taking images works fine and here is my code for stitching

Mat pano;
    Stitcher stitcher = Stitcher::createDefault(try_use_gpu);
    Stitcher::Status status = stitcher.stitch(imgs1, pano);

    if (status == Stitcher::ERR_HOMOGRAPHY_EST_FAIL)
    {
        cout << "Can't stitch images, error code = " << int(status) << endl;
        return -1;
    }
    if(status == Stitcher::ERR_NEED_MORE_IMGS) {
        cout<< "need more images ";
        return -2;
    }
    if(status == Stitcher::ERR_CAMERA_PARAMS_ADJUST_FAIL) {
        cout<<"params adjust fail";
        return -3;
    }

    if(status == Stitcher::OK) {
    imwrite(str, pano);
    return 0;
    }

where imgs1 is a vector of Mats and pano is a resulting mat.The problem is i always get Stitcher::ERR_HOMOGRAPHY_EST_FAIL as status. Am I doing it right? is there a better way to stitch images? plz guide me in the right direction. thanks in advance

edit retag flag offensive close merge delete