C# ZXing.Net ITF条码发布Windows Phone 8.1

C# ZXing.Net ITF条码发布Windows Phone 8.1,c#,windows-phone-8.1,zxing,barcode-scanner,C#,Windows Phone 8.1,Zxing,Barcode Scanner,我可以使用ZXing.Net成功解码条形码ITF,但在某些情况下,结果文本中缺少一些数字,如下所示: 原始条码:83690000008262500403007233338786038100661049195 结果.文本:836900000026250040300 23333878603 10066104919 在这种情况下,缺少8、7、8和5 在另一种情况下,数字被重新排序为随机顺序,并且缺少一些数字: 原始条码:23793381285017475716618000050809162310000

我可以使用ZXing.Net成功解码条形码ITF,但在某些情况下,结果文本中缺少一些数字,如下所示:

原始条码:83690000008262500403007233338786038100661049195 结果.文本:836900000026250040300 23333878603 10066104919

在这种情况下,缺少8、7、8和5

在另一种情况下,数字被重新排序为随机顺序,并且缺少一些数字:

原始条码:23793381285017475716618000050809162310000010000 结果。文本23791623100000100338125017475716180005080

你知道为什么会这样吗

谢谢

编辑:06/12/2015 如果我没有指定可能的格式,解码器将所有代码(此处的图像为:1drv.ms/1B6wD5c)解码为ITF,结果与上述相同。我使用的代码如下:

    public BarCodeReaderService(IDialogService _dialogService)
    {
        dialogService = _dialogService;

        barcodeReader = new BarcodeReader
        {
            Options = new DecodingOptions
            {
                PureBarcode = true,
                TryHarder = true,
                PossibleFormats = new BarcodeFormat[] { BarcodeFormat.ITF }
            },

        };
    }

    public async Task<string> ScanBitmapAsync(StorageFile file)
    {
        string result = null;
        using (var stream = await file.OpenReadAsync())
        {
            // initialize with 1,1 to get the current size of the image
            var writeableBmp = new WriteableBitmap(1, 1);
            writeableBmp.SetSource(stream);
            // and create it again because otherwise the WB isn't fully initialized and decoding
            // results in a IndexOutOfRange
            writeableBmp = new WriteableBitmap(writeableBmp.PixelWidth, writeableBmp.PixelHeight);
            stream.Seek(0);
            writeableBmp.SetSource(stream);


            try
            {
                result = ScanBitmap(writeableBmp);
            }
            catch (Exception ex)
            {
                dialogService.ShowAsync("Ocorreu um erro \n" + ex.Message, "Erro");
            }
        }

        return result != null ? result : null;
    }

    private string ScanBitmap(WriteableBitmap writeableBmp)
    {

        var result = barcodeReader.Decode(writeableBmp);

        return result != null ? result.Text : null;
    }
公共条形码阅读器服务(IDialogService\u dialogService)
{
dialogService=\u dialogService;
条形码阅读器=新条形码阅读器
{
选项=新的解码选项
{
PureBarcode=true,
TryHarder=true,
可能格式=新的条形码格式[]{BarcodeFormat.ITF}
},
};
}
公共异步任务ScanBitmapAsync(存储文件)
{
字符串结果=null;
使用(var stream=await file.OpenReadAsync())
{
//使用1,1初始化以获取图像的当前大小
var writeableBmp=新的WriteableBitmap(1,1);
writeableBmp.SetSource(流);
//并再次创建它,因为否则WB没有完全初始化和解码
//结果是一个指数崩盘
writeableBmp=新的WriteableBitmap(writeableBmp.PixelWidth,writeableBmp.PixelHeight);
stream.Seek(0);
writeableBmp.SetSource(流);
尝试
{
结果=扫描位图(可写位图);
}
捕获(例外情况除外)
{
dialogService.ShowAsync(“Ocorreu um erro\n”+例如消息“erro”);
}
}
返回结果!=null?结果:null;
}
私有字符串扫描位图(WriteableBitmap writeableBmp)
{
var结果=条形码阅读器.Decode(writeableBmp);
返回结果!=null?结果。文本:null;
}

丢失的数字确实是验证数字,必须进行计算。

我需要一张样本图像进行分析。我试图读取的ITF条形码来自巴西银行票据,如信用卡、水单等。这些图像对我来说都是样本条形码。我尝试了另外两个在线解码器,它们给出了相同的结果。在我看来,您的“原始条形码”值是错误的。我不知道你从哪里弄来的。但是您丢失的数字不包括在条形码中。它们只打印在人类可读的文本中。也许它们还有另一种含义。这些值打印在银行单据上,也许它们是验证号,只有在键入代码时才可用。现在我知道问题不在解码器上,我会做一些研究。谢谢