question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Equivalent feature to ZXing's TRY_HARDER?

See original GitHub issue

I finally got around to actually testing some of the images I want to scan qr codes in and the success-rate with jsQR ends up being on the edge of unusably low for me. I decided to try the JS port of ZXing and it’s success rate was around the same… until I turned on the TRY_HARDER hint, now it almost seems to be able to scan anything I throw at it. Any chance that’s a feature that could be easily added to jsQR?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
cozmocommented, Jul 22, 2018

Hey! Thanks for the investigation.

We’ve talked about adding the equivalent to TRY_HARDER in the past, and would fully support it. I think #78 opens up the path towards that too, as it introduces the ability to disable a feature for speed. Ideally inverting would have been opt in, not opt out, but too late to change that now.

I do think one thing we’d probably do different than ZXing is have individual flags to configure, instead of one omnibus TRY_HARDER flag. This would give people more control and insight into how they’re changing the scanning.

Off the top of my head these are the things we could tweak to make jsQR more aggressive

  • Try to invert the image colors (already done 😄)
  • Try to scale down the image (seems like you’ve hit some success with this?)
  • Increase the number of finder pattern candidates we search (right now hard coded to 4). 4 is pretty arbitrary but increasing it increases the total patterns looked at exponentially, so it has a large impact.
  • The nuclear option would be to take every possible finder pattern group we found and pass them downstream through decoder etc, instead of just the best scoring one. This would also fix https://github.com/cozmo/jsQR/issues/24.

Not sure if you have any other ideas that you think would be helpful?

0reactions
samuelcolvincommented, Nov 13, 2021

The last two options here would be really helpful.

Are there any plans to implement this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Inconsistent naming of the "tryHarder" feature #104 - GitHub
I believe the upstream term tryHarder (next to the similar tryRotate ) ... flags to avoid confusion and remain compatible with upstream ZXing....
Read more >
Barcode Scanner in .NET MAUI with ZXing.Net.Maui - YouTube
Barcodes or QR codes don't need any introduction. They are still everywhere and you are using barcode scanners in all of your apps....
Read more >
Issue with QR Decoding using Zxing.Net in Powershell ...
BarcodeReader $reader.Options.TryHarder = 1 # set TryHarder option to true, other options can be set the same way $bitmap = [System.Drawing.
Read more >
Accessing advanced ZXing settings for BarcodeRecognize
decoder = JavaNew["com.google.zxing.qrcode.decoder.Decoder"] will create a new java object. So you could roll your own decoding function.
Read more >
Barcode Scanning Made Easy with ZXing.Net Mobile
Barcode scanning is a common functionality in many mobile applications. ... such as the camera or geolocation, similar to iOS. ZXing.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found