Tightened a condition to reduce accidentally detecting the alignment pattern as a...
[zxing.git] / core / src / com / google / zxing / qrcode / detector / FinderPatternFinder.java
index a518631..63592bf 100755 (executable)
@@ -423,10 +423,10 @@ final class FinderPatternFinder {
           // How far down can we skip before resuming looking for the next\r
           // pattern? In the worst case, only the difference between the\r
           // difference in the x / y coordinates of the two centers.\r
-          // This is the case where you find top left first. Draw it out.\r
+          // This is the case where you find top left last.\r
           hasSkipped = true;\r
           return (int) (Math.abs(firstConfirmedCenter.getX() - center.getX()) -\r
-              Math.abs(firstConfirmedCenter.getY() - center.getY()));\r
+              Math.abs(firstConfirmedCenter.getY() - center.getY())) / 2;\r
         }\r
       }\r
     }\r
@@ -462,7 +462,7 @@ final class FinderPatternFinder {
       FinderPattern pattern = (FinderPattern) possibleCenters.elementAt(i);\r
       totalDeviation += Math.abs(pattern.getEstimatedModuleSize() - average);\r
     }\r
-    return totalDeviation <= 0.15f * totalModuleSize;\r
+    return totalDeviation <= 0.05f * totalModuleSize;\r
   }\r
 \r
   /**\r