提交 9c47e149 编写于 作者: B Ben Thompson

Fixed infinite-loop when >3 centres

Infinite loop caused when more than 3 centres are found in image. Occurs
often when more than one QR code is in view.
上级 67e77fe1
......@@ -422,14 +422,13 @@ function FinderPatternFinder()
var stdDev = Math.sqrt(square / startSize - average * average);
var limit = Math.max(0.2 * average, stdDev);
for (var i = 0; i < this.possibleCenters.length && this.possibleCenters.length > 3; i++)
for (var i = this.possibleCenters.length - 1; i >= 0 ; i--)
{
var pattern = this.possibleCenters[i];
//if (Math.abs(pattern.EstimatedModuleSize - average) > 0.2 * average)
if (Math.abs(pattern.EstimatedModuleSize - average) > limit)
{
this.possibleCenters.remove(i);
i--;
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册