laszlo wrote:I would put bezier curve at the top and at the bottom of each line. However some more cleaning may be still necessary.
(I'm speaking theoretically, not practically.) Let's assume that the text runs horizontally across the page and that the page is a bent flexible sheet held at an angle to the camera. (Further assume each line is of uniform height.) From the physics of the sheet's bending, I believe one an derive a family of curves to which the lines of text belong. It remains to ascertain the maximum likelihood parameterization of those curves given the "greeked" text coming out of preprocessing.
This could be hard. One can crib from the statistical pattern recognition guys, create an idealized "template" of the page, then match the image against the template, then successively warp the template according to the physics of how pages bend until the template-match score is highest.
To construct the template, imagine a gray bar of fixed height, which the darkness of the gray varying from top to bottom according to a frequency of pixel activation derived from a large sample of text rendered in a reasonable font. I.e. all the white and black pixels of the lines of text of a big sample averaged together. Further imagine a stack of these gray bars spaced with the same leading as the typeset page. A flat page will line up with this template and it should have a nice sharp peak in the autocorrelation function of image against template.
But since the page is bent, the autocorrelation function will be smeared. Warping the template until the autocorrelation function gets a sharp peak. Then apply the inverse warp to the page.
I don't know if it'll work. But it's an amusing gedanken experiment.