提交 5268f39b 编写于 作者: L Lazar Laszlo 提交者: GitHub

Merge pull request #45 from invertedtomato/master

Fixed infinite-loop when >3 centres
......@@ -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.
先完成此消息的编辑!
想要评论请 注册