Made a change to the QR detector which cuts the worst case rejection time from 300 ms to 160 ms, with almost no penalty in decoding ability. Given that we're emphasizing continuous decoding, I feel it's much better to reject the occasional borderline image in half the time, and get on with the next scan.

git-svn-id: https://zxing.googlecode.com/svn/trunk@648 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
dswitkin 2008-10-29 14:22:44 +00:00
parent 78da6447b0
commit d80cd07064
4 changed files with 8 additions and 6 deletions

View file

@ -96,7 +96,9 @@ final class FinderPatternFinder {
if (foundPatternCross(stateCount)) { // Yes
boolean confirmed = handlePossibleCenter(stateCount, i, j);
if (confirmed) {
iSkip = 1; // Go back to examining each line
// Start examining every other line. Checking each line turned out to be too
// expensive and didn't improve performance.
iSkip = 2;
if (hasSkipped) {
done = haveMulitplyConfirmedCenters();
} else {

View file

@ -29,10 +29,10 @@ public final class QRCodeBlackBox1TestCase extends AbstractBlackBoxTestCase {
public QRCodeBlackBox1TestCase() {
super(new File("test/data/blackbox/qrcode-1"), new MultiFormatReader(), BarcodeFormat.QR_CODE);
addTest(18, 18, 0.0f);
addTest(17, 18, 0.0f);
addTest(14, 14, 90.0f);
addTest(18, 18, 180.0f);
addTest(14, 14, 270.0f);
addTest(13, 14, 270.0f);
}
}

View file

@ -32,7 +32,7 @@ public final class QRCodeBlackBox2TestCase extends AbstractBlackBoxTestCase {
addTest(10, 10, 0.0f);
addTest(6, 6, 90.0f);
addTest(9, 9, 180.0f);
addTest(7, 7, 270.0f);
addTest(6, 6, 270.0f);
}
}

View file

@ -29,9 +29,9 @@ public final class QRCodeBlackBox3TestCase extends AbstractBlackBoxTestCase {
public QRCodeBlackBox3TestCase() {
super(new File("test/data/blackbox/qrcode-3"), new MultiFormatReader(), BarcodeFormat.QR_CODE);
addTest(29, 29, 0.0f);
addTest(28, 28, 0.0f);
addTest(26, 26, 90.0f);
addTest(29, 29, 180.0f);
addTest(30, 30, 180.0f);
addTest(26, 26, 270.0f);
}