Commit 91201b22 authored by Shai's avatar Shai

Update global_motion.cpp

An extremely rare case where, for numeric reasons bestM finds more inliers than ninliersMax. 
This RARE case causes memory corruption and a nasty seg fault.
parent e0f40a7f
......@@ -430,7 +430,7 @@ Mat estimateGlobalMotionRansac(
{
subset0.resize(ninliersMax);
subset1.resize(ninliersMax);
for (int i = 0, j = 0; i < npoints; ++i)
for (int i = 0, j = 0; i < npoints && j < ninliersMax ; ++i)
{
p0 = points0_[i];
p1 = points1_[i];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment