Detection resolutions affects performance
tigertore opened this issue · 0 comments
Hi,
Thanks for a great flutter plugin.
I have tested this plugin on some Android devices,
and I see very different detection image resolutions.
Also within different pages in the same App on the same device.
In one page I get detection image resultion of 3648 x 2736.
On another page I get 640x480.
Inspecting it with the debugger I see that my Huawei P30 Pro
returns a list of camera resolutions which is not sorted.
Your plugin expects it to be ascending or descending and that causes it to pick different/wrong resolutions.
I suspect the high resolution (3648 x 2736) causes higher CPU load, and that affects the detection performance.
Also the distance to the barcode can be longer with high resolution, and you risk detecting other barcodes nearby.
Adding sorting of the list would make it more reliable.
Logging of the select detection resolution in the logs, would also be nice.
Breakpoint when we get 640x480:
Breakpoint when we get 3648x2736:
Breakpoint when list is sorted correctly, from SurfaceTexture: