Commit graph

78 commits

Author SHA1 Message Date
srowen ae635078cb "Unfix" previous fix -- account for odd ByteMatrix representation by flipping black and white to make result correct
git-svn-id: https://zxing.googlecode.com/svn/trunk@1246 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2010-03-19 12:17:29 +00:00
srowen 813f4070bf For better handling of some formats, perform rotation with help of Graphics2D
git-svn-id: https://zxing.googlecode.com/svn/trunk@1240 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2010-03-05 11:08:53 +00:00
srowen aa8ad02e16 Add pure barcode support to web app and command line
git-svn-id: https://zxing.googlecode.com/svn/trunk@1228 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2010-03-01 12:09:43 +00:00
srowen 508697a318 Related to Issue 205, but not the direct issue: read both copies of the format info and use both in determining the right one. This avoids a close, but incorrect first match throwing off the decoding. Also fix creating an image from ByteMatrix -- was inverted
git-svn-id: https://zxing.googlecode.com/svn/trunk@1226 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2010-03-01 11:04:22 +00:00
srowen 5ef5f3b02d "Split" ReaderException into subclasses to enable more useful error reporting
git-svn-id: https://zxing.googlecode.com/svn/trunk@1195 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2010-02-02 08:23:46 +00:00
dswitkin 5cc1df3c92 Finished work on the local binarizer and renamed it to HybridBinarizer. It uses the old histogram for 1D and the new approach for 2D. The unit tests don't fully demonstrate how much better this is in real-world lighting, but it pretty much solves the situation of pointing at a QR Code for 30 seconds without scanning, due to a shadow or gradient.
HybridBinarizer is now the default across all the fast clients and the unit tests.

