mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
More improvements from fyellin
git-svn-id: https://zxing.googlecode.com/svn/trunk@2813 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
71d7987c28
commit
f9bf974d1c
|
@ -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 };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
BIN
core/test/data/blackbox/aztec-1/hello.png
Normal file
BIN
core/test/data/blackbox/aztec-1/hello.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
1
core/test/data/blackbox/aztec-1/hello.txt
Normal file
1
core/test/data/blackbox/aztec-1/hello.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
hello
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue