News for hackers. Stuff that matters.
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!