-
Notifications
You must be signed in to change notification settings - Fork 853
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
[BUG] White QRCode with other Background Color cannot be scanned. #403
Comments
same issue |
Confirming. Scanner problems on different colors |
In my case qr code has blue background. And not scanning only in Androd in iOS working fine. Any solution for this? |
same issue |
I have the exact same issue. Any solution? |
i have the same issue, any solutions? |
For now, I found only one solution. I use other lib: qrscan, which use input image buffer for recognize. I use camera package to get image buffer, then apply grayscale and invert filter before send to qrscan lib. It worked, but it slow, and I had to come simply tricky frame skip code recognize snippet Timer.periodic(new Duration(seconds: 2), (timer) {
timerP = timer;
if (image == null) return;
scanner
.scanBytes(Uint8List.fromList(jpgOut.encodeImage(
invert(grayscale(jpg.decodeImage(image!.planes[0].bytes))))))
.then((barcode) {
barcode = barcode.trim();
if (barcode != '') {
// do something
}
}).catchError((err) {});
}); get image snippet availableCameras().then((cameras) {
controller = CameraController(cameras[0], ResolutionPreset.medium,
imageFormatGroup: ImageFormatGroup.jpeg);
controller!.initialize().then((cam) {
if (!mounted) {
return;
}
controller!.startImageStream((image) {
this.image = image;
});
setState(() {});
});
}); I wait, when this library can recognize qr automatically, it will awesome, for now this trick) |
It does only support Android 😐 |
Describe the bug
White QRCode with other Background Color cannot be scanned.
Flutter information
[✓] Flutter (Channel master, 2.5.0-7.0.pre.185, on macOS 11.5.2 20G95 darwin-x64, locale en-GB)
• Flutter version 2.5.0-7.0.pre.185
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 2526cb07cb (11 hours ago), 2021-08-21 23:42:01 -0400
• Engine revision 4783663ee4
• Dart version 2.15.0 (build 2.15.0-41.0.dev)
Device (please complete the following information):
PS: iPhone/iOS will not have this issue.
Screenshots
Left part of below image CANNOT be scanned with qr_code_scanner v0.5.2.
In my case, white QRCode with blue background cannot be scanned also.
Right part is ok.
Additional context
...
The text was updated successfully, but these errors were encountered: