PiotrFLEURY / camcode

a Flutter web camera barcode scan library
https://camcode-59c70.web.app/#/
BSD 3-Clause "New" or "Revised" License
13 stars 11 forks source link

Capture Response time is too high #22

Closed HKTareen closed 2 years ago

HKTareen commented 2 years ago

hello dear i used your package and it works well with web but the main issue are it is very slow in scanning the code as it take too much time in seconds, once it scan it just disappear like it calls releaseResource() and if and then there is no option to rescan anyother thing i have to reload my page for that,

PiotrFLEURY commented 2 years ago

Hello @HKTareen thanks for your feedback.

Performances fixes are waiting on the main branch. This is not published yet but you can make a Github reference to the main branch in your pubspec.yaml to test it.

The lifecycle was thought to be used in a one shot scan like a picker but I recently shown few usages like yours for multiple scans. I think it can be an improvement.

AndrewSheetMetal commented 2 years ago

I identified, that there is a condition, that the same Barcode must be recognized at least 2 times to trigger the callback. That makes sense, but in my tests it slowed down the detection dramatically. Therefore I created my own fork and set the minimalResultCount to 1. See: https://github.com/AndrewSheetMetal/camcode/blob/main/lib/barcode_results.dart For me the precision of the first scan was good enough, but I think the best solution would be to make the minimalResultCount a property of CamCodeScanner, so that the developer can choose between reliability and speed.

PiotrFLEURY commented 2 years ago

Hi @AndrewSheetMetal. Thank you for the analysis. I'll try to make this modification. I'm also wondering if I should include several ones in a 3.0 version in order to make this library comme back to life. You can also make a pull request from your fork to my repository. I would be pleased to include it. If you do so, I'll for sure thank you in the README as a contributor.

PiotrFLEURY commented 2 years ago

Hi @AndrewSheetMetal

I just pushed some modification waiting for merge on Pull Request #25 Can you check if it match to you expectations ? Feel free to put some comment.