Using zxing 1.4 I have a program that fails to read a barcode from a
bmp image but when I reduce the image size the barcode is read
correctly. Links to the images are below
http://docs.google.com/leaf?id=0B_itXQtxM-uXMzJhNTY3YTctMjJjOS00ZjI4LWEyZjktNDI2OGRlN2EwMDg4&hl=en
http://docs.google.com/leaf?id=0B_itXQtxM-uXMTQ0ZGM1MzEtOWY0OC00YzQzLThmM2MtYzg4YTQ2MGQ0YTkz&hl=en
The code is:
Hashtable<DecodeHintType, Object> hints = null;
hints = new Hashtable<DecodeHintType, Object>(3);
hints.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
LuminanceSource source = new
BufferedImageLuminanceSource(bufferedImage);
BinaryBitmap bitmap = new BinaryBitmap(new
GlobalHistogramBinarizer(source));
Reader reader = new Code39Reader();
result = reader.decode(bitmap, hints);
I noticed on a similar discussion about a tiff related problam that a
HybridBinarizer might produce better results. Is there a later
version as I could not find this class in 1.4.
Thanks
I'll run these myself and try to see what's going on.
Yes you want to use the latest code in Subversion if what you need
isn't in 1.4. I will probably cut 1.5 shortly anyway.
However a couple rows in the image do happen to work. "Try harder"
reads a lot of rows but not every one, and it so happens that in one
image it hits such a row but not in the other.
I was able to fix this by just having it try a little harder, which is
fine. I committed the fix, which comes after the recent 1.5 release,
so you still want to look to Subversion.