There is still much optimization potential, particularly in the Detector.
For example, in the findVertices method still every line is checked about the presence of the guard patterns. The current ZXING Java source does sometimes not check all the lines, dependent on the "tryHarder" hint. But now, even under "tryHarder" conditions, it will be not necessary to do this; only check every 8th or 16th line because we need only two points for the left and two for the right side. These are sufficient for the vertical lines, and we have to find the intersections with the horizontal lines at the top and the bottom.
Furthermore, the "correctCodeWordVertices" and "patchVerticePos..." methods are no longer needed.
It is also possible that the perspective transformation of points in the methods SampleGrid and SpecialGrid is superfluous because the "LinesMatrix" created by createLinesMatrix from the Delta2Binarizer is yet perspectively transformed. This would mean to invoke SpecialGrid instead of SampleGrid in Detector::detect; to skip some lines at the beginning of SpecialGrid; and to replace the arguments of "image->get(...)" by the non-transformed co-ordinates (say, (x,y)) - with some other simplifications.
Maybe that someone also finds a simplification/optimization of the "computeRowCount" method.
Hi,
in absence of a clean patch file against a certain revision, I merged all of the zip files you provied (zxing-update-hfn-pdf417-20121203.zip along with zxing-update-pdf417-cpp-hfn-01.zip to zxing-update-pdf417-cpp-hfn-03.zip). See: https://github.com/schulzch/zxing/commit/2c300e2f964f93ad6368c11c774e014b56412ffa and following (note: you might be interested in files for CMake there :))
While merging I fixed a bunch of compilation errors, so I could have added a bad fix. I'll look into it the next couple of days. I just want to confirm something: have you ever tried zxing test data with your code (e.g. ZXing-2.1-testdata/pdf417/01.png)?
Regards,
Christoph
Am Mittwoch, 17. Oktober 2012 21:14:46 UTC+2 schrieb hfneubauer-home:
"greyData_[(top_ + y) * dataWidth_ + left_ + x]"
by
"get(x,y)"
and to define "virtual int get(x,y)" in "GreyscaleLuminanceSource" as "return greyData_[(top_+y)*dataWidth_+left_+x];" ;
and define "virtual int get(x,y)" in other LuminanceSources in the same way.
(2) In the PDF417 BitMatrixParser (BitMatrixParserPD.cpp), I have added some validity checks, but may be,
two of them may be removed due to improved error correction. First is line 168 through 171:
Second is line 256 throug line 259:
In the case this would be removed, the methods "VerifyOuterColumns" and "IsEqual" could be deleted, too.
I did not yet try to remove the two code parts; I had added them in an earlier state of development when error & erasure
correction was not yet up to date.
Best regards, hfneubauer
Hi,
Which compiler do you use? I must say that, during my last modifications, I used the eMbedded C++ compiler, while for earlier modifications I also compiled using Microsoft Visual Studio 2008.
Thank you for your work. Two other notes:
(1) Please note that, until now, the PDF417 recognition, because of the Delta2Binarizer, only works together with the GreyscaleLuminanceSource. To activate it for other LuminanceSources, it would be necessary:
(2) In the PDF417 BitMatrixParser (BitMatrixParserPD.cpp), I have added some validity checks, but may be,
two of them may be removed due to improved error correction.
Hi,
Regards, Hartmut