Sascha4j
unread,May 13, 2015, 4:29:10 AM5/13/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to zx...@googlegroups.com
hello,
i am new to zxing. i try to read a datamatrix code from a scanned Image (part4.jpg). i read, that the datamatrix code must be centered on the image to detect and decode it. so i try to cut it from the image in a nearly centered image. but none of the attached images worked. any hints what i could do ? may be zoomin or out ? blur?
this is the code i use for decoding
Map<DecodeHintType, Object> hints = new EnumMap<DecodeHintType, Object>(
DecodeHintType.class);
hints.put(DecodeHintType.POSSIBLE_FORMATS,
Arrays.asList(BarcodeFormat.DATA_MATRIX));
hints.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
BufferedImage sourceimage = ImageIO.read(new FileInputStream(
filename));
BinaryBitmap binaryBitmap = new BinaryBitmap(new HybridBinarizer(
new BufferedImageLuminanceSource(sourceimage)));
Result result2 = new DataMatrixReader().decode(binaryBitmap, hints);
System.out.println(result2.getText());