ho_array.h man page

src/ho_array.h — libhocr C language header.

Synopsis

#include <ho_pixbuf.h>
#include <ho_bitmap.h>

Data Structures

struct ho_array
libhocr array struct

Defines

#define HO_ARRAY_H 1

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

#define ho_array_get(m, x, y) (((m)->data)[(x)+(y)*(m)->width])

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

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

#define ho_array_get_data(m) ((m)->data)

Functions

ho_array * ho_array_new (const int width, const int height)

ho_array * ho_array_clone (const ho_array *m)

int ho_array_set_data (ho_array *pix, double data)

int ho_array_set_at (ho_array *pix, int x, int y, double data)

double ho_array_get_at (ho_array *pix, int x, int y)

ho_array * ho_array_new_from_pixbuf (const ho_pixbuf *pix)

ho_array * ho_array_new_from_bitmap (const ho_bitmap *pix)

ho_pixbuf * ho_array_to_pixbuf (const ho_array *pix_in)

ho_pixbuf * ho_array_to_rgb_pixbuf (const ho_array *pix_in)

int ho_array_free (ho_array *pix)

unsigned char ho_array_minmax (const ho_array *pix, double *min, double *max)

double ho_array_get_mean (const ho_array *pix)

double ho_array_get_min (const ho_array *pix)

double ho_array_get_max (const ho_array *pix)

unsigned char ho_array_add (ho_array *ar1, const ho_array *ar2)

unsigned char ho_array_add_const (ho_array *ar, const double num)

unsigned char ho_array_sub (ho_array *ar1, const ho_array *ar2)

unsigned char ho_array_mul (ho_array *ar1, const ho_array *ar2)

unsigned char ho_array_complex_mul (ho_array *ar1_r, ho_array *ar1_i, const ho_array *ar2_r, const ho_array *ar2_i)

unsigned char ho_array_mul_const (ho_array *ar, const double num)

unsigned char ho_array_div (ho_array *ar1, const ho_array *ar2)

unsigned char ho_array_inv (ho_array *ar)

unsigned char ho_array_polerize (ho_array *ar, const double treshold)

unsigned char ho_array_log (ho_array *ar)

unsigned char ho_array_streach (ho_array *ar)

unsigned char ho_array_equl (ho_array *ar)

ho_array * ho_array_convolution_filter (const ho_array *ar, const ho_array *kernel)

ho_array * ho_array_median_filter (const ho_array *ar)

ho_array * ho_array_max_filter (const ho_array *ar)

ho_array * ho_array_min_filter (const ho_array *ar)

ho_array * ho_array_complex_abs (const ho_array *ar_r, const ho_array *ar_i)

ho_array * ho_array_complex_atan2 (const ho_array *ar_r, const ho_array *ar_i)

unsigned char ho_array_gradient (const ho_array *ar, ho_array *ar_r, ho_array *ar_theta)

ho_array * ho_array_hough_circles (const ho_array *ar, const int min_radius, const int max_radius, const unsigned char threshold)

ho_array * ho_array_hough_lines (const ho_array *ar, const unsigned char threshold)

ho_array * ho_array_hough_lines_backwords (const ho_array *ar, const int width, const int height, const unsigned char threshold)

ho_array * ho_array_hough_lines_backwords_by_angle (const ho_array *ar, const int width, const int height, const int angle1, const int angle2)

ho_array * ho_array_hough_lines_backwords_by_angle_v (const ho_array *ar, const int width, const int height, const int angle1, const int angle2)

unsigned char ho_array_fft_forword (const ho_array *ar, ho_array *ar_r, ho_array *ar_im)

unsigned char ho_array_fft_backword (const ho_array *ar_r, const ho_array *ar_im, ho_array *ar)

unsigned char ho_array_fft_shift (const ho_array *ar_r, const ho_array *ar_im, ho_array *shift_ar_r, ho_array *shift_ar_im)

unsigned char ho_array_fft_filter (ho_array *ar, const ho_array *ar_filter)

unsigned char ho_array_fft_filter_box (ho_array *ar, const int box_width, const int box_height)

