Commit graph

65 commits

Author SHA1 Message Date
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
dswitkin 5079f361ac Improved the command line test app to accept multiple arguments, a --try_harder flag, and to skip hidden files and text files.
git-svn-id: https://zxing.googlecode.com/svn/trunk@371 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-04-21 14:43:32 +00:00
dswitkin 0b7bface5b Made sure the BitmapSource subclasses do not reuse a BitArray which is too small.
git-svn-id: https://zxing.googlecode.com/svn/trunk@355 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-04-10 20:57:37 +00:00
srowen 19dbe047fd Oops, off-by-one bug fix, and some more comments
git-svn-id: https://zxing.googlecode.com/svn/trunk@350 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-04-07 20:32:17 +00:00
srowen 5659a711a2 Can now instantiate this to represent a region of a BufferedImage rather than the whole thing.
git-svn-id: https://zxing.googlecode.com/svn/trunk@349 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-04-07 20:05:11 +00:00
dswitkin 410b5b4e92 Improved the statistics reporting for the CommandLineRunner.
git-svn-id: https://zxing.googlecode.com/svn/trunk@333 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-04-01 18:30:38 +00:00
srowen 7de539a67c biasTowardsWhite was, embarassingly, not accomplishing anything mathematically. It proved to not have much value so has been removed, to simplify the code.
git-svn-id: https://zxing.googlecode.com/svn/trunk@313 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-03-26 14:42:33 +00:00
srowen 14a9eb7d20 Fixed bug in rotation code for BufferedImageMonochromeBitmapSource; fixed "SKIP_N_BARCODES" behavior to ignore barcodes already found.
git-svn-id: https://zxing.googlecode.com/svn/trunk@297 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-03-19 17:09:27 +00:00
srowen 8108ac42eb Undo earlier change that rejects TYPE_CUSTOM -- too many images parse this way, and we can still decode them in some cases. Still can't rotate them.
git-svn-id: https://zxing.googlecode.com/svn/trunk@258 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-03-10 16:26:57 +00:00
srowen a78f7f40d5 Various code tweaks and refactorings suggested by IntelliJ
git-svn-id: https://zxing.googlecode.com/svn/trunk@246 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-03-05 17:26:44 +00:00
srowen bdcf60913b Disallow BufferedImage of type TYPE_CUSTOM -- not decoding properly, and is kind of a weird case from ImageIO anyway
git-svn-id: https://zxing.googlecode.com/svn/trunk@241 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-03-03 22:45:52 +00:00
srowen 905b1f7676 Fix typo in method "isRotate*d*Supported"; don't attempt to rotate images of unknown format
git-svn-id: https://zxing.googlecode.com/svn/trunk@238 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-03-03 21:36:03 +00:00
srowen c4ee6727d6 Use TRY_HARDER hint in javase CommandLineRunner. TRY_HARDER now tries rotating the image when dealing with 1D barcodes. Clarified and fixed value type of several items in the "hints" Hashtables.
git-svn-id: https://zxing.googlecode.com/svn/trunk@235 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-03-03 19:48:08 +00:00
srowen eb2fa80eaf Biiig standardization of whitespace. 2 space indents now, no tabs.
git-svn-id: https://zxing.googlecode.com/svn/trunk@191 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-02-14 20:25:54 +00:00