Added handling of ROI in stitching features matchers

This commit is contained in:
Alexey Spizhevoy
2011-09-26 09:59:13 +00:00
parent b053a3b486
commit a7d053f10d
4 changed files with 51 additions and 1 deletions

View File

@@ -100,6 +100,13 @@ Stitcher::Status Stitcher::stitch(InputArray imgs, OutputArray pano)
}
Stitcher::Status Stitcher::stitch(InputArray imgs, const vector<vector<Rect> > &rois, OutputArray pano)
{
rois_ = rois;
return stitch(imgs, pano);
}
Stitcher::Status Stitcher::matchImages()
{
if ((int)imgs_.size() < 2)
@@ -148,7 +155,10 @@ Stitcher::Status Stitcher::matchImages()
is_seam_scale_set = true;
}
(*features_finder_)(img, features_[i]);
if (rois_.empty())
(*features_finder_)(img, features_[i]);
else
(*features_finder_)(img, features_[i], rois_[i]);
features_[i].img_idx = i;
LOGLN("Features in image #" << i+1 << ": " << features_[i].keypoints.size());