Hi, On Thu, Jan 8, 2009 at 19:18, jimfunderburk <[email protected]>wrote:
> > I noticed that, for some pages, the ocropus deskewing does not work > well; most of the time it does work well. An example of a page, and > its deskewing by ocropus and by omnipage15 is visible at > http://jfunderburk3.com/ocropusexamples/deskew1/. That page has lines at two different orientations: the header and the dictionary page. OCRopus chooses to deskew for the header line. Is there a way to generate a statistic in ocropus that would > measure how good the deskewing of a given page is? By examining > such a statistic, one could have some confidence that a page > is deskewed adequately or poorly. That page actually is deskewed very accurately, it just happens to be deskewed for the text you are not interested in. > Is there a way to 'tinker' with how the ocropus deskewing works. Can > ocropus generate a statistic for a given image which could be used to > describe the quality of the deskewing? The default OCRopus deskewing algorithm uses a precise line finding algorithm to find each text line on a page in turn, starting with the longest text line. By default, the deskewing algorithm uses the orientation of the longest text line to deskew the page. That turns out to be the most accurate and robust way of deskewing pages on average. Other systems generally use projection-based methods or similar techniques. Those methods would happen to give you what you want on this page, but they are generally less accurate and less reliable on other pages. Now, given that you have these pages with multiple orientations on them, what should you do? You can modify the deskewing algorithm in OCRopus to express what you need. Not surprisingly, the algorithm is in ocr-deskew-rast. The skew angle is determined in DeskewPageByRAST::getSkewAngle (I'd recommend subclassing and making the function virtual if you want us to incorporate your deskew method into the distribution). How you modify that routine depends on what you need. Right now, max_results for the line finder is set to 1; you could set that to 5 and use the median of the 5 skew angles you get. Or you could set it to a very large number and take the median or mode of all skew angles. It may seem like that that might be a better default than what OCRopus does, but it actually isn't (we tested it); if that were the default, deskewing would be less precise on average, and there would be a higher percentage of incorrectly deskewed pages. Tom --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "ocropus" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/ocropus?hl=en -~----------~----~----~----~------~----~------~--~---
