glassechidna / zxing-cpp

ZXing C++ Library
Apache License 2.0
598 stars 435 forks source link

Problem with datamatrix area detection #42

Open darkpotpot opened 8 years ago

darkpotpot commented 8 years ago

Hi, I have a problem with the datamatrix below.

barcode_ko There is a bug in the detect method of the WhiteRectangleDetector object. Since my DataMatrix contains a white rectangular area, it detects this area as the datamatrix area instead of keeping increasinf the area to the whole datamatrix. The barcode detection then fails. The area detected as the datamatrix is in red on the image below : barcode_ko_detected Is there a way to improve the datamatrix area detection ?

axxel commented 6 years ago

In case that is still relevant: I also had an issue with the datamatrix detector, wich led me to reimplement it based on the c++ port from @huycn (https://github.com/nu-book/zxing-cpp). It is a completely new port based on the current Java code with the goal of having an idiomatic c++ library instead of a 1:1 mapping of Java classes.

My new detector code does not use the WhiteRectangleDetector but instead uses an edge tracing scheme that can also handle codes with only one module quite zone that are not perfectly aligned with the image borders.

I'd be happy to get feedback.

darkpotpot commented 6 years ago

Oh great ! For now I can't test it since the project using the library is on visual studio 2010 (c++ 11 is not well handled). But I'll test is as soon as the project is updated to the latest visual studio.