ho_objmap.h man page

src/ho_objmap.h — libhocr C language header.

Synopsis

#include <ho_bitmap.h>

Data Structures

struct ho_obj
libhocr object struct
struct ho_objlist
libhocr object list struct
struct ho_objmap
libhocr object map struct

Defines

#define HO_OBJMAP_H 1

#define ho_objmap_set(m, x, y, val) (((m)->map)[(x) + (y) * (m)->width] = (val))

#define ho_objmap_get(m, x, y) (((m)->map)[(x) + (y) * (m)->width])

#define ho_objmap_get_size(m) ((m)->obj_list->size)

#define ho_objmap_get_object(m, i) ((m)->obj_list->objects[(i)])

#define ho_objmap_get_width(m) ((m)->width)

#define ho_objmap_get_height(m) ((m)->height)

Functions

ho_objlist * ho_objlist_new ()

int ho_objlist_free (ho_objlist *object_list)

int ho_objlist_add (ho_objlist *object_list, double weight, int x, int y, int width, int height)

int ho_objlist_get_index (ho_objlist *object_list, int index)

ho_obj * ho_objlist_get_object (ho_objlist *object_list, int index)

int ho_objlist_add_pixel (ho_objlist *object_list, int index, int x, int y)

int ho_objlist_link (ho_objlist *object_list, int index1, int index2)

int ho_objlist_clean (ho_objlist *object_list, int **map)

int ho_objlist_clean_by_reading_index (ho_objlist *object_list, int **map)

int ho_objlist_print (ho_objlist *object_list)

int ho_objlist_statistics (ho_objlist *object_list, int min_height, int max_height, int min_width, int max_width, int *counter, double *weight_avg, double *weight_com, double *weight_min, double *weight_max, int *height_avg, int *height_com, int *height_min, int *height_max, int *width_avg, int *width_com, int *width_min, int *width_max)

ho_objmap * ho_objmap_new (const int width, const int height)

int ho_objmap_free (ho_objmap *m)

int ho_objmap_clean (ho_objmap *m)

int ho_objmap_sort_by_reading_index (ho_objmap *m, const unsigned char col, const unsigned char dir_ltr)

ho_objmap * ho_objmap_new_from_bitmap (const ho_bitmap *bit_in)

int ho_objmap_font_metrix (const ho_objmap *m, const int min_height, const int max_height, const int min_width, const int max_width, int *height, int *width, unsigned char *nikud)

ho_bitmap * ho_objmap_to_bitmap (const ho_objmap *obj_in)

ho_bitmap * ho_objmap_to_bitmap_by_size (const ho_objmap *m, int min_height, int max_height, int min_width, int max_width)

ho_bitmap * ho_objmap_to_bitmap_by_index (const ho_objmap *m, const int index)

ho_bitmap * ho_objmap_to_bitmap_by_index_window (const ho_objmap *m, const int index, const int frame)

int ho_objmap_update_reading_index (ho_objmap *m, const unsigned char n_columns, const unsigned char dir_ltr)

ho_obj * ho_objmap_get_object_by_index (ho_objmap *m, int index)

Detailed Description

libhocr C language header.

libhocr - LIBrary for Hebrew Optical Character Recognition

Define Documentation

#define HO_OBJMAP_H 1

#define ho_objmap_set(m, x, y, val) (((m)->map)[(x) + (y) * (m)->width] = (val))

#define ho_objmap_get(m, x, y) (((m)->map)[(x) + (y) * (m)->width])

#define ho_objmap_get_size(m) ((m)->obj_list->size)

#define ho_objmap_get_object(m, i) ((m)->obj_list->objects[(i)])

#define ho_objmap_get_width(m) ((m)->width)

#define ho_objmap_get_height(m) ((m)->height)

Function Documentation

ho_objlist* ho_objlist_new ()

int ho_objlist_free (ho_objlist * object_list)

int ho_objlist_add (ho_objlist * object_list, double weight, int x, int y, int width, int height)

int ho_objlist_get_index (ho_objlist * object_list, int index)

ho_obj* ho_objlist_get_object (ho_objlist * object_list, int index)

