-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
Battery heat due to constant running of image processing #703
Comments
@mouradjemail what kind of device are you using? It's possible that the device just can't handle every-frame detection without getting overloaded. Also this quickstart probably does not represent the best or most optimized camera code as I'm not an expert on that, instead we are just trying to show use of the MLKit APIs. In a real app you may have better luck using an established library like @gkaldev any thoughts? |
@samtstern I tried it on Google Pixel and Huawei Y6 II so far and I noticed the same issue. |
That's really interesting, I am running the same sample on my Google Pixel (1st generation) and there's no noticeable heat up. @the-dagger got any good MLKit + CameraKit (or other library) code samples or codelabs you'd like yo share with @mouradjemail ? |
PS: the heat starts only after I launch the camera preview to scan some text. When I show the logcat I see this log printed repeatedly : |
@samtstern You bet I do! MLKit : https://github.com/the-dagger/MLKitAndroid I personally haven't faced such issue, but do let me know if you encounter the same thing in the above-mentioned repos. |
Thank you @samtstern and @the-dagger , I really appreciate your help. I'll try the links suggested by @the-dagger then I'll give you my feedback. |
Hi @mouradjemail Any updates on this one? |
Hello @the-dagger , I tried the MLKitAndroid sample and I got the same problem. Actually, battery heat is caused by the fact of trying to recognize text using a live camera preview. After all, it seems normal to me since the algorithm of live text recognition comes inside a while(true) block which results in too much CPU work. |
For what it's worth I got my Pixel device pretty hot with the samples as well. |
I am going to track this improvement and a bunch of others in #703 |
I ran this project but after few seconds of using camera in LivePreviewActivity, the battery started to heat. When I debugged the project, I figured out it's the constant call for image processing line of code that is causing the problem in CameraSource class :
frameProcessor.process();
Any solution to avoid battery heat and power drain ?
The text was updated successfully, but these errors were encountered: