Reverted inadvertent Detector changes that broke unit tests. Fixed test target to definitely exclude non-TestCase classes from tests.

git-svn-id: https://zxing.googlecode.com/svn/trunk@548 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2008-08-06 16:07:46 +00:00
parent c58ae8b68d
commit 7c6276d89b
2 changed files with 7 additions and 6 deletions

View file

@ -159,6 +159,7 @@
</assertions>
<batchtest>
<fileset dir="test/src">
<include name="**/*TestCase.java"/>
<exclude name="**/*BlackBox*TestCase.java"/>
</fileset>
</batchtest>

View file

@ -68,20 +68,20 @@ public final class Detector {
int width = image.getWidth();
int halfHeight = height >> 1;
int halfWidth = width >> 1;
int iSkip = Math.max(1, height / (MAX_MODULES << 2));
int jSkip = Math.max(1, width / (MAX_MODULES << 2));
int iSkip = Math.max(1, height / (MAX_MODULES << 3));
int jSkip = Math.max(1, width / (MAX_MODULES << 3));
int minI = 0;
int maxI = height;
int minJ = 0;
int maxJ = width;
ResultPoint pointA = findCornerFromCenter(halfHeight, -iSkip, minI, maxI, halfWidth, 0, minJ, maxJ, halfWidth >> 2);
ResultPoint pointA = findCornerFromCenter(halfHeight, -iSkip, minI, maxI, halfWidth, 0, minJ, maxJ, halfWidth >> 1);
minI = (int) pointA.getY() - 1;
ResultPoint pointB = findCornerFromCenter(halfHeight, 0, minI, maxI, halfWidth, -jSkip, minJ, maxJ, halfHeight >> 2);
ResultPoint pointB = findCornerFromCenter(halfHeight, 0, minI, maxI, halfWidth, -jSkip, minJ, maxJ, halfHeight >> 1);
minJ = (int) pointB.getX() - 1;
ResultPoint pointC = findCornerFromCenter(halfHeight, 0, minI, maxI, halfWidth, jSkip, minJ, maxJ, halfHeight >> 2);
ResultPoint pointC = findCornerFromCenter(halfHeight, 0, minI, maxI, halfWidth, jSkip, minJ, maxJ, halfHeight >> 1);
maxJ = (int) pointC.getX() + 1;
ResultPoint pointD = findCornerFromCenter(halfHeight, iSkip, minI, maxI, halfWidth, 0, minJ, maxJ, halfWidth >> 2);
ResultPoint pointD = findCornerFromCenter(halfHeight, iSkip, minI, maxI, halfWidth, 0, minJ, maxJ, halfWidth >> 1);
maxI = (int) pointD.getY() + 1;
// Go try to find point A again with better information -- might have been off at first.
pointA = findCornerFromCenter(halfHeight, -iSkip, minI, maxI, halfWidth, 0, minJ, maxJ, halfWidth >> 2);