Fixed bug in KeyPointsFilter::runByImageBorder; added ROI adjustment to ORB

This commit is contained in:
Andrey Kamaev
2011-10-21 08:38:47 +00:00
parent e8032fa8e9
commit 21a4a06d8a
2 changed files with 47 additions and 6 deletions

View File

@@ -183,10 +183,13 @@ void KeyPointsFilter::runByImageBorder( vector<KeyPoint>& keypoints, Size imageS
{
if( borderSize > 0)
{
keypoints.erase( remove_if(keypoints.begin(), keypoints.end(),
RoiPredicate(Rect(Point(borderSize, borderSize),
Point(imageSize.width - borderSize, imageSize.height - borderSize)))),
keypoints.end() );
if (imageSize.height <= borderSize * 2 || imageSize.width <= borderSize * 2)
keypoints.clear();
else
keypoints.erase( remove_if(keypoints.begin(), keypoints.end(),
RoiPredicate(Rect(Point(borderSize, borderSize),
Point(imageSize.width - borderSize, imageSize.height - borderSize)))),
keypoints.end() );
}
}