More improvements from fyellin

git-svn-id: https://zxing.googlecode.com/svn/trunk@2813 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen@gmail.com 2013-05-31 00:04:50 +00:00
parent 71d7987c28
commit f9bf974d1c
4 changed files with 9 additions and 7 deletions

View file

@ -84,6 +84,10 @@ public final class Detector {
* @throws NotFoundException in case of too many errors or invalid parameters * @throws NotFoundException in case of too many errors or invalid parameters
*/ */
private void extractParameters(ResultPoint[] bullsEyeCorners) throws NotFoundException { private void extractParameters(ResultPoint[] bullsEyeCorners) throws NotFoundException {
if (!isValid(bullsEyeCorners[0]) || !isValid(bullsEyeCorners[1]) ||
!isValid(bullsEyeCorners[2]) || !isValid(bullsEyeCorners[3])) {
throw NotFoundException.getNotFoundInstance();
}
int twoCenterLayers = 2 * nbCenterLayers; int twoCenterLayers = 2 * nbCenterLayers;
// Get the bits around the bull's eye // Get the bits around the bull's eye
boolean[] resab = sampleLine(bullsEyeCorners[0], bullsEyeCorners[1], twoCenterLayers+1); boolean[] resab = sampleLine(bullsEyeCorners[0], bullsEyeCorners[1], twoCenterLayers+1);
@ -560,9 +564,6 @@ public final class Detector {
ResultPoint result1 = new ResultPoint(centerx + ratio * dx, centery + ratio * dy); ResultPoint result1 = new ResultPoint(centerx + ratio * dx, centery + ratio * dy);
ResultPoint result3 = new ResultPoint(centerx - ratio * dx, centery - ratio * dy); ResultPoint result3 = new ResultPoint(centerx - ratio * dx, centery - ratio * dy);
if (!isValid(result0) || !isValid(result1) || !isValid(result2) || !isValid(result3)) {
throw NotFoundException.getNotFoundInstance();
}
return new ResultPoint[] { result0, result1, result2, result3 }; return new ResultPoint[] { result0, result1, result2, result3 };
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -0,0 +1 @@
hello

View file

@ -26,10 +26,10 @@ public final class AztecBlackBox1TestCase extends AbstractBlackBoxTestCase {
public AztecBlackBox1TestCase() { public AztecBlackBox1TestCase() {
super("test/data/blackbox/aztec-1", new AztecReader(), BarcodeFormat.AZTEC); super("test/data/blackbox/aztec-1", new AztecReader(), BarcodeFormat.AZTEC);
addTest(11, 11, 0.0f); addTest(12, 12, 0.0f);
addTest(11, 11, 90.0f); addTest(12, 12, 90.0f);
addTest(11, 11, 180.0f); addTest(12, 12, 180.0f);
addTest(11, 11, 270.0f); addTest(12, 12, 270.0f);
} }
} }