Skip to content
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

Multiple barcode decoder issue #51

Closed
TonyMasson opened this issue Jul 18, 2024 · 4 comments · Fixed by #53
Closed

Multiple barcode decoder issue #51

TonyMasson opened this issue Jul 18, 2024 · 4 comments · Fixed by #53
Assignees
Labels
bug Something isn't working

Comments

@TonyMasson
Copy link

Hello,

First of all, thank you for all the work you have done.

I am encountering an issue with the detection of multiple DataMatrix codes in an image.

In the image below, we get an error of type Err(NotFoundException("")) because the first DataMatrix code in the image is, I believe, detected but is blurry on its right side (you can see it clearly by zooming in). However, the second DataMatrix code is good but not detected.

BAD

If I swap the two DataMatrix codes, the first one is detected and everything works as expected.
GOOD

Thank you very much.

@hschimke hschimke self-assigned this Jul 18, 2024
@hschimke
Copy link
Collaborator

I'll look into this. I'm out of office until next week, but I'll try to provide an update by midweek.

@hschimke hschimke added the bug Something isn't working label Jul 18, 2024
@hschimke
Copy link
Collaborator

Stepping through the detection logic it appears that you are correct. There is just enough distortion that one of the symbols fails error correction.

The issue is that the datamatrix detector, unlike the qr detector, only returns a single possible symbol. For "multiple detection" this is usually fine because the image is then chopped up and rescanned, but in this particular case that does not occur and so only one symbol in the entire image is ever parsed. I have updated the logic of the detector to return all possible symbol locations and to iterate over them. This has a slight reduction in performance in some cases, but overall should result in better detection results.

I have a working fix in testing.

hschimke added a commit that referenced this issue Jul 22, 2024
This changes how datamatrix symbols are detected in an image. Previously only the first possible symbol was returned. After this change all possible symbols are returned. This addresses the issue presented in #51
@TonyMasson
Copy link
Author

🙏 Thanks

@hschimke hschimke linked a pull request Jul 24, 2024 that will close this issue
hschimke added a commit that referenced this issue Jul 24, 2024
This release provides some improvements to performance and optimization in specific cases.

This release in cludes fixes to issue #50 and #51
@hschimke
Copy link
Collaborator

This release has been published to crates.io and to rxing-wasm v0.2.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants