I'm trying to figure out how to use the segmenter provided by the Leptonica library for document analysis. I've been looking at pageseg.c but I don't think I completely understand it :(!
If I take an image and load it as a PIX datatype, do I call pixGetRegionsBinary() to find where each symbol is? And then do I use the textblock mask to extract each symbol separately?
If I understand correctly I would have code like this:
Pix* page = pixRead("myImage.tif");
Pix** halftone;
Pix** textline;
Pix** textblock;
if ( pixGetRegionsBinary( page, halftone, textline, textblock, 0 ) )
{
//..error message
}
Now is textblock all of the characters or am I using the wrong segmentation method :)? Also how would I know when the textblock "array" ends?
Thanks in advance!!
Edit 26/11/2013
For anyone interested - Leptonica Doxygen Documentation - Page Segmentation is a good example of full page segmentation!