ngx-scanner icon indicating copy to clipboard operation
ngx-scanner copied to clipboard

Focus box for barcode in middle portion of image

Open GaryHyland opened this issue 5 years ago • 1 comments

Is your feature request related to a problem? Please describe. Devices with high res cameras tend to have an image with high res and auto focus. The barcode tends to typically be focussed when at a certain range from the camera but I find that at that range the barcode only occupies a small part of the actual image then. So lots of background clutter which makes detection difficult and slow.

Describe the solution you'd like Would be great to just process the middle x % (say 30%) of the image/video for barcodes. A lot of true mobile apps will typically make the borders that are not scanned obscured ie opaque or have a scan box overlaid, so fit the barcode within the scan box. Think this, along with ability to select a higher res eg. 1024 width would significantly improve the detect.

Describe alternatives you've considered I could do myself by adding overlays (z-index and opacity 0.5) around the border of the image and on scan frequency get just the reqd middle portion of the image and scan. Could add params: imageScanMiddlePortion = 30 - to scan just the middle 30% of the image. Would make the scan box square I think or could even better allow for 1D codes as well by using imageScanMiddleXPortion, imageScanMiddleYPortion? Sample display barcode scan

Additional context BTW.. this project is AWESOME.. great to see the recent activity on it. Now gotta upgrade my app to Angular 10.

GaryHyland avatar Oct 27 '20 03:10 GaryHyland

Until it doesn't get implemented, you could use some of the ideas in #365 as a workaround.

odahcam avatar Feb 09 '21 03:02 odahcam