git-svn-id: https://zxing.googlecode.com/svn/trunk@1157 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-12-13 21:08:57 +00:00
dswitkin fde805cc02 Added a --products_only flag to the CommandLineRunner.
git-svn-id: https://zxing.googlecode.com/svn/trunk@1156 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-12-13 17:19:27 +00:00
dswitkin 8ba08bb916 Added the ability to track who is throwing exceptions and how often in the core library. Uncomment to enable it.
git-svn-id: https://zxing.googlecode.com/svn/trunk@1155 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-12-13 17:10:02 +00:00
srowen b710e257eb More fixes, to cropping BufferedImages
git-svn-id: https://zxing.googlecode.com/svn/trunk@1109 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-11-13 10:46:04 +00:00
srowen a853429282 Fix a typo and add better javadoc
git-svn-id: https://zxing.googlecode.com/svn/trunk@1096 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-11-03 14:39:07 +00:00
srowen 2cc7a2c8fa Oops, rendering based on ByteMatrix was reversed, white on black (Issue 265)
git-svn-id: https://zxing.googlecode.com/svn/trunk@1095 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-11-03 13:43:53 +00:00
srowen 967afc8e64 Fix scanline stride issue
git-svn-id: https://zxing.googlecode.com/svn/trunk@1079 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-10-20 17:41:23 +00:00
srowen 7d0acf8bd9 Tiny changes to System.err usage, closed a stream, saved a reused Pattern
git-svn-id: https://zxing.googlecode.com/svn/trunk@1064 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-09-26 13:25:37 +00:00
srowen 0bf2c2a66e Boneheaded mistake: was writing transparent pixels
git-svn-id: https://zxing.googlecode.com/svn/trunk@1032 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-08-04 21:59:24 +00:00
srowen 6dbf893cb0 Add MatrixToImageWriter convenience class, small code tweaks in javase/, make ByteMatrix width/height property getters names standard
git-svn-id: https://zxing.googlecode.com/svn/trunk@1028 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-07-30 08:58:57 +00:00
dswitkin c3e5f1fcfd Modified the CommandLineRunner to use all available decoders, even the ones which aren't considered production quality yet.
git-svn-id: https://zxing.googlecode.com/svn/trunk@1000 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-06-26 20:03:10 +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
dswitkin da4f56b022 Fixed some code which was ignoring the result of MonochromeBitmapSource calls, which may work in some cases but isn't legal and failed and in some experiments.
git-svn-id: https://zxing.googlecode.com/svn/trunk@986 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-06-25 19:46:49 +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 0fe2f0365f Wrote a usage message for the CommandLineRunner.
git-svn-id: https://zxing.googlecode.com/svn/trunk@962 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-05-28 18:59:11 +00:00
dswitkin 70eab118c1 You can now dump the black point for URLs to the pwd.
git-svn-id: https://zxing.googlecode.com/svn/trunk@954 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-05-26 18:12:22 +00:00
dswitkin 0a4e715ae4 Extended the command line tool to dump the results of black point calculation. You can now use the flag --dump_black_point to generate a PNG which contains the original image, the row scanning monochrome version, and the 2D scanning monochrome version side by side. It will be saved as originalfilename.mono.png.
git-svn-id: https://zxing.googlecode.com/svn/trunk@953 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-05-26 16:39:00 +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 6d472ea18a Removed deprecation of 'cropping' constructor -- in the end replacing it introduced some non-trivial performance hit, not worth it
git-svn-id: https://zxing.googlecode.com/svn/trunk@938 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-05-11 21:42:07 +00:00
srowen 29d7d6443e Issue 183: Adds support for detecting multiple barcodes, and simplifies ResultPoint abstraction
git-svn-id: https://zxing.googlecode.com/svn/trunk@918 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-04-28 17:35:33 +00:00
dswitkin c1bc060065 Changed the order of the BaseMonochromeBitmapSource constructor arguments to be width, height to match the rest of the codebase, and added two apparently missing methods to the J2ME subclass, although I can't test it.
git-svn-id: https://zxing.googlecode.com/svn/trunk@874 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-03-06 16:52:35 +00:00
srowen f2a9165b7c Refactored width/height values into superclass and enabled construction of RGBMonochromeBitmapSource from a Bitmap
git-svn-id: https://zxing.googlecode.com/svn/trunk@846 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-02-09 21:25:45 +00:00
srowen 5efb6ef335 Separated rectangle detection from decoder for reuse
git-svn-id: https://zxing.googlecode.com/svn/trunk@824 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2009-01-14 10:44:46 +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 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 131cfe4c5c More reckless refactoring and code style tweaks -- mostly adding braces around conditional/loops, and using @Override
git-svn-id: https://zxing.googlecode.com/svn/trunk@784 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-12-11 23:34:49 +00:00
srowen 62d9959a3c Remove my old email address from files. Might as well save spammers the trouble.
git-svn-id: https://zxing.googlecode.com/svn/trunk@706 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-11-15 00:07:25 +00:00
srowen 79d7b01e9e Updated qrcode-2 with corrected output for some Japanese-language results. Also standardized on UTF-8 encoding for test result files and enabled --dump_results for single-file case.
git-svn-id: https://zxing.googlecode.com/svn/trunk@663 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-11-02 11:06:20 +00:00
dswitkin 952dc0ea77 Added a --dump_results flag to the J2SE client, which will create a text file of the contents of each file scanned. This is very useful for adding golden results for new blackbox images tests.
git-svn-id: https://zxing.googlecode.com/svn/trunk@657 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-10-31 17:57:31 +00:00
dswitkin 8671371c59 Did a big refactoring on the MonochromeBitmapSource. I removed all the caching luminance calls and converted them to getting luminance data on demand. This saved another 33,000 function calls per rejected scan, good for another 15 ms savings. I also moved the luminance calls to BaseMonochromeBitmapSource and made them protected, to indicate that the decoders shouldn't use them.
Overall the recent optimizations took one rejected scan from 307 to 135 ms, which is definitely noticeable.

WARNING: I am not able to build the Bug or J2ME clients, but I believe they are correct.

git-svn-id: https://zxing.googlecode.com/svn/trunk@656 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-10-30 18:44:10 +00:00
srowen 96f6428eea Add column caching to MonochromeBitmapSources and use it to improve Data Matrix speed
git-svn-id: https://zxing.googlecode.com/svn/trunk@631 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-10-22 08:43:56 +00:00
srowen 7e022edf66 Improved error message when file/URI is mistyped.
git-svn-id: https://zxing.googlecode.com/svn/trunk@598 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-10-04 10:12:17 +00:00
dswitkin bacd1469af - Fixed a crash when parsing a particular VCard with a blank entry.
- Trimmed whitespace around many fields to sanitize the results (this is very useful upstream, for example we hyphenate phone numbers on Android but can't tolerate extra whitespace).
- Fixed a bug with 1D result points when scanning upside down - they needed to be mirrored to draw correctly.

git-svn-id: https://zxing.googlecode.com/svn/trunk@592 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-09-29 18:45:00 +00:00
dswitkin 3a4d3e1ed2 Updated Alasdair's ImageConverter tool to take -row and -2d arguments to evaluate our black point estimators. Also converted the output format to png and added red lines when the dynamic range was insufficient to calculate a meaningful black point.
git-svn-id: https://zxing.googlecode.com/svn/trunk@551 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-08-06 17:53:12 +00:00
dswitkin f5fb52c464 Added which format was decoded to the CommandLineRunner output.
git-svn-id: https://zxing.googlecode.com/svn/trunk@459 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-06-20 18:35:42 +00:00
srowen e0db8f9271 Standardize and update all copyright statements to name "ZXing authors" as suggested by open-source team to correctly attribute copyright in a project with contributions from several sources.
git-svn-id: https://zxing.googlecode.com/svn/trunk@455 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-06-19 20:56:24 +00:00
srowen 6effdd4bd0 Renamed core OSGi bundle to "ZXing"; removed "level=" attribute on <jar> tasks since it singlehandly introduces a depence on Ant 1.7 and doesn't buy much. OS X for example does not ship with Ant 1.7 yet.
git-svn-id: https://zxing.googlecode.com/svn/trunk@437 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-06-18 17:40:14 +00:00
srowen 31b8b3d226 Small tweaks on top of Daniel's excellent refactoring
git-svn-id: https://zxing.googlecode.com/svn/trunk@420 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-06-12 12:51:26 +00:00
dswitkin 9adb83bbd3 Refactored the MonochromeBitmapSource hierarchy to share a great deal of code and shrink the derived classes considerably.
git-svn-id: https://zxing.googlecode.com/svn/trunk@418 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-06-11 23:52:35 +00:00
srowen f5b58916c1 Fix bad logic black point estimator, improving threshold estimation performance (and adjust some == to .equals())
git-svn-id: https://zxing.googlecode.com/svn/trunk@417 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-06-11 19:59:38 +00:00
srowen 284c1776d5 A few more cleanups while I'm at it in GUIRunner
git-svn-id: https://zxing.googlecode.com/svn/trunk@414 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-06-11 13:26:05 +00:00
srowen 6c4fe1633f Fixed a tiny deprecation warning
git-svn-id: https://zxing.googlecode.com/svn/trunk@413 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-06-11 13:21:02 +00:00
srowen 37559bac63 A simple GUI interface -- still needs work
git-svn-id: https://zxing.googlecode.com/svn/trunk@396 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-05-10 23:53:19 +00:00
srowen 635d904283 Many more little tweaks from IntelliJ inspections
git-svn-id: https://zxing.googlecode.com/svn/trunk@382 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-05-02 19:18:14 +00:00
dswitkin 0987663963 Added some simple sharpening for 1D decoding which allowed a couple more blackbox images to pass. There were a few cases where the format or content is now misdetected, but since the net gain was positive I decided to make those non-fatal errors. In real world use the sharpening seems to help, and I think we can do even better with a better algorithm.
git-svn-id: https://zxing.googlecode.com/svn/trunk@372 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-04-21 18:11:02 +00:00