int ho_objlist_add_pixel (ho_objlist * object_list, int index, int x, int y)

int ho_objlist_clean (ho_objlist * object_list, int ** map)

int ho_objlist_clean_by_reading_index (ho_objlist * object_list, int ** map)

int ho_objlist_print (ho_objlist * object_list)

int ho_objlist_statistics (ho_objlist * object_list, int min_height, int max_height, int min_width, int max_width, int * counter, double * weight_avg, double * weight_com, double * weight_min, double * weight_max, int * height_avg, int * height_com, int * height_min, int * height_max, int * width_avg, int * width_com, int * width_min, int * width_max)

ho_objmap* ho_objmap_new (const int width, const int height)

new ho_pixbuf

Parameters:

height hight of pixbuf in pixels
width width of pixbuf in pixels

Returns:

newly allocated ho_pixbuf

int ho_objmap_free (ho_objmap * m)

free an ho_objmap

Parameters:

m pointer to an ho_objmap

Returns:

FALSE

int ho_objmap_clean (ho_objmap * m)

clean the ho_objmap index list

Parameters:

m pointer to an ho_objmap

Returns:

FALSE

int ho_objmap_sort_by_reading_index (ho_objmap * m, const unsigned char col, const unsigned char dir_ltr)

sort the ho_objmap by reading index

Parameters:

m pointer to an ho_objmap
col numbere of columns
dir_ltr true-ltr false-rtl

Returns:

FALSE

ho_objmap* ho_objmap_new_from_bitmap (const ho_bitmap * bit_in)

new ho_objmap from ho_bitmap

Parameters:

bit_in pointer to an ho_bitmap image

Returns:

newly allocated ho_objmap

int ho_objmap_font_metrix (const ho_objmap * m, const int min_height, const int max_height, const int min_width, const int max_width, int * height, int * width, unsigned char * nikud)

guess font metrics

Parameters:

m pointer to an ho_objmap
min_height only objects with this minimal height are used
max_height only objects with this maximal height are used
min_width only objects with this minimal width are used
max_width only objects with this maximal width are used
height pointer to return the guessed font average height
width pointer to return the guessed font average width
nikud pointer to return the guessed nikud in page

Returns:

FALSE

ho_bitmap* ho_objmap_to_bitmap (const ho_objmap * obj_in)

new ho_bitamp from objmap

Parameters:

obj_in the object map to use

Returns:

newly allocated ho_bitmap

ho_bitmap* ho_objmap_to_bitmap_by_size (const ho_objmap * m, int min_height, int max_height, int min_width, int max_width)

copy objects from objmap to bitmap by size

Parameters:

m pointer to an ho_objmap
min_height only objects with this minimal height are copied
max_height only objects with this maximal height are copied
min_width only objects with this minimal width are copied
max_width only objects with this maximal width are copied

Returns:

a newly allocated bitmap

ho_bitmap* ho_objmap_to_bitmap_by_index (const ho_objmap * m, const int index)

copy objects from objmap to bitmap by index

Parameters:

m pointer to an ho_objmap
index the index of the object to copy

Returns:

a newly allocated bitmap size of objmap

ho_bitmap* ho_objmap_to_bitmap_by_index_window (const ho_objmap * m, const int index, const int frame)

copy objects from objmap to bitmap by index of the object

Parameters:

m pointer to an ho_objmap
index the index of the object to copy
frame size of white frame in the new bitmap

Returns:

a newly allocated bitmap size of object + frame

int ho_objmap_update_reading_index (ho_objmap * m, const unsigned char n_columns, const unsigned char dir_ltr)

guess reading_index

Parameters:

m pointer to an ho_objmap
n_columns numbere of columns
dir_ltr true-ltr false-rtl

Returns:

FALSE

ho_obj* ho_objmap_get_object_by_index (ho_objmap * m, int index)

get an object by index

Parameters:

m pointer to an ho_objmap
index the object index

Returns:

the object

Author

Generated automatically by Doxygen for libhocr from the source code.

Info

31 Jul 2008 Version 0.10.17 libhocr