On a tip from Sandy found an error in the QR code detector that would miss a third...
authorsrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Sun, 4 Jan 2009 21:11:25 +0000 (21:11 +0000)
committersrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Sun, 4 Jan 2009 21:11:25 +0000 (21:11 +0000)
git-svn-id: http://zxing.googlecode.com/svn/trunk@814 59b500cc-1b3d-0410-9834-0bbf25fbcc57

core/src/com/google/zxing/qrcode/detector/FinderPatternFinder.java
core/test/src/com/google/zxing/qrcode/QRCodeBlackBox1TestCase.java
core/test/src/com/google/zxing/qrcode/QRCodeBlackBox2TestCase.java
core/test/src/com/google/zxing/qrcode/QRCodeBlackBox3TestCase.java
core/test/src/com/google/zxing/qrcode/QRCodeBlackBox4TestCase.java

index a518631..c8370d5 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
index e36b080..b03d5cd 100644 (file)
@@ -29,7 +29,7 @@ public final class QRCodeBlackBox1TestCase extends AbstractBlackBoxTestCase {
 
   public QRCodeBlackBox1TestCase() {
     super(new File("test/data/blackbox/qrcode-1"), new MultiFormatReader(), BarcodeFormat.QR_CODE);
-    addTest(17, 18, 0.0f);
+    addTest(18, 18, 0.0f);
     addTest(14, 14, 90.0f);
     addTest(18, 18, 180.0f);
     addTest(13, 14, 270.0f);
index de9dce2..89ba41b 100644 (file)
@@ -29,7 +29,7 @@ public final class QRCodeBlackBox2TestCase extends AbstractBlackBoxTestCase {
 
   public QRCodeBlackBox2TestCase() {
     super(new File("test/data/blackbox/qrcode-2"), new MultiFormatReader(), BarcodeFormat.QR_CODE);
-    addTest(23, 23, 0.0f);
+    addTest(22, 22, 0.0f);
     addTest(18, 18, 90.0f);
     addTest(22, 22, 180.0f);
     addTest(17, 17, 270.0f);
index cfecdae..793ca74 100644 (file)
@@ -29,10 +29,10 @@ public final class QRCodeBlackBox3TestCase extends AbstractBlackBoxTestCase {
 
   public QRCodeBlackBox3TestCase() {
     super(new File("test/data/blackbox/qrcode-3"), new MultiFormatReader(), BarcodeFormat.QR_CODE);
-    addTest(28, 28, 0.0f);
+    addTest(29, 29, 0.0f);
     addTest(26, 26, 90.0f);
     addTest(30, 30, 180.0f);
-    addTest(26, 26, 270.0f);
+    addTest(29, 29, 270.0f);
   }
 
 }
\ No newline at end of file
index 5ca56a9..31a138f 100644 (file)
@@ -31,7 +31,7 @@ public final class QRCodeBlackBox4TestCase extends AbstractBlackBoxTestCase {
 
   public QRCodeBlackBox4TestCase() {
     super(new File("test/data/blackbox/qrcode-4"), new MultiFormatReader(), BarcodeFormat.QR_CODE);
-    addTest(33, 33, 0.0f);
+    addTest(32, 32, 0.0f);
     addTest(33, 33, 90.0f);
     addTest(32, 32, 180.0f);
     addTest(32, 32, 270.0f);