-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutil.h
51 lines (40 loc) · 1.36 KB
/
util.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
// util.h
// dsptest1
//
// Created by Lieven Govaerts on 14/12/12.
//
//
#ifndef dsptest1_util_h
#define dsptest1_util_h
#define LOG_BB 1
#define LOG_OCR 1
#define LOG_TEST 1
void dsptest_log(int verbose_flag, const char *filename, const char *fmt, ...);
/* Connected components and bounding boxes */
@interface conn_box_t : NSObject {
@public // TODO: change all these to properties
short int xmin;
short int xmax;
short int ymin;
short int ymax;
short int r,g,b,e; /* 4 colors representing 'canny' edges. */
/* collection of lines of connected pixels */
NSMutableArray *lines;
/* Image buffer for this box, 8 bits per pixel. */
unsigned char *img;
conn_box_t *dontMergeWith;
}
@end
void binarization_bounding_boxes(const unsigned char *inlum,
const NSArray* comps,
int width, int height);
NSArray* group_into_characters(const NSArray* comps, int width, int height);
NSArray* group_into_lines(const NSArray* comps, int width, int height);
void log_bounding_boxes(const NSArray* comps);
NSArray* connected_binary(const unsigned char *inptr, int width, int height);
char* filter_ocr_string(const char *txt);
void make_boxes_black_on_white_bg(const NSArray* comps);
/* for debugging only */
NSArray* remove_too_small(const NSArray* comps, int minWidth, int minHeight);
#endif