quagga2 icon indicating copy to clipboard operation
quagga2 copied to clipboard

Is there a way to display the border of the current detection area or otherwise show where it is?

Open vlad-at-work opened this issue 3 years ago • 4 comments

Besides passing padding to the area prop, is there a way to know where exactly quagga is looking at for barcodes?

vlad-at-work avatar May 19 '21 11:05 vlad-at-work

Thank you for filing an issue! Please be patient. :-)

github-actions[bot] avatar May 19 '21 11:05 github-actions[bot]

I think that might be a good feature to actually put into the lib itself, good idea. Barring that, you should be able to either render an element on top of the video/canvas elements that mimicks the provided area settings, or draw a box using the canvas, something along those lines.

ericblade avatar May 19 '21 17:05 ericblade

Cheers. We're using this library for scanning barcodes on boxes, as vanilla as you can imagine, but it was requested that we have a "lens" to prompt people to use the very center of their camera feed. Setting up, say 20% APPEARS to work in the demo app (scanning boxes no longer appear in the demo app) however I have no idea whether or not the scanning area is matched up 1:1 with the overlaid lens/target. Hope that makes sense.

Anyway, thanks for the response, I was just curious if I had missed anything.

vlad-at-work avatar May 19 '21 22:05 vlad-at-work

Honestly, I have not played with the area feature at all, I believe there are some unit tests involving it, so I assume it works. One thing I do know that might be related, is that it seems like the mobile versions of Chrome and Safari do not treat the camera the same way that the desktop browsers do.. on desktop browser, when you set a video unit to a specific width/height, you get the camera view squeezed into that width/height... on mobile.. you often see the area enlarged to cover the camera's view. But it doesn't seem to happen for all devices. So I think there's some weirdnesses going on in how that works that may make it difficult to pin down exactly how to present it to the user.

I've been beyond busy lately, but if you happen to come up with any ideas, or have any further questions, feel free to bounce them over here. I check my github regularly and try to respond as quickly as I can.

ericblade avatar May 20 '21 06:05 ericblade