ericblade / quagga2

An advanced barcode-scanner written in Javascript and TypeScript - Continuation from https://github.com/serratus/quaggajs
MIT License
766 stars 85 forks source link

Can't use debug in quagga 2 1.8.2 #490

Closed lampsbr closed 1 year ago

lampsbr commented 1 year ago

Hi,

I guess I'm mixing Quagga and Quagga 2 setup options, and in a bad way. I can't see the blue and red debug lines in my LiveStream. Can someone point what is wrong in my init object? =)

{
                inputStream: {
                    name: 'Live',
                    type: 'LiveStream',
                    target: '#liveCamModal',
                    constraints: {
                     width: 300,
                    height: 300,
                    }
                },
                frequency: 10,
                locate: true,
                locator: {
                    halfSample: false,
                    patchSize: "small", 
                    willReadFrequently: true,
                    debug: {
                        showCanvas: true,
                        showPatches: true,
                        showFoundPatches: true,
                        showSkeleton: true,
                        showLabels: true,
                        showPatchLabels: true,
                        showRemainingPatchLabels: true,
                        boxFromPatches: {
                            showTransformed: true,
                            showTransformedBox: true,
                            showBB: true
                        }
                    }
                },
                decoder: {
                    readers: ["ean_reader"],
                    debug: {
                        drawBoundingBox: true,
                        showFrequency: true,
                        drawScanline: true,
                        showPattern: true
                    },
                    multiple: false
                },
                debug: true
            }
ericblade commented 1 year ago

As far as I'm aware, debug options only work when you have also built the library in debug mode. If you want to draw your own boxes, you can lay a canvas on top of the video element and use the inputs to onProcessed or onDetected to draw.

ericblade commented 1 year ago

closing pending further feedback