C# Zxing.Net中GenericMultipleBarcodeReader的自动旋转选项
如何在Zxing.net中设置“GenericMultipleBarcodeReader”的提示“AutoRotate”。我已经设置了Try_hard=true。但对于从旋转图像中检测多个1d/2d条形码,没有结果。如果图像正确对齐,则会显示结果 编辑:在“GenericMultipleBarcodeReader”中,我使用的是“ByQuadrantReader”。这可以从正确对齐的图像中检测条形码和QR码。对于旋转的图像,它找不到任何东西C# Zxing.Net中GenericMultipleBarcodeReader的自动旋转选项,c#,zxing,C#,Zxing,如何在Zxing.net中设置“GenericMultipleBarcodeReader”的提示“AutoRotate”。我已经设置了Try_hard=true。但对于从旋转图像中检测多个1d/2d条形码,没有结果。如果图像正确对齐,则会显示结果 编辑:在“GenericMultipleBarcodeReader”中,我使用的是“ByQuadrantReader”。这可以从正确对齐的图像中检测条形码和QR码。对于旋转的图像,它找不到任何东西 MultiFormatReader multiRead
MultiFormatReader multiReader = new MultiFormatReader();
ZXing.Multi.GenericMultipleBarcodeReader byquadReader = new ZXing.Multi.GenericMultipleBarcodeReader(new ByQuadrantReader(multiReader));
Dictionary<DecodeHintType, object> hints = new Dictionary<DecodeHintType, object>();
hints.Add(DecodeHintType.TRY_HARDER, true);
List<BarcodeFormat> formats = new List<BarcodeFormat>();
formats.Add(BarcodeFormat.All_1D);
formats.Add(BarcodeFormat.QR_CODE);
hints.Add(DecodeHintType.POSSIBLE_FORMATS, formats);
****
byquadresults = byquadReader.decodeMultiple(binaryBitmap, hints);
multiformatrader multiReader=新的multiformatrader();
ZXing.Multi.GenericMultipleBarcodeReader ByQuadrandReader=新ZXing.Multi.GenericMultipleBarcodeReader(新ByQuadrandReader(multiReader));
字典提示=新建字典();
添加(DecodeHintType.TRY_,true);
列表格式=新列表();
格式。添加(条形码格式。全部1D);
格式。添加(条形码格式。QR_代码);
添加(DecodeHintType.mables_格式,格式);
****
byquadresults=byquadReader.decodeMultiple(二进制位图、提示);
任何人都可以帮助我。AutoRotate只能与条形码阅读器类一起使用
var bitmap = (Bitmap)Bitmap.FromFile("<path to your image file>");
var reader = new BarcodeReader
{
AutoRotate = true,
Options = new DecodingOptions
{
TryHarder = true,
PossibleFormats = new List<BarcodeFormat>
{
BarcodeFormat.All_1D,
BarcodeFormat.QR_CODE
}
}
};
var results = reader.DecodeMultiple(bitmap);
与
var reader = new BarcodeReader...
var reader = new BarcodeReader(new ByQuadrantReader(new MultiFormatReader()), null, null)...