【发布时间】:2015-01-21 18:42:03
【问题描述】:
我的目标是在这样的较大图像(四大)上检测多个数据矩阵:
根据几个代码示例,我做了一个小测试程序:
Bitmap image = getImage();
DataMatrixReader reader = new DataMatrixReader();
GenericMultipleBarcodeReader genericReader = new genericMultipleBarcodeReader(reader);
Dictionary<DecodeHintType, object> hints = new Dictionary<DecodeHintType,object>();
hints.Add(DecodeHintType.TRY_HARDER, true);
BitmapLuminanceSource source = new BitmapLuminanceSource(image);
HybridBinarizer binarizer = new HybridBinarizer(source);
BinaryBitmap binaryBitmap = new BinaryBitmap(binarizer);
Result[] results = genericReader.decodeMultiple(binaryBitmap,hints);
show(results);
它无法检测到大图像上的任何代码。
但是当它被这样裁剪时,它可以检测到代码:
之后我合并了两个生成的数据矩阵,也失败了:
最后我又用略微裁剪的图像进行了两次测试,都失败了:
所以看来这个库根本不健壮,或者我用错了。
知道如何改进我的结果吗? (包括其他库和预处理)
【问题讨论】:
标签: c# zxing datamatrix