From: <ms...@an...> - 2013-05-29 19:20:58
|
On Wed, 29 May 2013, Mayank Jha wrote: > @Matthew: I do agree that adopting measures to scale and shift the > glyph will improve the accuracy of the tool, can you suggest ways of > making the techniques used by OCR people possible in font forge or any > other font developing tool for linux? I don't know off the top of my head exactly how people solve these problems in OCR, but a good starting point for finding out might be to look at the sources of existing free OCR packages, such as OpenOCR and GOCR. An important first step would be to decide just what transformations should and shouldn't make a difference. For instance, should shifting make a difference? Should scaling make a difference? Should rotation make a difference? Depending on what problem you're trying to solve, the answers will vary. One simple thing you might do would be to compute the mean (average) and standard deviation of the X and Y coordinates of the black pixels in the glyph. Then shift and rescale in X and Y to force the glyph to some chosen fixed values for the centroid and standard deviation. That way two glyphs that differ only by shifting and rescaling will end up the same. Rotation is harder because of symmetry and near-symmetry, but I think it's also less likely to be an issue for you. (That's where the Fourier-Bessel thing could be applied - but do the version with just shifting and scaling first!) I have my doubts about whether building this *directly into* FontForge is really a good idea. I think you're underestimating how much work will be involved in interfacing to the existing code base and you may find it much pleasanter to write a standalone program. If I were doing it, I would write a utility to run on BDF files and then export those from FontForge. However, you're welcome to check out a copy of the FontForge code and see what you can do with it. -- Matthew Skala ms...@an... People before principles. http://ansuz.sooke.bc.ca/ |