mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
On a tip from Sandy found an error in the QR code detector that would miss a third finder pattern in cases of about 135 degree rotation. This changes test results but is a net win.
git-svn-id: https://zxing.googlecode.com/svn/trunk@814 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
6d8febc69e
commit
d0bc7df5d4
|
@ -423,10 +423,10 @@ final class FinderPatternFinder {
|
|||
// How far down can we skip before resuming looking for the next
|
||||
// pattern? In the worst case, only the difference between the
|
||||
// difference in the x / y coordinates of the two centers.
|
||||
// This is the case where you find top left first. Draw it out.
|
||||
// This is the case where you find top left last.
|
||||
hasSkipped = true;
|
||||
return (int) (Math.abs(firstConfirmedCenter.getX() - center.getX()) -
|
||||
Math.abs(firstConfirmedCenter.getY() - center.getY()));
|
||||
Math.abs(firstConfirmedCenter.getY() - center.getY())) / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue