Open cozmo opened 6 years ago
hey @cozmo thanks for this. I am using your example in a node application to scan QR's through camera and I am getting very frequent false positives and this is making my app crash when it happens.
this line is the culprit and I have tried many variations but none works as all of them casue the stream to freeze.
if (code) {
console.log("Found QR code", code);
}
Tried the following: 1.
if (code.data) { // to confirm that there is really data
console.log("Found QR code", code);
}
2.
if (isURL(code.data)) { // to confirm that the data is a url
console.log("Found QR code", code);
}
Please have you or anyone found a way to deal with this? I really need some help on this. Thanks.
@nosizejosh You can try:
if(code && code.binaryData.length > 0) {
console.log("Found QR code");
}
We got random false positives also but realised if it's not a QR code, the binaryData
length would be 0
.
The following images both incorrectly detect a QR code with no data. This is obviously not correct, but the exact place to fail them out is not entirely clear.