Commit graph

196 commits

Author SHA1 Message Date
dswitkin b238cb7828 I noticed that the codeword coordinates in PDF 417 barcodes were a few pixels off if there was skew or rotation in the image. I added a simple method to correct the vertical component of these points, and the units tests went from 8/23 to 11/23.
git-svn-id: https://zxing.googlecode.com/svn/trunk@1015 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-07-02 20:07:09 +00:00
dswitkin 0944a2bb18 Got 180 degree rotation working for PDF 417, and turned on the appropriate unit tests as a result.
git-svn-id: https://zxing.googlecode.com/svn/trunk@1014 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-07-01 19:42:52 +00:00
dswitkin c31b489efe Added the second PDF 417 test to the AllPositiveBlackBoxTester.
git-svn-id: https://zxing.googlecode.com/svn/trunk@1011 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-07-01 15:13:44 +00:00
dswitkin 01eed5266e - Converted parts of the PDF 417 reader to use BitMatrix.
- Changed the PDF 417 detector to search the image more broadly, instead of assuming the barcode starts in the left 1/4 and ends in the right 1/4. We now get 8/23 on the real-world blackbox test, and we'll probably do even better with further improvements here.
- Added a quiet zone to two of the unit test images and updated a golden result for one of them. We now get 3/7 on the first test.
- Tried to fix some bugs in the upside down code but it still doesn't work.

git-svn-id: https://zxing.googlecode.com/svn/trunk@1010 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-06-30 21:55:19 +00:00
dswitkin f5124cec37 Created a new blackbox unit test of real-world PDF 417 images taken with an Android device. Currently we decode 0/23.
git-svn-id: https://zxing.googlecode.com/svn/trunk@1008 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-06-30 18:47:34 +00:00
dswitkin 2397216901 Added a few computer-generated PDF 417 barcodes to the blackbox tests. The current code doesn't seem to handle more advanced error correction modes.
git-svn-id: https://zxing.googlecode.com/svn/trunk@1007 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-06-30 17:32:12 +00:00
dswitkin eb8b9677cf Added the previous Android benchmark I've been using to track performance, as well as a new one which uses wider images and therefore twice as many pixels.
git-svn-id: https://zxing.googlecode.com/svn/trunk@1006 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-06-29 22:08:38 +00:00
dswitkin e2324bc2ae Added slightly better blackbox unit test stats.
git-svn-id: https://zxing.googlecode.com/svn/trunk@1005 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-06-29 21:57:59 +00:00
dswitkin 10dfe7789b - Got the DataMatrix decoder compiling again with a quick bandaid.
- Fixed two bugs in the LocalBlockBinarizer sharpening routine. It can now decode 2132 images in our blackbox tests, compared to 2103 using the global histogram approach.
- Added the PDF 417 blackbox test to AllPositiveBlackBoxTester, and allowed it to complete even if the tests fail.

git-svn-id: https://zxing.googlecode.com/svn/trunk@1004 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-06-29 15:49:42 +00:00
dswitkin 167197ec7a Refactored the MonochromeBitmapSource class hierarchy into LuminanceSource, Binarizer, and BinaryBitmap classes. The unit tests pass and I believe the change is complete, but there are some clients like J2ME and Bug that I can't build.
This change will allow new thresholding algorithms to be developed and tested, as well as implemented per platform if needed (e.g. in JNI on Android). It should also perform better when multiple 2D Readers are installed, because the underlying image will only be converted to 1 bit once. It also allows some platforms to return luminance data without a copy.

The current state of this checkin is to use the old black point algorithm, which now lives in GlobalHistogramBinarizer. This will be our benchmark and fallback for slower platforms. Going forward we will begin to use LocalBlockBinarizer as I shake out the edge cases and tune it for performance. Currently it is unused.

IMPORTANT: I have temporarily included three methods from MonochromeBitmapSource at the end of BinaryBitmap as a way to make this change in stages. They are deprecated and will be removed soon. All of the Reader classes will need to change the way they examine 1 bit pixels to use the new getBlackRow() and getBlackMatrix() calls.

git-svn-id: https://zxing.googlecode.com/svn/trunk@993 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-06-26 17:49:45 +00:00
srowen 969088fa82 Style changes mostly
git-svn-id: https://zxing.googlecode.com/svn/trunk@985 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-06-24 13:19:53 +00:00
kev.sully 372dfa1145 ISSUE: http://code.google.com/p/zxing/issues/detail?id=42
Added PDF417 to list of readers. Will be used only if its specified in a Hint.

git-svn-id: https://zxing.googlecode.com/svn/trunk@984 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-06-24 10:03:37 +00:00
kev.sully ffbbda2086 ISSUE: http://code.google.com/p/zxing/issues/detail?id=42
Added PDF417 to list of readers. Will be used only if its specified in a Hint.

git-svn-id: https://zxing.googlecode.com/svn/trunk@983 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-06-24 10:02:58 +00:00
dswitkin b613112615 Rewrote BitMatrix to allow rectangular 2D arrays, and so that every row begins with a new int, which makes it fast to copy out rows into BitArrays. This will be the basis of the upcoming bitmap refactoring for 1D Readers.
git-svn-id: https://zxing.googlecode.com/svn/trunk@978 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-06-22 21:03:34 +00:00
dswitkin 7fec06465a Continuing with the x, y coordinate push, BitMatrix is now standardized. I also converted DataMask back to i, j for now to be consistent with the rest of the QR module, and made sure all the tests still pass.
git-svn-id: https://zxing.googlecode.com/svn/trunk@977 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-06-22 19:52:51 +00:00
srowen 4b7e5e6461 Remove getBits()
git-svn-id: https://zxing.googlecode.com/svn/trunk@976 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-06-22 17:48:37 +00:00
dswitkin 5f2b64ee50 Used IntelliJ's amazing refactoring functions to change the argument ordering of ByteMatrix. I want to standardize this across ZXing: the first component should always be horizontal and the second vertical, whether supplying an x, y point or a width, height pair. Also, we should always use x and y as variables with x being the horizontal component to avoid confusion.
git-svn-id: https://zxing.googlecode.com/svn/trunk@975 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-06-22 15:50:08 +00:00
srowen 63a1dc62a3 Issue 198
git-svn-id: https://zxing.googlecode.com/svn/trunk@972 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-06-19 13:23:09 +00:00
dswitkin 9f509172b6 Wrote a quick command line app to calculate how many total images are passing our blackbox unit tests. This could use some improvement but it's a start.
git-svn-id: https://zxing.googlecode.com/svn/trunk@971 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-06-18 20:55:42 +00:00
dswitkin 1da9bd60b3 Added a new blackbox test with extreme shadows and highlights. We do pretty poorly on this, but I've been experimenting with local thresholding algorithms which are a night and day improvement.
Also made the ImageConverter app ignore some kinds of files.

git-svn-id: https://zxing.googlecode.com/svn/trunk@969 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-06-16 18:47:34 +00:00
dswitkin c07fad6410 Created a new QR blackbox test with difficult exposures, mostly self-shadowing cases. We only get 34 out of 120 tests, which is about what I expected. To fix these we will have to move away from a global black point and towards a more sophisticated local thresholding algorithm.
git-svn-id: https://zxing.googlecode.com/svn/trunk@961 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-05-28 18:45:48 +00:00
srowen 58c367d9ea Improvement to Shift_JIS encoding detector to avoid detecting some UTF-8 strings as Shift_JIS
git-svn-id: https://zxing.googlecode.com/svn/trunk@955 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-05-27 09:14:17 +00:00
dswitkin ec77a581d2 Changed the 2D histogram calculation to sample four rows spread across the image rather than taking a diagonal. We get a net increase of 63 blackbox tests with this change.
git-svn-id: https://zxing.googlecode.com/svn/trunk@950 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-05-22 20:59:15 +00:00
dswitkin 51ade2ca96 Added better logging for our blackbox tests. It now displays the number of images which passes per test out of the total, and the percentage. It also warns when a blackbox test is too lax (i.e. we've made decoding improvements but haven't raised the high water mark).
git-svn-id: https://zxing.googlecode.com/svn/trunk@947 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-05-21 21:18:27 +00:00
dswitkin 6687d5772f Fixed a typo in our golden results.
git-svn-id: https://zxing.googlecode.com/svn/trunk@946 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-05-21 20:29:56 +00:00
dswitkin e19e9a83f6 I moved a chunk of the histogram/black point code out of BaseMonochromeBitmapSource and into BlackPointEstimator which makes a lot more sense. Unfortunately I had to expose three new methods and touch a bunch of files. But I did manage to reuse an array on subsequent calls, which was being allocated on every row scanned, so that might be a bit faster. It will also be easier to convert this code to JNI in the future if we want to, and/or do more advanced thresholding.
git-svn-id: https://zxing.googlecode.com/svn/trunk@945 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-05-21 19:56:25 +00:00
srowen 949eca972e Adding a few test images from a defunct issue report
git-svn-id: https://zxing.googlecode.com/svn/trunk@919 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-04-28 22:29:30 +00:00
srowen e9c19530cc Improve URL detection rule to exclude stuff like "Hi."
git-svn-id: https://zxing.googlecode.com/svn/trunk@914 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-04-18 08:57:32 +00:00
dswitkin 02f779cbee Fixed or removed a bunch of TODOs, and enforced the 100 columns limit in a bunch of places. Also allowed QR Codes to be encoded of contacts without names.
git-svn-id: https://zxing.googlecode.com/svn/trunk@907 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-04-13 21:20:11 +00:00
srowen d4e82758eb Issue 158: Correct some off-by-one problems in Data Matrix detector and a few more improvements, ignore unsupported DM symbols
git-svn-id: https://zxing.googlecode.com/svn/trunk@895 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-04-06 21:22:07 +00:00
dswitkin dfb6b60dd4 - Added a new unit test of 13 ITF images I took with a T-Mobile G1.
- Added upside down unit tests for the existing ITF images.
- Removed the temporary format code from these tests now that ITF is on by default.

