| Column Functions | |
| Functions | |
| column | Creates a new Column |
| columnQuality | Returns a quality to use with the rectMaximalWhiteRectangles. |
| columnIsColumnSeparator | Checks if a Rect is a column separator. |
| columnGetPageColumns | Finds at maximum n_tries from the page. |
| columnSplitImageByColumns | Split the image in separate column images. |
Column *column( int x1, int y1, int x2, int y2, Column * next )
Creates a new Column
| x1 | x coordinate of the top-left corner |
| y1 | y coordinate of the top-left corner |
| x2 | x coordinate of the bottom-right corner |
| y1 | y coordinate of the bottom-right corner |
| next | the next Column in the list. Pass NULL to create a single Column |
The new Column
int columnIsColumnSeparator( Rect * r, Rect * characters )
Checks if a Rect is a column separator. This is true if the Rect height is at least 3 bigger than it’s width and if it is close enough (30 pixels) to four characters in each side.
| r | Rect to be tested |
| characters | bounding boxes of the characters in the page |
1 if r is a column separator, 0 otherwise
Column *columnGetPageColumns( Image * img, Rect * characters, int n_tries, double (*quality) (Rect *r), int (*columnClassifier) (Rect *, Rect *) )
Finds at maximum n_tries from the page. First it finds n_tries candidates to columns using the maximal white rectangles. Then it classifies the Rect into columns and returns the positive Rects.
| img | image to get columns from |
| characters | bounding boxes of the characters in the page |
| n_tries | number of rectangles to get from Maximal White Rectangles. Usually you should put a little more than the number of columns expected. |
| quality | quality function to use in the white rectangles algorithm |
| columnClassifier | function that classify a Rect as a column. |
List of Columns in the page
rectArea, rectMaximalWhiteRectangles, columnIsColumnSeparator
Image **columnSplitImageByColumns( Image * img, Column * col, int * n_sections )
Split the image in separate column images.
| img | image to split |
| col | Columns to use |
| n_sections | pointer to the variable that will store the number of sections generated |
An array of IplImage * with the page sections and the number of sections in the variable *n_sections.
rectArea, rectMaximalWhiteRectangles, columnIsColumnSeparator, columnGetPageColumns
Creates a new Column
Column *column( int x1, int y1, int x2, int y2, Column * next )
Returns a quality to use with the rectMaximalWhiteRectangles.
double columnQuality( Rect * r )
Checks if a Rect is a column separator.
int columnIsColumnSeparator( Rect * r, Rect * characters )
Finds at maximum n_tries from the page.
Column *columnGetPageColumns( Image * img, Rect * characters, int n_tries, double (*quality) (Rect *r), int (*columnClassifier) (Rect *, Rect *) )
Split the image in separate column images.
Image **columnSplitImageByColumns( Image * img, Column * col, int * n_sections )
An implementation of the algorithm described in “T.
Rect *rectMaximalWhiteRectangles( Rect * bound, Rect * obstacles, int N, double (*quality)(Rect *r) )
Returns the area of the Rect.
double rectArea( Rect * r )