jabcode
 All Classes Files Functions Variables Enumerations Macros
detector.h
Go to the documentation of this file.
1 
14 #ifndef JABCODE_DETECTOR_H
15 #define JABCODE_DETECTOR_H
16 
17 #define TEST_MODE 1
18 #if TEST_MODE
19 jab_bitmap* test_mode_bitmap;
20 #endif
21 
22 #define MAX_MODULES 145 //the number of modules in side-version 32
23 #define MAX_SYMBOL_ROWS 3
24 #define MAX_SYMBOL_COLUMNS 3
25 #define MAX_FINDER_PATTERNS 200
26 #define PI 3.14159265
27 #define CROSS_AREA_WIDTH 14 //the width of the area across the host and slave symbols
28 
29 #define DIST(x1, y1, x2, y2) (jab_float)(sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)))
30 
31 typedef enum
32 {
33  QUICK_DETECT = 0,
34  NORMAL_DETECT,
35  INTENSIVE_DETECT
36 }jab_detect_mode;
37 
41 typedef struct {
42  jab_int32 type;
43  jab_float module_size;
44  jab_point center; //coordinates of the center
45  jab_int32 found_count;
46  jab_int32 direction;
48 
52 typedef struct {
53  jab_int32 type;
54  jab_float module_size;
55  jab_point center; //coordinates of the center
56  jab_int32 found_count;
57  jab_int32 direction;
59 
63 typedef struct {
64  jab_float a11;
65  jab_float a12;
66  jab_float a13;
67  jab_float a21;
68  jab_float a22;
69  jab_float a23;
70  jab_float a31;
71  jab_float a32;
72  jab_float a33;
74 
75 
76 extern jab_bitmap* binarizer(jab_bitmap* bitmap, jab_int32 channel);
77 extern jab_bitmap* binarizerHist(jab_bitmap* bitmap, jab_int32 channel);
78 extern jab_bitmap* binarizerHard(jab_bitmap* bitmap, jab_int32 channel, jab_int32 threshold);
80  jab_point p2, jab_point p3,
81  jab_vector2d side_size);
82 extern jab_perspective_transform* perspectiveTransform( jab_float x0, jab_float y0,
83  jab_float x1, jab_float y1,
84  jab_float x2, jab_float y2,
85  jab_float x3, jab_float y3,
86  jab_float x0p, jab_float y0p,
87  jab_float x1p, jab_float y1p,
88  jab_float x2p, jab_float y2p,
89  jab_float x3p, jab_float y3p);
90 extern void warpPoints(jab_perspective_transform* pt, jab_point* points, jab_int32 length);
92 extern jab_bitmap* sampleSymbolwithNc(jab_bitmap* bitmap, jab_perspective_transform* pt, jab_vector2d side_size, jab_int32 symbol_type, jab_bitmap* ch[]);
94 
95 #endif
jab_bitmap * binarizerHist(jab_bitmap *bitmap, jab_int32 channel)
Binarize a color channel of a bitmap using histogram binarization algorithm.
Definition: binarizer.c:105
2-dimensional float vector
Definition: jabcode.h:79
jab_bitmap * binarizerHard(jab_bitmap *bitmap, jab_int32 channel, jab_int32 threshold)
Binarize a color channel of a bitmap using a given threshold.
Definition: binarizer.c:183
Code bitmap.
Definition: jabcode.h:95
jab_perspective_transform * getPerspectiveTransform(jab_point p0, jab_point p1, jab_point p2, jab_point p3, jab_vector2d side_size)
Get perspetive transformation matrix.
Definition: transform.c:202
Finder pattern.
Definition: detector.h:41
Perspective transform.
Definition: detector.h:63
void warpPoints(jab_perspective_transform *pt, jab_point *points, jab_int32 length)
Warp points from source image to destination image in place.
Definition: transform.c:225
jab_bitmap * sampleCrossArea(jab_bitmap *bitmap, jab_perspective_transform *pt)
Sample a cross area between the host and slave symbols.
Definition: sample.c:233
2-dimensional integer vector
Definition: jabcode.h:71
jab_bitmap * sampleSymbol(jab_bitmap *bitmap, jab_perspective_transform *pt, jab_vector2d side_size)
Sample a symbol.
Definition: sample.c:31
Alignment pattern.
Definition: detector.h:52
jab_bitmap * sampleSymbolwithNc(jab_bitmap *bitmap, jab_perspective_transform *pt, jab_vector2d side_size, jab_int32 symbol_type, jab_bitmap *ch[])
Sample a symbol.
Definition: sample.c:114
jab_bitmap * binarizer(jab_bitmap *bitmap, jab_int32 channel)
Binarize a color channel of a bitmap using local binarization algorithm.
Definition: binarizer.c:407
jab_perspective_transform * perspectiveTransform(jab_float x0, jab_float y0, jab_float x1, jab_float y1, jab_float x2, jab_float y2, jab_float x3, jab_float y3, jab_float x0p, jab_float y0p, jab_float x1p, jab_float y1p, jab_float x2p, jab_float y2p, jab_float x3p, jab_float y3p)
Calculate transformation matrix of quadrilateral to quadrilateral.
Definition: transform.c:164