我想使用zxing庫(GenericMultipleBarcodeReader)讀取二維數據矩陣條形碼。我在單個圖像上有多個條形碼。使用zxing庫讀取多個條形碼問題
的問題是,在尖嘯聲讀取器的效率是很低的,它 識別從圖像1.png 1個條形碼和沒有從具有48個條形碼圖像2.png條形碼。有 任何方式來獲得100%的效率或導致100%的任何其他庫
我的代碼來讀取條形碼是:
public static void main(String[] args) throws Exception {
BufferedImage image = ImageIO.read(new File("1.png"));
if (image != null) {
LuminanceSource source = new BufferedImageLuminanceSource(image);
BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
DataMatrixReader dataMatrixReader = new DataMatrixReader();
Hashtable<DecodeHintType, Object> hints = new Hashtable<DecodeHintType, Object>();
hints.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
GenericMultipleBarcodeReader reader = new GenericMultipleBarcodeReader(
dataMatrixReader);
Result[] results = reader.decodeMultiple(bitmap, hints);
for (Result result : results) {
System.out.println(result.toString());
}
}
}
我使用的圖像是:
請幫忙解決此問題。
感謝
@肖恩 - 感謝您的回覆,請告訴我是條碼的角度也可能是讀條碼的問題? – Raman
它應該能夠以所有這些角度進行掃描,但是它在豎直時會更好地工作。 –