Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How can I add my own feature code into sticther pipeline of OpenCV?

I have a hard stitching problem therfore I need to define my own feature extraction routine instead of native SURF or other.

The main problem is, my images are symmetric to each other. Therefore, matching features are also symmetric that skwed the expected homography estimation. Hence I need to define the region that suposedly used in feature extraction. I also believe Lowe's SIFT is better than the SURF so I need to define my feature extraction routine using SIFT on a given area of the images.

How can I inject my own feature extraction routine, for instance well-known SIFT implementation of DAVID LOWE, instead of SURF at the below code that I work on ?

vector<Mat> images;

Mat pano;
Stitcher stitcher = Stitcher::createDefault(true);

stitcher.setWarper(new PlaneWarper());
stitcher.setFeaturesFinder(new detail::SurfFeaturesFinder(1000,4,4,4,4));
stitcher.setFeaturesMatcher(new detail::BestOf2NearestMatcher(false,0.3));
stitcher.setBundleAdjuster(new detail::BundleAdjusterRay());
Stitcher::Status status = Stitcher::ERR_NEED_MORE_IMGS;
    status = stitcher.stitch(images, pano);
    cout << status << endl;
catch(cv::Exception e){
    cout << "Stitching is not successfull!!" << endl;
imwrite("RESULT.jpg", pano);