Feature alternative data matrix detector on develop #380
+637
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So i finished porting the alternative Data Matrix Detector from the zxing-cpp project (https://github.com/nu-book/zxing-cpp/blob/2ceda95cba943b3b2ab30af3c90150c97e84d416/core/src/datamatrix/DMDetector.cpp#L442-L1072).
The decoding results are quite similar to the old one:
I will debug the 2 not detected codes from datamatrix-1 folder as soon as i find some time.
And i wanted to also do some real benchmarking, because the speed should also be considered. (Maybe this could be added to the tests in a generic way?)
I did not replace the old implementation, i would propose to use the new implementation as second detector when
tryHarder
is enabled and the first detector does not find a code. What are you toughts about this?My plan is to adjust the Detector so it can be used to detect DataMatrix Codes with Dots instead of squares also called DPM Codes (https://en.wikipedia.org/wiki/Direct_part_marking).
Some questions i had along the way:
Debugging & testing
I modified the
launch.json
to use ts-mocha. This was working quite well expect the paths filter does not seem to work this way:Therfore i also had to use
describe.only(...)
in the data matrix spec, to run only the datamatrix tests:I saw @odahcam posted an alternative setting 2 days ago with mocha but i could not get it to work properly.
I think it would also be helpful to specify a certain test file with rotation (e.g. 04.jpg at 90°), because the quick fix i did so far was removing all other files from the folder...
I was also wondering why only the test files in
datamatrix-1
folder are included in the tests? Is there a reason for it?Is there an prefered way to handle debugging code like logging? E.g. I added a function for myself to print the BitMatrix to a file (with + and . chars), so i could quickly double check the values while debugging in that file visually.
Common classes
I created a class called
Point
with some basic mathematical operations, i also saw that the Aztec Detector uses a quite similar class. Should every Detector have it's own implementations of such helper classes or would you prefer some common implementations?Are there any other detectors and decoders you would like to get ported from other zxing implementations? I feel a bit motivated at the moment to contribute something useful :)