decode hints combination

24 views
Skip to first unread message

junfei wang

unread,
Jan 18, 2013, 1:47:58 PM1/18/13
to zx...@googlegroups.com
I think I have to open a brand new thread about my problem so far.
the link above is the image I want to decode. This is a random byte array encoded with ISO-8859-1. When I used the barcode scanner app, it has no problem;
when I want to decode it with my own app, it throws notfound exception.
This is my code for decoding: 
                           LuminanceSource source = new PlanarYUVLuminanceSource(data,640,480,0,0,640,480,false);
   bmtobedecoded = new BinaryBitmap(new HybridBinarizer(source));
   Map<DecodeHintType,Object> mp=new HashMap<DecodeHintType, Object>();
   mp.put(DecodeHintType.CHARACTER_SET, "ISO-8859-1");
   mp.put(DecodeHintType.PURE_BARCODE, true);
    //Vector formats = new Vector();
   // formats.addElement(BarcodeFormat.QR_CODE);
   // mp.put(DecodeHintType.POSSIBLE_FORMATS, formats);
   // mp.put(DecodeHintType.TRY_HARDER, true);
  // mp.put(DecodeHintType.ASSUME_CODE_39_CHECK_DIGIT, true);
   qrr.setHints(mp);
   try {
result= qrr.decodeWithState(bmtobedecoded);
// Log.i("123","decoded byte array "+java.util.Arrays.toString(result.getRawBytes()));
} catch (NotFoundException e) {
Log.i("123","not found");
e.printStackTrace();
}  

I can't see any difference between my code with the one in Barcode Scanner app, can someone help me with this issue?

junfei wang

unread,
Jan 18, 2013, 1:50:31 PM1/18/13
to zx...@googlegroups.com
btw, qrr is just a MultiFormatReader, initially I used QRCodeReader, then I decided to follow the barcode scanner app.
Reply all
Reply to author
Forward
0 new messages