unsigned char ho_array_fft_filter_circle (ho_array *ar, const int radius)

unsigned char ho_array_fft_filter_gaussien (ho_array *ar, const double sigma)

int ho_array_pnm_save (const ho_array *ar, const char *filename)

const ho_array * ho_array_pnm_load (const char *filename)

int ho_array_tiff_save (const ho_array *ar, const char *filename)

const ho_array * ho_array_tiff_load (const char *filename)

ho_array * ho_array_new_gaussien (const int width, const int height, const double sigma)

ho_array * ho_array_new_box (const int width, const int height, const int box_width, const int box_height)

ho_array * ho_array_new_circle (const int width, const int height, const int radius)

Detailed Description

libhocr C language header.

libhocr - LIBrary for Hebrew Optical Character Recognition

Define Documentation

#define HO_ARRAY_H 1

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

#define ho_array_get(m, x, y) (((m)->data)[(x)+(y)*(m)->width])

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

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

#define ho_array_get_data(m) ((m)->data)

Function Documentation

ho_array* ho_array_new (const int width, const int height)

new ho_array

Parameters:

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

Returns:

newly allocated ho_array

ho_array* ho_array_clone (const ho_array * m)

clone ho_array

Parameters:

m pointer to a ho_array image

Returns:

newly allocated gray ho_array

int ho_array_set_data (ho_array * pix, double data)

copy pixel data to a ho_array

Parameters:

pix pointer to a ho_array image
data the pixel data to copy

Returns:

false

int ho_array_set_at (ho_array * pix, int x, int y, double data)

copy pixel data to a ho_array

Parameters:

pix pointer to a ho_array image
data the pixel data to copy
x the pixel x
y the pixel y

Returns:

false

double ho_array_get_at (ho_array * pix, int x, int y)

get pixel data from a ho_array

Parameters:

pix pointer to a ho_array image
x the pixel x
y the pixel y

Returns:

false

ho_array* ho_array_new_from_pixbuf (const ho_pixbuf * pix)

new ho_array from ho_pixbuf

Parameters:

pix pointer to an ho_pixbuf image

Returns:

newly allocated ho_array

ho_array* ho_array_new_from_bitmap (const ho_bitmap * pix)

new ho_array from ho_bitmap

Parameters:

pix pointer to an ho_bitmap image

Returns:

newly allocated ho_array

ho_pixbuf* ho_array_to_pixbuf (const ho_array * pix_in)

new gray ho_pixbuf from ho_array

Parameters:

pix_in pointer the original array

Returns:

newly allocated gray ho_pixbuf

ho_pixbuf* ho_array_to_rgb_pixbuf (const ho_array * pix_in)

new rgb ho_pixbuf from ho_array

Parameters:

pix_in pointer the original array

Returns:

newly allocated gray ho_pixbuf

int ho_array_free (ho_array * pix)

free an ho_array

Parameters:

pix pointer to an ho_array

Returns:

FALSE

unsigned char ho_array_minmax (const ho_array * pix, double * min, double * max)

get the min and max values in a array

Parameters:

pix ho_array
min a pointer to return the min
max a pointer to return the max

Returns:

FALSE

double ho_array_get_mean (const ho_array * pix)

get the mean value in a array

Parameters:

pix ho_array

Returns:

min value

double ho_array_get_min (const ho_array * pix)

get the min value in a array

Parameters:

pix ho_array

Returns:

min value

double ho_array_get_max (const ho_array * pix)

get the max value in a array

Parameters:

pix ho_array

Returns:

max value

unsigned char ho_array_add (ho_array * ar1, const ho_array * ar2)

add two ho arrays

Parameters:

ar1 left side ho_array
ar2 right side ho_array

Returns:

FALSE

unsigned char ho_array_add_const (ho_array * ar, const double num)

add const to ho arrays

Parameters:

ar left side ho_array
num a number to add to array

Returns:

FALSE

unsigned char ho_array_sub (ho_array * ar1, const ho_array * ar2)

subtruct two ho arrays

