serratus/quaggaJS

QuaggaJS in background (without displaying the camera)

Opened this issue · 5 comments

Hello,

I want to use the library, and start the scanning, but don't wanna display the camera view (target), so what I did is that I removed the targert property from Quagga.Init method, and the camera was gone, is this a good/efficient solution? Or I need to seek for more configs? Thanks.

how would you have any idea what's happening, if you're not showing the user? i'm not sure this would even work, because if there's no target, where is it acquiring the image from?

how would you have any idea what's happening, if you're not showing the user? i'm not sure this would even work, because if there's no target, where is it acquiring the image from?

The camera is placed and is stable, just put the barcode in front of it and the library scans it. Just like at a supermarket, does the cashier have a camera to scan the products? No, he just passes the items through the scanner.

yes, but a laser scanner doesn't require an image to operate, whereas quagga does require an image. i mean, if it works like that, then i guess it confirms that the input continues to work even if there's no output.

i just can't imagine a situation where an image based scanner is good enough that you don't need/want to have the ability for the user to tell if the barcode is even visible to the scanner or not.

This is how it works: it asks for camera permissions, when you use the .start method, it starts scanning the camera in the background, and when it detects a barcode it calls "onDetected". Displaying the camera to the client is optional.
Anyway, I removed the "target" property from the init method, and things worked fine.

The barcode wont even be hard to scan, just put it infront of the camera and there wont be a reason for the scanner not to read it

well, to answer your question, if it works, then that's probably the way to do it. The other talk is just that I doubt you'll find it to be a good user experience, because image decoders are significantly pickier about what and how they'll read something than a laser scanner is, which just needs to have the entire barcode covered by the laser. If you do find it workable, great :-)

Have a good one