fixed bug in opencv_stitching (added handling of homography evaluation failure)
This commit is contained in:
parent
c66ed3e02f
commit
b6e9ed4ec5
@ -549,6 +549,7 @@ int main(int argc, char* argv[])
|
|||||||
sz.width = cvRound(full_img_sizes[i].width * compose_scale);
|
sz.width = cvRound(full_img_sizes[i].width * compose_scale);
|
||||||
sz.height = cvRound(full_img_sizes[i].height * compose_scale);
|
sz.height = cvRound(full_img_sizes[i].height * compose_scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
Rect roi = warper->warpRoi(sz, static_cast<float>(cameras[i].focal), cameras[i].R);
|
Rect roi = warper->warpRoi(sz, static_cast<float>(cameras[i].focal), cameras[i].R);
|
||||||
corners[i] = roi.tl();
|
corners[i] = roi.tl();
|
||||||
sizes[i] = roi.size();
|
sizes[i] = roi.size();
|
||||||
|
@ -465,6 +465,8 @@ void BestOf2NearestMatcher::match(const ImageFeatures &features1, const ImageFea
|
|||||||
|
|
||||||
// Find pair-wise motion
|
// Find pair-wise motion
|
||||||
matches_info.H = findHomography(src_points, dst_points, matches_info.inliers_mask, CV_RANSAC);
|
matches_info.H = findHomography(src_points, dst_points, matches_info.inliers_mask, CV_RANSAC);
|
||||||
|
if (abs(determinant(matches_info.H)) < numeric_limits<double>::epsilon())
|
||||||
|
return;
|
||||||
|
|
||||||
// Find number of inliers
|
// Find number of inliers
|
||||||
matches_info.num_inliers = 0;
|
matches_info.num_inliers = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user