Parameters:

ar1 left side ho_array
ar2 right side ho_array

Returns:

FALSE

unsigned char ho_array_mul (ho_array * ar1, const ho_array * ar2)

multiply two ho arrays

Parameters:

ar1 left side ho_array
ar2 right side ho_array

Returns:

FALSE

unsigned char ho_array_complex_mul (ho_array * ar1_r, ho_array * ar1_i, const ho_array * ar2_r, const ho_array * ar2_i)

multiply two ho real and imagenary ho_arrays pairs

Parameters:

ar1_r left side ho_array real part
ar1_i left side ho_array imagenaryl part
ar2_r right side ho_array real part
ar2_i right side ho_array imagenary part

Returns:

FALSE

unsigned char ho_array_mul_const (ho_array * ar, const double num)

multiply const to ho arrays

Parameters:

ar left side ho_array
num a number to multiply to array

Returns:

FALSE

unsigned char ho_array_div (ho_array * ar1, const ho_array * ar2)

divide two ho arrays

Parameters:

ar1 left side ho_array
ar2 right side ho_array

Returns:

FALSE

unsigned char ho_array_inv (ho_array * ar)

inverse ho array

Parameters:

ar ho_array

Returns:

FALSE

unsigned char ho_array_polerize (ho_array * ar, const double treshold)

polerize ho array

Parameters:

ar ho_array

Returns:

FALSE

unsigned char ho_array_log (ho_array * ar)

do log (ho array + 1)

Parameters:

ar ho_array

Returns:

FALSE

unsigned char ho_array_streach (ho_array * ar)

streach 0..1

Parameters:

ar ho_array

Returns:

FALSE

unsigned char ho_array_equl (ho_array * ar)

histogram equalization 0..1

Parameters:

ar ho_array

Returns:

FALSE

ho_array* ho_array_convolution_filter (const ho_array * ar, const ho_array * kernel)

convolution

Parameters:

ar the ho_array to us for the convolution
kernel a 3x3 kernel ho_array

Returns:

newly allocated ho array

ho_array* ho_array_median_filter (const ho_array * ar)

median

Parameters:

ar the ho_array to us for median filter

Returns:

newly allocated ho array

ho_array* ho_array_max_filter (const ho_array * ar)

max filter

Parameters:

ar the ho_array to us for max filter

Returns:

newly allocated ho array

ho_array* ho_array_min_filter (const ho_array * ar)

min filter

Parameters:

ar the ho_array to us for max filter

Returns:

newly allocated ho array

ho_array* ho_array_complex_abs (const ho_array * ar_r, const ho_array * ar_i)

absulute value

Parameters:

ar_r real part ho_array
ar_i imagenary part ho_array

Returns:

newly allocated ho array

ho_array* ho_array_complex_atan2 (const ho_array * ar_r, const ho_array * ar_i)

atan2

Parameters:

ar_r real part ho_array
ar_i imagenary part ho_array

Returns:

newly allocated ho array

unsigned char ho_array_gradient (const ho_array * ar, ho_array * ar_r, ho_array * ar_theta)

gradient

Parameters:

ar the ho_array to us for gradient detection
ar_r return the r value of the gradient
ar_theta return the theta value of the gradient

Returns:

FALSE

ho_array* ho_array_hough_circles (const ho_array * ar, const int min_radius, const int max_radius, const unsigned char threshold)

hough trasform for circles

Parameters:

ar the ho_array to us for gradient detection
min_radius the circles min radius
max_radius the circles max radius
threshold the min value to use in the gradient matrix percent

Returns:

the transformed matrix

ho_array* ho_array_hough_lines (const ho_array * ar, const unsigned char threshold)

hough trasform for lines

Parameters:

ar the ho_array to use for gradient detection
threshold the min value to use in the gradient matrix percent

Returns:

the transformed matrix

ho_array* ho_array_hough_lines_backwords (const ho_array * ar, const int width, const int height, const unsigned char threshold)

backwords hough trasform for lines

Parameters:

ar the ho_array to use for backword hough
width the array height
height the array height

Returns:

the backword transformed matrix

ho_array* ho_array_hough_lines_backwords_by_angle (const ho_array * ar, const int width, const int height, const int angle1, const int angle2)

backwords hough trasform for lines by angle

Parameters:

ar the ho_array to use for backword hough
width the array height
height the array height
angle1 start line angle
angle2 end line angle

Returns:

FALSE

ho_array* ho_array_hough_lines_backwords_by_angle_v (const ho_array * ar, const int width, const int height, const int angle1, const int angle2)

backwords hough trasform for lines by vertical angle

Parameters:

ar the ho_array to use for backword hough
width the array height
height the array height
angle1 start line angle
angle2 end line angle

Returns:

FALSE

unsigned char ho_array_fft_forword (const ho_array * ar, ho_array * ar_r, ho_array * ar_im)

fft_forword

Parameters:

ar the ho_array to us for fft
ar_re the output real values
ar_im the output imaginary values

Returns:

FALSE

unsigned char ho_array_fft_backword (const ho_array * ar_r, const ho_array * ar_im, ho_array * ar)

fft_backword

Parameters:

ar_re input array of the real values
ar_im input array of the imaginary values
ar the output ho_array

Returns:

FALSE

unsigned char ho_array_fft_shift (const ho_array * ar_r, const ho_array * ar_im, ho_array * shift_ar_r, ho_array * shift_ar_im)

fft_shift

Parameters:

ar_re input array of the real values
ar_im input array of the imaginary values
shift_ar_re output array of the real values
shift_ar_im output array of the imaginary values

Returns:

FALSE

unsigned char ho_array_fft_filter (ho_array * ar, const ho_array * ar_filter)

fft_filter - applay a filter in w space

Parameters:

ar input array
ar_filter input array of the filter

Returns:

FALSE

unsigned char ho_array_fft_filter_box (ho_array * ar, const int box_width, const int box_height)

fft_filter - applay a box filter in w space

Parameters:

ar input array
box_height height of box
box_width width of box

Returns:

FALSE

unsigned char ho_array_fft_filter_circle (ho_array * ar, const int radius)

fft_filter - applay a circle filter in w space

Parameters:

ar input array
radius radius of circle

Returns:

FALSE

unsigned char ho_array_fft_filter_gaussien (ho_array * ar, const double sigma)

fft_filter - applay a gaussien filter in w space

Parameters:

ar input array
sigma of gaussien

Returns:

FALSE

int ho_array_pnm_save (const ho_array * ar, const char * filename)

writes ho_array to pnm file

Parameters:

ar ho_array to save as gray image
filename save as file name

Returns:

FALSE

const ho_array* ho_array_pnm_load (const char * filename)

load ho_array from pnm file

Parameters:

filename save as file name

Returns:

new ho_array

int ho_array_tiff_save (const ho_array * ar, const char * filename)

writes ho_array to tiff file

Parameters:

ar ho_array to save as gray image
filename save as file name

Returns:

FALSE

const ho_array* ho_array_tiff_load (const char * filename)

load ho_array from tiff file

Parameters:

filename save as file name

Returns:

new ho_array

ho_array* ho_array_new_gaussien (const int width, const int height, const double sigma)

new ho_array init to gaussian

Parameters:

height hight of pixbuf in pixels
width width of pixbuf in pixels
sigma the sigma to use in the gaussien

Returns:

newly allocated ho_array

ho_array* ho_array_new_box (const int width, const int height, const int box_width, const int box_height)

new ho_array init to box

Parameters:

height hight of pixbuf in pixels
width width of pixbuf in pixels
box_height height of box
box_width width of box

Returns:

newly allocated ho_array

ho_array* ho_array_new_circle (const int width, const int height, const int radius)

new ho_array init to circle

Parameters:

height hight of pixbuf in pixels
width width of pixbuf in pixels
radius radius of circle

Returns:

newly allocated ho_array

Author

Generated automatically by Doxygen for libhocr from the source code.

Info

31 Jul 2008 Version 0.10.17 libhocr