Closed krvs-esoptra closed 5 years ago
NewBinaryBitmapFromImage
uses HybridBinarizer
instead of GlobalHistgramBinarizer
.
Please try this:
img, _, _ := image.Decode(file)
src := gozxing.NewLuminanceSourceFromImage(img)
bmp, _ := gozxing.NewBinaryBitmap(gozxing.NewGlobalHistgramBinarizer(src))
qrReader := qrcode.NewQRCodeReader()
result, err := qrReader.Decode(bmp, nil)
I got a result without error.
Yes, indeed it is working for all my images when explicitly specifying the GlobalHistgramBinarizer. Thank you so much
The QRCodeReader fails to extract the QR code from the attached image:
It responds with a NotFoundException Go snippet:
The Java equivalent (https://github.com/zxing/zxing) on the other hand is able to do it Java snippet: