This project has moved. For the latest updates, please go here.

Performance pretty low

Jun 27, 2013 at 10:40 PM
Hi,

I am quite unhappy with the performance of ZXing.Net, but before making someone guilty, I would like to ask you if you see anything incorrect in this 100-Lines piece of Code

My ScanCode class

I am trying to recognize 13 & 8 EAN-Formats.

Thank you
Jun 28, 2013 at 12:10 PM
I just realize that EAN8 works fine, but EAN13 won't work.

All I am doing is
 Reader _reader = new ZXing.OneD.EAN13Reader();
this gives me ne result, when I try to get it via
try
            {
                _camera.GetPreviewBufferY(_luminance.PreviewBufferY);
                var binarizer = new HybridBinarizer(_luminance);
                var binBitmap = new BinaryBitmap(binarizer);
                var result = _reader.decode(binBitmap);

                if (result != null)
                {
                    FileManagement.saveFile("barcode", result.Text, null);
                    goBack();
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
Coordinator
Jul 1, 2013 at 8:13 PM
Please take a look a the WP8 demo. It's completely reworked by Fabian.
https://zxingnet.svn.codeplex.com/svn/trunk/Clients/WindowsPhone8Demo
The current version doesn't use a timer anymore and uses a better focus approach.
I think your timer with 80ms can give a low performance.

For your problem with an EAN-13 barcode I need a sample image which I can test.

And last but not least a small code snippet which shows you the use of BarcodeReader with
only a selection of supported barcode formats. (works with the current svn source)
Reader _reader = new ZXing.BarcodeReader { PossibleFormats = new List { BarcodeFormat.EAN8, BarcodeFormat.EAN13 } };
...
try
{
    _camera.GetPreviewBufferY(_luminance.PreviewBufferY);
    var result = _reader.decode(_luminance);
    if (result != null)
    {
        FileManagement.saveFile("barcode", result.Text, null);
        goBack();
    }
}
catch (Exception ex)
{
    Debug.WriteLine(ex.Message);
}