Avoid assert in lapac.cpp if findHomography fails in BestOf2NearestMatcher::match

This commit is contained in:
Andrey Kamaev
2013-03-12 22:36:00 +04:00
parent 9f3ce0dd97
commit 55698548dd
2 changed files with 2 additions and 1 deletions

View File

@@ -573,7 +573,7 @@ void BestOf2NearestMatcher::match(const ImageFeatures &features1, const ImageFea
// Find pair-wise motion
matches_info.H = findHomography(src_points, dst_points, matches_info.inliers_mask, CV_RANSAC);
if (std::abs(determinant(matches_info.H)) < std::numeric_limits<double>::epsilon())
if (matches_info.H.empty() || std::abs(determinant(matches_info.H)) < std::numeric_limits<double>::epsilon())
return;
// Find number of inliers