-
Notifications
You must be signed in to change notification settings - Fork 0
/
image-proc.h
46 lines (28 loc) · 1.03 KB
/
image-proc.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
/* image-proc.h: image processing routines */
#ifndef IMAGE_PROC_H
#define IMAGE_PROC_H
#include "bitmap.h"
#include "color.h"
/* Threshold for binarizing a monochrome image */
#define GRAY_THRESHOLD 225
/* RGB to grayscale */
#define LUMINANCE(r, g, b) ((r) * 0.30 + (g) * 0.59 + (b) * 0.11 + 0.5)
typedef struct
{
unsigned height, width;
float **weight;
float **d;
} distance_map_type;
/* Allocate and compute a new distance map. */
extern distance_map_type new_distance_map(bitmap_type,
unsigned char target_value, at_bool padded,
at_exception_type * exp);
/* Free the dynamically-allocated storage associated with a distance map. */
extern void free_distance_map(distance_map_type*);
extern void medial_axis(bitmap_type *bitmap, distance_map_type *dist,
const color_type *bg_color);
/* Binarize a grayscale or color image. */
extern void binarize(bitmap_type*);
/* Thin a binary image, replacing the original image with the thinned one. */
extern bitmap_type ip_thin(bitmap_type);
#endif /* not IMAGE_PROC_H */