git-svn-id: https://zxing.googlecode.com/svn/trunk@883 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-03-09 20:48:48 +00:00
srowen 8b339661d9 Some clever, perhaps too-clever optimization of masking code
git-svn-id: https://zxing.googlecode.com/svn/trunk@877 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-03-06 22:55:19 +00:00
srowen 415c9257d6 Fix #150 again by moving towards a more RFC 2822-compliant definition of valid syntax
git-svn-id: https://zxing.googlecode.com/svn/trunk@872 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-03-06 15:17:38 +00:00
srowen ddffcde9f4 Address Issue 152
git-svn-id: https://zxing.googlecode.com/svn/trunk@869 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-03-05 02:19:48 +00:00
srowen 8e18d651bb Tightened a condition to reduce accidentally detecting the alignment pattern as a finder pattern
git-svn-id: https://zxing.googlecode.com/svn/trunk@856 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-02-15 09:43:40 +00:00
srowen db61519508 More changes in the direction of supporting ECI in the encoder
git-svn-id: https://zxing.googlecode.com/svn/trunk@837 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-01-31 20:17:43 +00:00
srowen 4d225d48e1 Fix a nagging inconvenience from my IDE in running tests, due to working directory issues
git-svn-id: https://zxing.googlecode.com/svn/trunk@832 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-01-28 19:03:25 +00:00
dswitkin 0a885aca56 Added 18 real world DataMatrix blackbox images, plus turned on rotation for the original set.
git-svn-id: https://zxing.googlecode.com/svn/trunk@815 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-01-06 21:11:55 +00:00
srowen d0bc7df5d4 On a tip from Sandy found an error in the QR code detector that would miss a third finder pattern in cases of about 135 degree rotation. This changes test results but is a net win.
git-svn-id: https://zxing.googlecode.com/svn/trunk@814 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-01-04 21:11:25 +00:00
srowen 9433c5955b Add more unit tests for client.result, and more small code tweaks.
git-svn-id: https://zxing.googlecode.com/svn/trunk@809 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-12-30 15:31:25 +00:00
dswitkin 3269c66e77 Moved one file back to the ITF directory because it should be readable.
git-svn-id: https://zxing.googlecode.com/svn/trunk@806 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-12-23 17:21:31 +00:00
kev.sully 12a283ebf9 ISSUE: http://code.google.com/p/zxing/issues/detail?id=110
Moved failing test cases to partial.

git-svn-id: https://zxing.googlecode.com/svn/trunk@805 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-12-23 12:11:14 +00:00
kev.sully c1ee018a50 ISSUE: http://code.google.com/p/zxing/issues/detail?id=110
Moved failing test cases to partial.

git-svn-id: https://zxing.googlecode.com/svn/trunk@804 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-12-23 12:10:30 +00:00
dswitkin 96b80c3550 Turned on ITF as a format you can request via hint. Also rejiggered the unit test framework to accept an optional hint so that the ITF unit test runs (and passes) without modifying the source.
git-svn-id: https://zxing.googlecode.com/svn/trunk@803 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-12-22 22:58:58 +00:00
kev.sully 0a3ddd33dc ISSUE: http://code.google.com/p/zxing/issues/detail?id=110
Added more test cases for ITF

git-svn-id: https://zxing.googlecode.com/svn/trunk@802 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-12-22 12:41:14 +00:00
kev.sully 5545bdb317 ISSUE: http://code.google.com/p/zxing/issues/detail?id=110
Added more test cases for ITF

git-svn-id: https://zxing.googlecode.com/svn/trunk@801 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-12-22 12:40:37 +00:00
dswitkin f50dcf6d27 Added golden results to all of our result parsing unit tests, uncovering and fixing a few subtle bugs in the process. I also expanded a few of them which were lean.
git-svn-id: https://zxing.googlecode.com/svn/trunk@796 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-12-19 20:20:54 +00:00
dswitkin 48480eba95 Fixed crash and bad parsing of an SMS with a question mark in the subject or message.
git-svn-id: https://zxing.googlecode.com/svn/trunk@794 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-12-19 15:00:20 +00:00
srowen 6c5b6849b7 Another attack on integrating encoder and decoder: Version is done. Attempted to rationalize encoding API to deal with strings, not bytes. More code style changes like removal of 'final' on locals and arguments.
git-svn-id: https://zxing.googlecode.com/svn/trunk@781 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-12-10 00:22:14 +00:00
dswitkin f265d0872f Made our parsing code handle uppercase prefixes for a variety of loosely-defined formats.
git-svn-id: https://zxing.googlecode.com/svn/trunk@779 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-12-08 23:08:23 +00:00