next up previous contents index
Next: Linked lists Up: Modules in deep Previous: Modules in deep   Contents   Index


Printing image, blocks and boxes

GOCR provides a number of functions that print images, blocks or boxes, which are very helpful for debugging. How the image is printed depends of the PRINT attribute and the output file is controlled by the ERROR_FILE attribute (see section 2.2).

int gocr_printBlock ( gocrBlock *b ); 
Prints all information in gocrBlock *b, if PRINT_IMAGE is GOCR_TRUE, prints framed image too. Here's an example of what is printed (PRINT = 0):

Block: x0:1, y0:1, x1:117, y1:16; type TEXT 

..**........******......*******..........**.....********.. 

****.......*....***....*.....**..........**.....*******... 

..**......**.....***...**....***........***.....*......... 

..**......***....***...**....***.......****.....*......... 

..**......***.....**.........**........*.**.....*......... 

..**.......**....***........***.......**.**.....*..***.... 

..**.............***.......***.......**..**.....****.**... 

..**............***......*****.......*...**.....**....**.. 

..**............***.........***.....**...**...........***. 

..**...........***...........***....*....**............**. 

..**..........***............***...*.....**............**. 

..**.........**.......***.....**...***********.***.....**. 

..**.........*.....*..***.....**.........**....***....***. 

..**........*......*..***....***.........**....**.....***. 

..**.......*********..**.....***.........**.....*.....**.. 

*******...**********...***..***........*******..***.***...

Same for boxes:

int gocr_printBox ( gocrBox *b );
prints all information in gocrBox *b; if PRINT_IMAGE is GOCR_TRUE, prints framed image too.

int gocr_printBox2 ( gocrBox *b1, gocrBox *b2 );
Prints two boxes, side by side. Neat for that quick check of what the heck is going wrong.

int gocr_printArea ( gocrImage *image, int x0, 

int y0, int x1, int y1 ); 

Prints the part of the image framed by the (x0, y0) and (x1, y1) coordinates.


next up previous contents index
Next: Linked lists Up: Modules in deep Previous: Modules in deep   Contents   Index
root 2002-02-17