makiuchi-d / gozxing

Port of ZXing (https://github.com/zxing/zxing) core to pure Go.
Other
565 stars 65 forks source link

NotFoundException: startSize = 0 #43

Closed nightlord189 closed 3 years ago

nightlord189 commented 3 years ago

Could you please check, why qrReader.Decode(img, nil) returns error "NotFoundException: startSize = 0"?

24

img3

File is attached, QR-code looks normal. Online version doesn't decode it too.

makiuchi-d commented 3 years ago

There are many white spots in the right-top finder pattern, so it cannot be detected. I got the result by filling it black.

right-top

You can know which finder patterns were detected using following decoder hint:

    hints := map[gozxing.DecodeHintType]interface{}{
        gozxing.DecodeHintType_NEED_RESULT_POINT_CALLBACK: gozxing.ResultPointCallback(
            func(p gozxing.ResultPoint) {
                fmt.Printf("resultpoint: %v\n", p)
            }),
    }
nightlord189 commented 3 years ago

There are many white spots in the right-top finder pattern, so it cannot be detected.

Thanks you! Do you provide any recommendations for these cases? Maybe convert/reduce resolution of source image? I use your library for recognizing scans from printed papers A4, possibly printers sometimes could print those spots.

makiuchi-d commented 3 years ago

I think it should be applied a denoising filter (e.g. median filter) before qr-code scanning.