From 25f7d666fd9d66af0b72641c3dd7098bf42990ea Mon Sep 17 00:00:00 2001 From: "dav.olivier@gmail.com" Date: Tue, 5 Oct 2010 20:19:53 +0000 Subject: [PATCH] Issue 563: Support non-rectangular Data Matrix git-svn-id: http://zxing.googlecode.com/svn/trunk@1616 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- .../zxing/common/DefaultGridSampler.java | 93 +++++++----- .../com/google/zxing/common/GridSampler.java | 22 +++ .../datamatrix/decoder/BitMatrixParser.java | 19 ++- .../zxing/datamatrix/decoder/Version.java | 2 +- .../zxing/datamatrix/detector/Detector.java | 133 ++++++++++++++---- .../data/blackbox/datamatrix-1/abcd-18x8.png | Bin 0 -> 540 bytes .../data/blackbox/datamatrix-1/abcd-18x8.txt | 1 + .../data/blackbox/datamatrix-1/abcd-26x12.png | Bin 0 -> 857 bytes .../data/blackbox/datamatrix-1/abcd-26x12.txt | 1 + .../data/blackbox/datamatrix-1/abcd-32x8.png | Bin 0 -> 758 bytes .../data/blackbox/datamatrix-1/abcd-32x8.txt | 1 + .../data/blackbox/datamatrix-1/abcd-36x12.png | Bin 0 -> 1132 bytes .../data/blackbox/datamatrix-1/abcd-36x12.txt | 1 + .../data/blackbox/datamatrix-1/abcd-36x16.png | Bin 0 -> 1492 bytes .../data/blackbox/datamatrix-1/abcd-36x16.txt | 1 + .../data/blackbox/datamatrix-1/abcd-48x16.png | Bin 0 -> 2029 bytes .../data/blackbox/datamatrix-1/abcd-48x16.txt | 1 + .../DataMatrixBlackBox1TestCase.java | 8 +- .../DataMatrixBlackBox2TestCase.java | 2 +- 19 files changed, 207 insertions(+), 78 deletions(-) create mode 100644 core/test/data/blackbox/datamatrix-1/abcd-18x8.png create mode 100644 core/test/data/blackbox/datamatrix-1/abcd-18x8.txt create mode 100644 core/test/data/blackbox/datamatrix-1/abcd-26x12.png create mode 100644 core/test/data/blackbox/datamatrix-1/abcd-26x12.txt create mode 100644 core/test/data/blackbox/datamatrix-1/abcd-32x8.png create mode 100644 core/test/data/blackbox/datamatrix-1/abcd-32x8.txt create mode 100644 core/test/data/blackbox/datamatrix-1/abcd-36x12.png create mode 100644 core/test/data/blackbox/datamatrix-1/abcd-36x12.txt create mode 100644 core/test/data/blackbox/datamatrix-1/abcd-36x16.png create mode 100644 core/test/data/blackbox/datamatrix-1/abcd-36x16.txt create mode 100644 core/test/data/blackbox/datamatrix-1/abcd-48x16.png create mode 100644 core/test/data/blackbox/datamatrix-1/abcd-48x16.txt diff --git a/core/src/com/google/zxing/common/DefaultGridSampler.java b/core/src/com/google/zxing/common/DefaultGridSampler.java index 9a2a6831..01722b3d 100644 --- a/core/src/com/google/zxing/common/DefaultGridSampler.java +++ b/core/src/com/google/zxing/common/DefaultGridSampler.java @@ -38,44 +38,63 @@ public final class DefaultGridSampler extends GridSampler { p1ToX, p1ToY, p2ToX, p2ToY, p3ToX, p3ToY, p4ToX, p4ToY, p1FromX, p1FromY, p2FromX, p2FromY, p3FromX, p3FromY, p4FromX, p4FromY); - return sampleGrid(image, dimension, transform); + return sampleGrid(image, dimension, dimension, transform); } - + public BitMatrix sampleGrid(BitMatrix image, - int dimension, - PerspectiveTransform transform) throws NotFoundException { - BitMatrix bits = new BitMatrix(dimension); - float[] points = new float[dimension << 1]; - for (int y = 0; y < dimension; y++) { - int max = points.length; - float iValue = (float) y + 0.5f; - for (int x = 0; x < max; x += 2) { - points[x] = (float) (x >> 1) + 0.5f; - points[x + 1] = iValue; - } - transform.transformPoints(points); - // Quick check to see if points transformed to something inside the image; - // sufficient to check the endpoints - checkAndNudgePoints(image, points); - try { - for (int x = 0; x < max; x += 2) { - if (image.get((int) points[x], (int) points[x + 1])) { - // Black(-ish) pixel - bits.set(x >> 1, y); - } - } - } catch (ArrayIndexOutOfBoundsException aioobe) { - // This feels wrong, but, sometimes if the finder patterns are misidentified, the resulting - // transform gets "twisted" such that it maps a straight line of points to a set of points - // whose endpoints are in bounds, but others are not. There is probably some mathematical - // way to detect this about the transformation that I don't know yet. - // This results in an ugly runtime exception despite our clever checks above -- can't have - // that. We could check each point's coordinates but that feels duplicative. We settle for - // catching and wrapping ArrayIndexOutOfBoundsException. - throw NotFoundException.getNotFoundInstance(); - } - } - return bits; - } + int dimensionX, + int dimensionY, + float p1ToX, float p1ToY, + float p2ToX, float p2ToY, + float p3ToX, float p3ToY, + float p4ToX, float p4ToY, + float p1FromX, float p1FromY, + float p2FromX, float p2FromY, + float p3FromX, float p3FromY, + float p4FromX, float p4FromY) throws NotFoundException { + +PerspectiveTransform transform = PerspectiveTransform.quadrilateralToQuadrilateral( +p1ToX, p1ToY, p2ToX, p2ToY, p3ToX, p3ToY, p4ToX, p4ToY, +p1FromX, p1FromY, p2FromX, p2FromY, p3FromX, p3FromY, p4FromX, p4FromY); +return sampleGrid(image, dimensionX, dimensionY, transform); +} + + public BitMatrix sampleGrid(BitMatrix image, + int dimensionX, int dimensionY, + PerspectiveTransform transform) throws NotFoundException { +BitMatrix bits = new BitMatrix(dimensionX, dimensionY); +float[] points = new float[dimensionX << 1]; +for (int y = 0; y < dimensionY; y++) { +int max = points.length; +float iValue = (float) y + 0.5f; +for (int x = 0; x < max; x += 2) { +points[x] = (float) (x >> 1) + 0.5f; +points[x + 1] = iValue; +} +transform.transformPoints(points); +// Quick check to see if points transformed to something inside the image; +// sufficient to check the endpoints +checkAndNudgePoints(image, points); +try { +for (int x = 0; x < max; x += 2) { +if (image.get((int) points[x], (int) points[x + 1])) { +// Black(-ish) pixel +bits.set(x >> 1, y); +} +} +} catch (ArrayIndexOutOfBoundsException aioobe) { +// This feels wrong, but, sometimes if the finder patterns are misidentified, the resulting +// transform gets "twisted" such that it maps a straight line of points to a set of points +// whose endpoints are in bounds, but others are not. There is probably some mathematical +// way to detect this about the transformation that I don't know yet. +// This results in an ugly runtime exception despite our clever checks above -- can't have +// that. We could check each point's coordinates but that feels duplicative. We settle for +// catching and wrapping ArrayIndexOutOfBoundsException. +throw NotFoundException.getNotFoundInstance(); +} +} +return bits; +} + } diff --git a/core/src/com/google/zxing/common/GridSampler.java b/core/src/com/google/zxing/common/GridSampler.java index 3b55eb69..1a79b934 100644 --- a/core/src/com/google/zxing/common/GridSampler.java +++ b/core/src/com/google/zxing/common/GridSampler.java @@ -92,6 +92,28 @@ public abstract class GridSampler { float p3FromX, float p3FromY, float p4FromX, float p4FromY) throws NotFoundException; + /** + * Samples an image for a rectangular matrix of bits of the given dimension. + * @param image image to sample + * @param dimensionX width of {@link BitMatrix} to sample from image + * @param dimensionY height of {@link BitMatrix} to sample from image + * @return {@link BitMatrix} representing a grid of points sampled from the image within a region + * defined by the "from" parameters + * @throws NotFoundException if image can't be sampled, for example, if the transformation defined + * by the given points is invalid or results in sampling outside the image boundaries + */ + public abstract BitMatrix sampleGrid(BitMatrix image, + int dimensionX, + int dimensionY, + float p1ToX, float p1ToY, + float p2ToX, float p2ToY, + float p3ToX, float p3ToY, + float p4ToX, float p4ToY, + float p1FromX, float p1FromY, + float p2FromX, float p2FromY, + float p3FromX, float p3FromY, + float p4FromX, float p4FromY) throws NotFoundException; + public BitMatrix sampleGrid(BitMatrix image, int dimension, PerspectiveTransform transform) throws NotFoundException { diff --git a/core/src/com/google/zxing/datamatrix/decoder/BitMatrixParser.java b/core/src/com/google/zxing/datamatrix/decoder/BitMatrixParser.java index 96032b43..3fe11a2a 100644 --- a/core/src/com/google/zxing/datamatrix/decoder/BitMatrixParser.java +++ b/core/src/com/google/zxing/datamatrix/decoder/BitMatrixParser.java @@ -30,18 +30,17 @@ final class BitMatrixParser { /** * @param bitMatrix {@link BitMatrix} to parse - * @throws FormatException if dimension is < 10 or > 144 or not 0 mod 2 + * @throws FormatException if dimension is < 8 or > 144 or not 0 mod 2 */ BitMatrixParser(BitMatrix bitMatrix) throws FormatException { int dimension = bitMatrix.getHeight(); - if (dimension < 10 || dimension > 144 || (dimension & 0x01) != 0) { + if (dimension < 8 || dimension > 144 || (dimension & 0x01) != 0) { throw FormatException.getFormatInstance(); } version = readVersion(bitMatrix); this.mappingBitMatrix = extractDataRegion(bitMatrix); - // TODO(bbrown): Make this work for rectangular symbols - this.readMappingMatrix = new BitMatrix(this.mappingBitMatrix.getHeight()); + this.readMappingMatrix = new BitMatrix(this.mappingBitMatrix.getWidth(), this.mappingBitMatrix.getHeight()); } /** @@ -61,9 +60,8 @@ final class BitMatrixParser { return version; } - // TODO(bbrown): make this work for rectangular dimensions as well. int numRows = bitMatrix.getHeight(); - int numColumns = numRows; + int numColumns = bitMatrix.getWidth(); return Version.getVersionForDimensions(numRows, numColumns); } @@ -83,9 +81,9 @@ final class BitMatrixParser { int row = 4; int column = 0; - // TODO(bbrown): Data Matrix can be rectangular, assuming square for now + int numRows = mappingBitMatrix.getHeight(); - int numColumns = numRows; + int numColumns = mappingBitMatrix.getWidth(); boolean corner1Read = false; boolean corner2Read = false; @@ -407,7 +405,6 @@ final class BitMatrixParser { int symbolSizeRows = version.getSymbolSizeRows(); int symbolSizeColumns = version.getSymbolSizeColumns(); - // TODO(bbrown): Make this work with rectangular codes if (bitMatrix.getHeight() != symbolSizeRows) { throw new IllegalArgumentException("Dimension of bitMarix must match the version size"); } @@ -419,10 +416,10 @@ final class BitMatrixParser { int numDataRegionsColumn = symbolSizeColumns / dataRegionSizeColumns; int sizeDataRegionRow = numDataRegionsRow * dataRegionSizeRows; - //int sizeDataRegionColumn = numDataRegionsColumn * dataRegionSizeColumns; + int sizeDataRegionColumn = numDataRegionsColumn * dataRegionSizeColumns; // TODO(bbrown): Make this work with rectangular codes - BitMatrix bitMatrixWithoutAlignment = new BitMatrix(sizeDataRegionRow); + BitMatrix bitMatrixWithoutAlignment = new BitMatrix(sizeDataRegionColumn, sizeDataRegionRow); for (int dataRegionRow = 0; dataRegionRow < numDataRegionsRow; ++dataRegionRow) { int dataRegionRowOffset = dataRegionRow * dataRegionSizeRows; for (int dataRegionColumn = 0; dataRegionColumn < numDataRegionsColumn; ++dataRegionColumn) { diff --git a/core/src/com/google/zxing/datamatrix/decoder/Version.java b/core/src/com/google/zxing/datamatrix/decoder/Version.java index d2b712bb..5f978544 100644 --- a/core/src/com/google/zxing/datamatrix/decoder/Version.java +++ b/core/src/com/google/zxing/datamatrix/decoder/Version.java @@ -232,7 +232,7 @@ public final class Version { new ECBlocks(14, new ECB(1, 16))), new Version(28, 12, 36, 10, 16, new ECBlocks(18, new ECB(1, 22))), - new Version(29, 16, 36, 10, 16, + new Version(29, 16, 36, 14, 16, new ECBlocks(24, new ECB(1, 32))), new Version(30, 16, 48, 14, 22, new ECBlocks(28, new ECB(1, 49))) diff --git a/core/src/com/google/zxing/datamatrix/detector/Detector.java b/core/src/com/google/zxing/datamatrix/detector/Detector.java index 59ffbada..6c43ef79 100644 --- a/core/src/com/google/zxing/datamatrix/detector/Detector.java +++ b/core/src/com/google/zxing/datamatrix/detector/Detector.java @@ -141,35 +141,118 @@ public final class Detector { // The top right point is actually the corner of a module, which is one of the two black modules // adjacent to the white module at the top right. Tracing to that corner from either the top left // or bottom right should work here. - int dimension = Math.min(transitionsBetween(topLeft, topRight).getTransitions(), - transitionsBetween(bottomRight, topRight).getTransitions()); - if ((dimension & 0x01) == 1) { + + + int dimensionTop = transitionsBetween(topLeft, topRight).getTransitions(); + int dimensionRight = transitionsBetween(bottomRight, topRight).getTransitions(); + + if ((dimensionTop & 0x01) == 1) { // it can't be odd, so, round... up? - dimension++; + dimensionTop++; } - dimension += 2; + dimensionTop += 2; + + if ((dimensionRight & 0x01) == 1) { + // it can't be odd, so, round... up? + dimensionRight++; + } + dimensionRight += 2; + + BitMatrix bits = null; + ResultPoint correctedTopRight = null; + + if (dimensionTop >= dimensionRight * 2 || dimensionRight >= dimensionTop * 2){ + //The matrix is rectangular + + correctedTopRight = correctTopRightRectangular(bottomLeft, bottomRight, topLeft, topRight, dimensionTop, dimensionRight); + if (correctedTopRight == null){ + correctedTopRight = topRight; + } + + dimensionTop = transitionsBetween(topLeft, correctedTopRight).getTransitions(); + dimensionRight = transitionsBetween(bottomRight, correctedTopRight).getTransitions(); + + if ((dimensionTop & 0x01) == 1) { + // it can't be odd, so, round... up? + dimensionTop++; + } + + if ((dimensionRight & 0x01) == 1) { + // it can't be odd, so, round... up? + dimensionRight++; + } + + bits = sampleGrid(image, topLeft, bottomLeft, bottomRight, correctedTopRight, dimensionTop, dimensionRight); + + } else { + //The matrix is square + + int dimension = Math.min(dimensionRight, dimensionTop); + //correct top right point to match the white module + correctedTopRight = correctTopRight(bottomLeft, bottomRight, topLeft, topRight, dimension); + if (correctedTopRight == null){ + correctedTopRight = topRight; + } - //correct top right point to match the white module - ResultPoint correctedTopRight = correctTopRight(bottomLeft, bottomRight, topLeft, topRight, dimension); - if (correctedTopRight == null){ - correctedTopRight = topRight; - } + //We redetermine the dimension using the corrected top right point + int dimensionCorrected = Math.max(transitionsBetween(topLeft, correctedTopRight).getTransitions(), + transitionsBetween(bottomRight, correctedTopRight).getTransitions()); + dimensionCorrected++; + if ((dimensionCorrected & 0x01) == 1) { + dimensionCorrected++; + } - //We redetermine the dimension using the corrected top right point - int dimension2 = Math.max(transitionsBetween(topLeft, correctedTopRight).getTransitions(), - transitionsBetween(bottomRight, correctedTopRight).getTransitions()); - dimension2++; - if ((dimension2 & 0x01) == 1) { - dimension2++; + bits = sampleGrid(image, topLeft, bottomLeft, bottomRight, correctedTopRight, dimensionCorrected, dimensionCorrected); } - BitMatrix bits = sampleGrid(image, topLeft, bottomLeft, bottomRight, correctedTopRight, dimension2); return new DetectorResult(bits, new ResultPoint[]{topLeft, bottomLeft, bottomRight, correctedTopRight}); } /** - * Calculates the position of the white top right module using the output of the rectangle detector + * Calculates the position of the white top right module using the output of the rectangle detector for a rectangular matrix + */ + private ResultPoint correctTopRightRectangular(ResultPoint bottomLeft, + ResultPoint bottomRight, ResultPoint topLeft, ResultPoint topRight, + int dimensionTop, int dimensionRight) { + + float corr = distance(bottomLeft, bottomRight) / (float)dimensionTop; + int norm = distance(topLeft, topRight); + float cos = (topRight.getX() - topLeft.getX()) / norm; + float sin = (topRight.getY() - topLeft.getY()) / norm; + + ResultPoint c1 = new ResultPoint(topRight.getX()+corr*cos, topRight.getY()+corr*sin); + + corr = distance(bottomLeft, topLeft) / (float)dimensionRight; + norm = distance(bottomRight, topRight); + cos = (topRight.getX() - bottomRight.getX()) / norm; + sin = (topRight.getY() - bottomRight.getY()) / norm; + + ResultPoint c2 = new ResultPoint(topRight.getX()+corr*cos, topRight.getY()+corr*sin); + + if (!isValid(c1)){ + if (isValid(c2)){ + return c2; + } + return null; + } else if (!isValid(c2)){ + return c1; + } + + int l1 = Math.abs(dimensionTop - transitionsBetween(topLeft, c1).getTransitions()) + + Math.abs(dimensionRight - transitionsBetween(bottomRight, c1).getTransitions()); + int l2 = Math.abs(dimensionTop - transitionsBetween(topLeft, c2).getTransitions()) + + Math.abs(dimensionRight - transitionsBetween(bottomRight, c2).getTransitions()); + + if (l1 <= l2){ + return c1; + } + + return c2; +} + +/** + * Calculates the position of the white top right module using the output of the rectangle detector for a square matrix */ private ResultPoint correctTopRight(ResultPoint bottomLeft, ResultPoint bottomRight, @@ -242,20 +325,22 @@ public final class Detector { ResultPoint bottomLeft, ResultPoint bottomRight, ResultPoint topRight, - int dimension) throws NotFoundException { + int dimensionX, + int dimensionY) throws NotFoundException { GridSampler sampler = GridSampler.getInstance(); return sampler.sampleGrid(image, - dimension, + dimensionX, + dimensionY, 0.5f, 0.5f, - dimension - 0.5f, + dimensionX - 0.5f, 0.5f, - dimension - 0.5f, - dimension - 0.5f, + dimensionX - 0.5f, + dimensionY - 0.5f, 0.5f, - dimension - 0.5f, + dimensionY - 0.5f, topLeft.getX(), topLeft.getY(), topRight.getX(), diff --git a/core/test/data/blackbox/datamatrix-1/abcd-18x8.png b/core/test/data/blackbox/datamatrix-1/abcd-18x8.png new file mode 100644 index 0000000000000000000000000000000000000000..0c0b73a5d9cc45f6bed2796b52fde527797b7cd8 GIT binary patch literal 540 zcmV+%0^|LOP)E^k00001b5ch_0Itp) z=>Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUznn^@KRCr$Po9&K+Fbo8H@Bh%;N70?cLCCBF6=nEaJ834nj)U5d zX__8B0f8@YJ^_J8kYmcXO{I_#5M0Jh#f97iHxS(7XkLtbw@Uf(u~^PH-WCFzqD8WnE9tD~(F^L~Rh7XxOPLxLE}MiB@_D)VrWy%RzSgxZZE~ zrg8br;Z1?`E=zE|q&izDe5!`?Up7s}gPx#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBU!*GWV{RCr$Po$XG;FbqY<`#>GnoD6s#8Z8m(aD+hGL}jqDJMHh{w)Nv zhm480j`a0ZS{G)mCpK~RX@!H6-pP%lyx|k#?6PY%u~O)}D$++eL3v&8$_am%Z54o7 zdI*IkB+f!IEoB6=rEr8cvkJ4sl0-UEdtIs6lh&1PXldpU_7|g2AH^u__{VX##I!ReNl4LC9H>dk9?JCh& z>+4G?TPj#2p`~p|RHVR4#2~E;Gl6NMuQ)ymGnj=RhvO29l_%+sVP9lGmMxb}LTL zB5mWkJ_yVjo(D7GeIkh^83zl8r&-F(JvB(;W7ava6ws1blCg7y_Cn-F34~z0C^IRr z5_<}Z6djkHD2P9l8)3FpQ;0$FJ`ho)oC3sIIb{6Lx_Zc9 j2D5?+)Y~%mSv_XoK2jO#Z>~pr00000NkvXXu0mjfv-Wy} literal 0 HcmV?d00001 diff --git a/core/test/data/blackbox/datamatrix-1/abcd-26x12.txt b/core/test/data/blackbox/datamatrix-1/abcd-26x12.txt new file mode 100644 index 00000000..f9fb1303 --- /dev/null +++ b/core/test/data/blackbox/datamatrix-1/abcd-26x12.txt @@ -0,0 +1 @@ +abcdefghijklm \ No newline at end of file diff --git a/core/test/data/blackbox/datamatrix-1/abcd-32x8.png b/core/test/data/blackbox/datamatrix-1/abcd-32x8.png new file mode 100644 index 0000000000000000000000000000000000000000..51ebd573e0d1470a9db306c47960072402fc70a1 GIT binary patch literal 758 zcmVPx#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ZaW3|w&!D^&v)lPZcKlo*CO#3tL^%myRmdL-`GRX7UB4>$5;xy{|L0EEw8QhpbX-kGyugqA~lerOd~LfC?6J1h=yG<$YW+y2WJm+I_GFB4&+# znkJYtZ(FziGP#RHscJP__z|k^Xxx5;5lj@APmx0^)A>~l3Q=7wELNl%u&sxJ%}tpY zXZ0yRanP%mAUT>dGT%X?K8&c$M}xnTAc$uICrSLC=t>tR-6#F5a}yMf|a32E8=`Q5|DurE{xg z7vX1nEyHsC&MILI@+gXKS*aL`gg23ozHgYO9YK1hoRqc}nPBs!I3m7Q2|;j5zE>MUA#aw85*fuL=G*sF=cq2EctKClZ8#&mD`)SmTc*yuSGZ8Vyf5j_>k-f;{R-*D9oUh@s?P8O{W z;`;d}Vw6RTEC0rUZmDdulRK*O-s~0=ScsdB!C$q4g)eiAg+2JOR0s2Kdyz3aJkl$! zW0yKv9Wc+wl! zJhc2<$hhg~(FjDlt+Hj@e~I%cLbB^=9)UN&4yjbwgaV|EAsgjRNvsKFdV1e(hW(QNX@cKG&W|Qk$=>ls~C6CzHDY27mMb#3;e)+*t=&?-- zdE(*cOLDGFuW(Xu9+Y3Pzx{;dKZQ}gkkQ0$t|-frJm|?aQim~Onwa>?dg9BGvka5R zwk9wWTgWD$lBr+GTTxQfx&q(^QWf$ELgLRz&lU0?BBLEI8A=Hq!()(LZm d>i?T}9%$dOkd}>3km&v~@L}y@Hh2pq{{>e|SMUG; literal 0 HcmV?d00001 diff --git a/core/test/data/blackbox/datamatrix-1/abcd-48x16.txt b/core/test/data/blackbox/datamatrix-1/abcd-48x16.txt new file mode 100644 index 00000000..79974733 --- /dev/null +++ b/core/test/data/blackbox/datamatrix-1/abcd-48x16.txt @@ -0,0 +1 @@ +abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW \ No newline at end of file diff --git a/core/test/src/com/google/zxing/datamatrix/DataMatrixBlackBox1TestCase.java b/core/test/src/com/google/zxing/datamatrix/DataMatrixBlackBox1TestCase.java index 5dc4c855..52a9461a 100644 --- a/core/test/src/com/google/zxing/datamatrix/DataMatrixBlackBox1TestCase.java +++ b/core/test/src/com/google/zxing/datamatrix/DataMatrixBlackBox1TestCase.java @@ -27,10 +27,10 @@ public final class DataMatrixBlackBox1TestCase extends AbstractBlackBoxTestCase public DataMatrixBlackBox1TestCase() { // TODO use MultiFormatReader here once Data Matrix decoder is done super("test/data/blackbox/datamatrix-1", new DataMatrixReader(), BarcodeFormat.DATA_MATRIX); - addTest(7, 7, 0.0f); - addTest(7, 7, 90.0f); - addTest(7, 7, 180.0f); - addTest(7, 7, 270.0f); + addTest(13, 13, 0.0f); + addTest(13, 13, 90.0f); + addTest(13, 13, 180.0f); + addTest(13, 13, 270.0f); } } \ No newline at end of file diff --git a/core/test/src/com/google/zxing/datamatrix/DataMatrixBlackBox2TestCase.java b/core/test/src/com/google/zxing/datamatrix/DataMatrixBlackBox2TestCase.java index a08f0bec..ff496035 100644 --- a/core/test/src/com/google/zxing/datamatrix/DataMatrixBlackBox2TestCase.java +++ b/core/test/src/com/google/zxing/datamatrix/DataMatrixBlackBox2TestCase.java @@ -30,7 +30,7 @@ public final class DataMatrixBlackBox2TestCase extends AbstractBlackBoxTestCase addTest(10, 10, 0.0f); addTest(13, 13, 90.0f); addTest(16, 16, 180.0f); - addTest(12, 12, 270.0f); + addTest(13, 13, 270.0f); } } -- 2.20.1