Coincidentally:
https://issues.apache.org/jira/browse/PDFBOX-4530
Tilman
Am 29.04.2019 um 11:15 schrieb STAMPF Lukas:
Hello,
Sorry for not responding earlier. I looked into it again with the release of
2.0.15 and the difference is that bitonal rendering was also done with bicubic
interpolation prior to the rendering hints implementation of 2.0.14. Setting
the rendering hints to bicubic manually on 2.0.15 restores the behavior of
2.0.13. Unfortunately I couldn't come up with a PDF I could send you. Most of
the documents I have that trigger this behavior are from production and it
seems that the problem occurs so rarely and depends on scanner quality that I
couldn't produce a PDF that reproduces this behavior.
But I can guarantee that
RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR /
RenderingHints.VALUE_INTERPOLATION_BICUBIC
Do not produce the same result on BINARY rendering and the change is the reason
why my QR detection rate went down.
Kind regards,
Lukas
-----Ursprüngliche Nachricht-----
Von: STAMPF Lukas <[email protected]>
Gesendet: Freitag, 5. April 2019 19:04
An: [email protected]
Betreff: AW: QR Image Detection Down 2.0.13 -> 2.0.14
Hi,
I try to come up with an PDF I can send you. But from a quick debug it seems
that even bitonal rendering happened with bicubic interpolation in 2.0.13.
Have a nice weekend,
Lukas
-----Ursprüngliche Nachricht-----
Von: Tilman Hausherr <[email protected]>
Gesendet: Freitag, 5. April 2019 18:42
An: [email protected]
Betreff: Re: QR Image Detection Down 2.0.13 -> 2.0.14
Am 05.04.2019 um 18:14 schrieb STAMPF Lukas:
Hi,
I guess the reason for that is that if you set a single RenderingHint, you need
to provide all of them or lose the rest from Default.
Yes.
By setting KEY_ANTIALIASING I essentially removed VALUE_RENDER_QUALITY and so
it didn't work.
But now the interesting part: By setting VALUE_RENDER_QUALITY I kept that
setting, but removed the KEY_INTERPOLATION setting.
That would be that there would be no interpolation
(VALUE_INTERPOLATION_NEAREST_NEIGHBOR), which makes sense for bitonal
destination.
I just checked: Setting KEY_RENDERING and KEY_ANTIALIASING and therefore
removing KEY_INTERPOLATION from the RenderingHints improved my situation on
2.0.14. Has something changed there?
No, unless I made a mistake... I took care that people get the same as before.
I could research this, but then I'd need to get a PDF (please upload to a
sharehoster).
Tilman
Lukas
-----Ursprüngliche Nachricht-----
Von: Tilman Hausherr <[email protected]>
Gesendet: Freitag, 5. April 2019 17:55
An: [email protected]
Betreff: Re: QR Image Detection Down 2.0.13 -> 2.0.14
Hi,
This is weird, RenderingHints.VALUE_RENDER_QUALITY is in the default settings?!
See in the source code, PDFRenderer.createDefaultRenderingHints().
antialiasing is off when bitonal destination.
Tilman
Am 05.04.2019 um 17:48 schrieb STAMPF Lukas:
Thanks, seems like it wasn't the antialiasing. Turning it off and on didn't
change the results between 2.0.13 and 2.0.14. What did help however was
hints.put(RenderingHints.KEY_RENDERING,
RenderingHints.VALUE_RENDER_QUALITY);
Setting this on 2.0.14 seems to restore the 2.0.13 behavior. Could be
coincidence though. Need to verify it with a larger amount of documents first.
Has something about this setting changed between versions when rendering in
BINARY mode?
Lukas
-----Ursprüngliche Nachricht-----
Von: Tilman Hausherr <[email protected]>
Gesendet: Freitag, 5. April 2019 17:00
An: [email protected]
Betreff: Re: QR Image Detection Down 2.0.13 -> 2.0.14
Yes, PDFRenderer now allows to pass rendering hints.
Tilman
Am 05.04.2019 um 16:42 schrieb STAMPF Lukas:
Hi,
I am using PDFBox to generate BufferedImages which I feed to ZXing
3.3.3 to do QR scanning. When I updated from 2.0.13 to 2.0.14 I
noticed a severe reduction in scanning reliability. I guess its
related to this change
https://issues.apache.org/jira/browse/PDFBOX-4391
This is the render command I use:
bim = pdfRenderer.renderImageWithDPI(pageCounter,
dpi, ImageType.BINARY);
I try multiple dpi settings between 150 and 300, to increase my changes to find
a QR code.
Is there some flag I can set to test out if the antialiasing causes this?
Kind regards
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]