cozmo / jsQR

A pure javascript QR code reading library. This library takes in raw images and will locate, extract and parse any QR code found within.
https://cozmo.github.io/jsQR/
Apache License 2.0
3.72k stars 607 forks source link

Face sends chinese data? #64

Closed videroCat closed 6 years ago

videroCat commented 6 years ago

My face returns some weird data.

https://prnt.sc/jxhmtz

Happened while i was just jiggling around in my chair.

cozmo commented 6 years ago

Do you have the image that causes this decoding? We have a hunch of what's causing it but can't debug without the source image.

videroCat commented 6 years ago

I might try to get a shot of recreating the scene.

Ill try to take a snapshot of the moment it trys to decode my face apparently.

Greets, Christopher Urban Software Development

Am 25.06.2018 um 20:57 schrieb Cosmo Wolfe notifications@github.com:

Do you have the image that causes this decoding? We have a hunch of what's causing it but can't debug without the source image.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cozmo/jsQR/issues/64#issuecomment-400058943, or mute the thread https://github.com/notifications/unsubscribe-auth/AmlIPzMW403CJwJ2sgEN3_wIIF-t6cKjks5uATKdgaJpZM4Uxka8.

cozmo commented 6 years ago

Sounds good! I hope you don't mind but I'm going to close this issue for now, seeing as there's not much to do without a repro case.

I'd love to track this bug down though so please do re-open if you can. One thing you could try is changing whatever scanning code you're using to dump the frame as soon as it gets a valid scan. Might be as easy as calling window.open(toDataURL) on the canvas tag?

cozmo commented 6 years ago

Actually though this seems like it could be the same issue as #63 so may just try to use the image provided in that issue.

kazzkiq commented 6 years ago

Just to add a little more info on the issue:

I've experienced it too and its not triggered by any specific image. Sometimes I start scanning and while I'm still reaching to the QR code in the desk it somehow identifies reflexes/patterns on objects (wall, desk, cloth, etc) as valid QR code that translates to Chinese characters.

I'm not sure how exactly the code defines what is a QR code and what isn't, but perhaps we could have a flag threshold where you define the level of confidence so the code only returns if its really sure its a real QR Code.

An (ugly) workaround I'm willing to use at the moment is actually identify any Chinese characters in the return. If there is any of them, I simply ignore it and keep the function running until something comes back in latin alphabet (which its the language I work with).

videroCat commented 6 years ago

Yep,

And the weird thing is, it isn’t even evaluating a square, sometimes I get 2 Lines connected to the top in a weird place on the camera, sometimes I get a triangle.

cozmo commented 6 years ago

Was able to create a reproduction case in #68. Feel free to follow along there.