ZXing.NET speed

Hello,
I'm testing the ZXing.NET component, and have also used the latest version from codeplex.
Everything works, but on the same device detection is much slower than using Barcode Scanner app, that should be using the same java library.
Is there anythin I can do to improve detection speed?
Actually I think the problem is in autofocus, the Barcode Scanner app focuses much more quickly.
Thanks!
Mattia

Posts

  • MattiaDurliMattiaDurli ITMember ✭✭

    Correction: I meant the latest component from github.

  • CTCHANGCTCHANG AUMember ✭✭

    I did a QR scanner app before, and I am passing the captured image to the zxing library to decode. But I notice the performance will drop when a higher resolution image is being captured, as it need more time to convert the captured image to a BinaryBitmap.

  • MateoMateo USUniversity, Developer Group Leader ✭✭

    If it does not impact your process, you can also limit the possible formats.

    MobileBarcodeScanningOptions options = new MobileBarcodeScanningOptions();
    options.TryHarder = true;
    options.PossibleFormats.Add(ZXing.BarcodeFormat.CODE_128);
    options.PossibleFormats.Add(ZXing.BarcodeFormat.CODE_39);

  • MattiaDurliMattiaDurli ITMember ✭✭

    Thanks for the 2 suggestions!
    I've already gone through both of them during my tests, along with many others that greatly improved detection speed.
    Both libraries can give great results, but a lot of tweaking and tests are needed.

  • CodeMonkeyCodeMonkey GBMember ✭✭✭

    @MattiaDurli

    Would you mind sharing the 'tweaks' you implemented to increase the scanning speed? Just a brief synopsis would be great.

    Cheers

  • MattiaDurliMattiaDurli ITMember ✭✭

    Sure, you can find my analysis here:
    https://github.com/Redth/ZXing.Net.Mobile/issues/78

    with some comments about the author of zxing.net

  • GerryHighGerryHigh USBeta ✭✭✭

    In your analysis you say "Hello, after many tests and small modifications to yours and to ZXing.NET library, I achieved very good results and improved detection speed.
    Testing on the same devices, the original code can make a decode test every 800ms, and I managed to bring it down to <100ms"

    You didn't post those mods--if they are simple perhaps a gist would be helpful. Otherwise did you consider a pull request for @redth?

  • The first change you can make is to limit the symbologies that the library needs to decode(what @MattDye states). In a previous app, we saw our scanning times go from 2+ seconds to immediate by disabling all symbologies and only enabling those that we needed.

  • JonathanDickJonathanDick CAXamarin Team, Developer Group Leader Xamurai

    I know this is an old thread but I wanted to update it in case people come here without looking at the updates on GitHub.

    Basically I took a lot of the suggestions from @MattiaDurli‌ and others and incorporated most of them (especially with regards to performance).

    Android should be much faster now, thanks everyone for all the input!

  • alandaalanda USMember

    First, thanks Gerry for offering the link, https://github.com/Redth/ZXing.Net.Mobile/issues/78barcodeScanner very useful. And I have one question that apart from the zxing, have you ever tried any other free barcode scanning resources?

  • ahaliavfoxahaliavfox USMember ✭✭

    Hi Friends, I struggled with this issue quite a while and i found at the end the solution was quite simple
    after initializing the zxing object just add this code to auto focus every 2 seconds:
    Device.StartTimer(new TimeSpan(0, 0, 0, 2), () => { if (zxing.IsScanning) zxing.AutoFocus(); return true; });

Sign In or Register to comment.