Intermittent problem reading QR codes
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 18/100
Direzione di ricerca
The failure is in decoding screen-captured QR codes, so the relevant code is the ZXing.Net decoder path for QR detection and binarization, not the writer shown in the report. Reproduce by decoding the saved screenshot (d:\QrReceive.Source.*.png) with BarcodeReader and TryHarder enabled, then compare against the generated PixelData bitmap. Done would mean a reproducible failing sample and a fix that keeps existing QR tests passing.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I’m looking for some advice on reading QR codes I created via ZXing.net. Ideally, I’d like to use QR codes with higher data density. But as the density goes up, so does the failure rate.
My workflow is to create a QR code, then display it on screen to confirm it’s what I need. The displayed code is not scaled or otherwise distorted.
All QR codes appear to be created correctly, and I can scan them using my shaky handheld phone, which is pointed at the monitor.
However, occasionally ZXing refuses to scan some QR codes, like the example below.
Changing the Margin and PureBarcode will change the size of the image, but the system still has problems reading some codes, at a rate of about 1 per 30.
I'm using v0.16.10 net48 from NuGet
Here is my code that creates the QR code:
[int]$Size = 500
$BarcodeWriter = [ZXing.BarcodeWriterPixelData]::New()
$BarcodeWriter.Format = [ZXing.BarcodeFormat]::QR_CODE
$BarcodeWriter.Options = [ZXing.Common.EncodingOptions]::New()
$BarcodeWriter.Options.Width = $Size
$BarcodeWriter.Options.Height = $Size
# $BarcodeWriter.Options.Margin = 4
# $BarcodeWriter.Options.NoPadding = $True
# $BarcodeWriter.Options.PureBarcode = $True
$PixelData = $BarcodeWriter.Write( $Text )
$Bitmap = [System.Drawing.Bitmap]::New( $PixelData.Width, $PixelData.Height, [System.Drawing.Imaging.PixelFormat]::Format32bppRgb )
$BitmapData = $Bitmap.LockBits(
[System.Drawing.rectangle]::New( 0,0, $PixelData.Width, $PixelData.Height )
, [System.Drawing.Imaging.ImageLockMode]::WriteOnly
, $Bitmap.PixelFormat
) # end LockBits
[System.Runtime.InteropServices.Marshal]::Copy( $PixelData.Pixels, 0, $BitmapData.Scan0, $PixelData.Pixels.Length )
$Bitmap.UnlockBits( $BitmapData )
Return $Bitmap
This is my code that collects a screenshot of the exact location where a QR code is being displayed, and the call to ZXing
$bitmap = New-Object System.Drawing.Bitmap( $Area.Width, $Area.Height )
$graphics = [System.Drawing.Graphics]::FromImage( $bitmap )
$graphics.CopyFromScreen( $Area.Location, [System.Drawing.Point]::Empty, $Area.Size )
$bitmap.Save( "d:\QrReceive.Source.$( $Guid ).png", [System.Drawing.Imaging.ImageFormat]::Png )
$BarCodeReader = [ZXing.BarcodeReader]::New()
$BarCodeReader.Options.TryHarder = $True
$PossibleFormats = New-Object System.Collections.Generic.List[ZXing.BarcodeFormat]
$PossibleFormats.Add( [ZXing.BarcodeFormat]::QR_Code )
$BarCodeReader.Options.PossibleFormats = $PossibleFormats
# $BarCodeReader.Options.PureBarcode = $True
$Barcode = $BarCodeReader.Decode( $bitmap )
Here is that screenshot collected by the above code.
- Lingua principale
- C#
- Stelle
- 3.1k
- Fork
- 704
- Merge medio
- 13g 17h
- PR unite (30g)
- 2
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di micjahn/ZXing.Net
-
crop() overrides document "0 <= top <= Height"; should be top < Height like left < WidthForse già presa @hidingmyname l’ha presa 1 giorno fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
Difficoltà 3/5 Mezza giornata Idoneità per principianti 22/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 12/100
Tutte le issue di micjahn/ZXing.Net
Issue simili
-
possible bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
Include host.wslc.internal in the HTTPS development certificateForse già presa @afscrome l’ha presa oggi. Apertaarea-commandlinetools
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
dotnet/aspnetcore#70122 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
:1st_place_medal: good first issue :cowboy_hat_face: refactor :roller_coaster: enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
ApplETS/Backend-Hello#78 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 2 giorni
-
Custom component in Summary2 no longer receives raw formData (regression from app-frontend v4)Apertastatus/triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
Altinn/altinn-studio#21642 ·
I maintainer di solito rispondono entro 1 giorno