-
-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use low camera resolution while scanning #1020
Conversation
Actually, I am not a fan of setting it to low. We somehow have to find a balance between performance on low-end devices and comfort on high-end ones. Setting it to low of course needs less performance but also lowers the performance on low-end devices. |
Are you sure it lowers the performance? Doesn't feel like there's any performance lapse on my Pixel 4XL. Please let me know the results of your testing. Yesterday I was at the supermarket scanning things and after about 3 minutes of usage the app started being super slow and unresponsive, and the phone felt hot. If this is on pixel 4xl, then i wonder how lower end devices might fare. If performance is indeed a problem as you say, then we would need to find another solution at high priority (like not processing every image but every other image etc). |
Oh I meant "lowers the comfort on high-end devices" Lowering the preview just lowers the needed performance |
The thing is, I'm not sure if we even need high resolution for scanning barcodes. |
If the barcode scanning is affected by this is another topic. But for me it's like, looking at the documentation:
I don't want so see a 300px image covering my whole screen, I don't expect this as long as I don't have a 10 year old phone, which of course isn't our target group. Looking at the docs I'd rather go with veryHigh (1080p) then just high (720p) Also I just did a quick test myself (Samsung S21) and let the scanning run for around a little less then 10 minutes and of course the phone warmed up a bit and smoothie wasn't running at 60FPS after that. I know this can't be said for every phone but thats why we stop the camera when going away from the scanner. No user is going to spend that much continuous time with the camera actived. |
it's not thaaaat bad :) ok it's not that great either. Maybe there's a way of doing the preview in
Samsung S21 is a very advanced device :) it's one of the newest phones available yet, my Pixel 4XL is 2 years old but very powerful and it only lasted about 3 minutes before heating up and slowing everything down. We need to test on some Huawei devices. @alexgarel could you help? |
It's also a matter of how much we care about showing high resolution camera stream to the users. @teolemon @stephanegigandet any comments ? Marvin does have a good point, but the cost of high resolution images is way too high AFAICT. If the functionality isn't affected by the resolution I wouldn't worry too much about it. @alexgarel it would be great if you can test the latest dev version and tell us how it fares on Huawei. |
Maybe there is a way to only send the scanning filed to the ml_kit but this won't save any recources in the current setup (as long as we can't check 30+ pictures per second) since we always send a new picture when the last is finished scanning |
Indeed I had some issues scanning with low resolution just now :( EDIT: Nope, not an issue with Resolution, sometimes ML scanning library just doesn't scan no matter the resolution, tested again and it scanned the products just fine this time. |
@jasmeet0817 I think I have most of the things ready to test, I have flutter doctor ok :-) |
Do you have android studio installed and the git repo setup ? If so, then it's really easy. Just connect your phone and run "main.dart" with Flutter. So step 9 from this: https://www.dummies.com/article/technology/programming-web-design/app-development/running-your-first-flutter-app-in-android-studio-272214 |
Reading MLKit's doc about implementation: https://developers.google.com/ml-kit/vision/barcode-scanning/android |
@teolemon where did you read it? But some other good information in there:
The only question is how we are going to scale down the image for ml-kit |
that's what I was alluding to as well, brain not working well :-) |
Moved discussion to #1047 |
What
Here's documentation on
startImageStream
: