News for hackers. Stuff that matters.
Re:Pdf.tocgen by felipefar on Monday April 29, 2024 @08:34AM (#40197465)
tesseract is fine for basic use cases, but it fails when the image is tilted (and thus the text isn't laid out horizontally), which can happen several times with scanned books. Compared to how well the Google OCR engine works, tesseract should be much better than it is.

I wonder how difficult it is to develop a better OCR engine than tesseract.

Re:Pdf.tocgen by HeatrayEnjoyer on Monday April 29, 2024 @10:45AM (#40198995)
Tesseract is last gen. Multimodal is SOTA, and can handle even heavily distorted or destroyed text.
Re:Pdf.tocgen by perihelions on Monday April 29, 2024 @08:42AM (#40197539)
Am I overlooking something, or is automating page rotation no more work than just a 2d FFT?
Re:Pdf.tocgen by notyoutube on Monday April 29, 2024 @08:47AM (#40197588)
Mind ELI5ing this? it seems neat
Re:Pdf.tocgen by perihelions on Monday April 29, 2024 @09:12AM (#40197888)
The Fourier transforms map plane waves to points. Blocks of regularly-spaced text have a periodic character, with the period length of their line spacing; their Fourier transform (I think??) would, in 2d frequency space, have amplitude peaks on vectors that have the same angle as the rotation of the lines.
Re:Pdf.tocgen by notyoutube on Monday April 29, 2024 @11:15AM (#40199399)
thanks!
Re:Pdf.tocgen by aidenn0 on Monday April 29, 2024 @01:40PM (#40201491)
I think it's more typical to low-pass (i.e. blur) the image and then use a line-detection algorithm like the Hough transform. Properly deskewed text should have prominent horizontal white lines.
Re:Pdf.tocgen by perihelions on Monday April 29, 2024 @01:48PM (#40201588)
- "Hough transform"

Oh, that one has much nicer properties—thank you!

Re:Pdf.tocgen by aidenn0 on Monday April 29, 2024 @01:37PM (#40201457)
You are supposed to deskew (and de-warp if the image isn't flat) images before running through tesseract. There are other tools for doing that.