Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem Reading a low contrast Kind of QR Code #535

Open
apimio opened this issue Aug 23, 2022 · 3 comments
Open

Problem Reading a low contrast Kind of QR Code #535

apimio opened this issue Aug 23, 2022 · 3 comments

Comments

@apimio
Copy link

apimio commented Aug 23, 2022

Guys ..please ..I have a very big issue. I have some years using the library, working perfectly with it, but now I have a issue with some kind of QR codes. The size of each QR code is about 8x8 cms., but the contrast is lower (some examples attached). The librery is not reading some QR codes.
I'd change some config parameter (even I tried useBarCodeDetectorIfSupported not official options). This my current code

const aformatsToSupport = [
   Html5QrcodeSupportedFormats.QR_CODE,
];

const html5QrCode = new Html5Qrcode("qr-reader", { formatsToSupport: aformatsToSupport, 
               experimentalFeatures: { useBarCodeDetectorIfSupported: true } 
            }
);
const qrCodeSuccessCallback = (decodedText, decodedResult) => {
                                //console.log(`Leimos`, decodedText);
                                //console.log(`Resultado`, decodedResult);                               
 };

var ActiveCamera = function(btn) {
                                var config = { fps: 500, qrbox: 250, formatsToSupport: aformatsToSupport, experimentalFeatures: { useBarCodeDetectorIfSupported: true} };
                                
                                // back camera
                                html5QrCode.start({ facingMode: "environment" }, config, qrCodeSuccessCallback);
                                
 }

exampleqr1
exampleqr2

If I read any other QR code from a site, QR app generator , I don´t have any problem.
If I test reading the QR with native App, even directly from phone camera I dont have any issue, it's just with using the library.

Thanks a Lot for your help!!!!

@liushengqi000
Copy link

liushengqi000 commented Sep 3, 2022

I think you need to pre process the pictures before recognition.
I can't decode this QR code on other websites.

canvas is useful

var canvas = document.getElementsByTagName("canvas")[0];
var ctx = canvas.getContext('2d')
function animate(){
    ctx.drawImage(video , 0 , 0 , vw , vh);
    var img=ctx.getImageData(0,0,50,50);
    ...
}

@apimio
Copy link
Author

apimio commented Sep 5, 2022

Thanks a lot. Finally .. I found a wait to fix the issue. Sadly, I had to change our implementations by qr-scanner library.

@mebjas
Copy link
Owner

mebjas commented Nov 17, 2022

@apimio what was the fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants