tesseract
3.05.02
matchdefs.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Filename: matchdefs.h
3
** Purpose: Generic interface definitions for feature matchers.
4
** Author: Dan Johnson
5
** History: Fri Jan 19 09:21:25 1990, DSJ, Created.
6
**
7
** (c) Copyright Hewlett-Packard Company, 1988.
8
** Licensed under the Apache License, Version 2.0 (the "License");
9
** you may not use this file except in compliance with the License.
10
** You may obtain a copy of the License at
11
** http://www.apache.org/licenses/LICENSE-2.0
12
** Unless required by applicable law or agreed to in writing, software
13
** distributed under the License is distributed on an "AS IS" BASIS,
14
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
** See the License for the specific language governing permissions and
16
** limitations under the License.
17
******************************************************************************/
18
#ifndef MATCHDEFS_H
19
#define MATCHDEFS_H
20
24
#include "
host.h
"
25
#include <stdio.h>
26
#include "
unichar.h
"
27
28
/* define the maximum number of classes defined for any matcher
29
and the maximum class id for any matcher. This must be changed
30
if more different classes need to be classified */
31
#define MAX_NUM_CLASSES MAX_INT16
32
#define MAX_CLASS_ID (MAX_NUM_CLASSES - 1)
33
35
typedef
UNICHAR_ID
CLASS_ID
;
36
#define NO_CLASS (0)
37
41
typedef
inT16
PROTO_ID
;
42
#define NO_PROTO (-1)
43
47
typedef
uinT8
FEATURE_ID
;
48
#define NO_FEATURE 255
49
#define NOISE_FEATURE 254
50
#define MISSING_PROTO 254
51
#define MAX_NUM_FEAT 40
52
#define MAX_FEATURE_ID 250
53
56
typedef
FLOAT32
RATING
;
57
62
typedef
FLOAT32
CERTAINTY
;
63
65
typedef
struct
66
{
67
CLASS_ID
Class
;
68
RATING
Rating
;
69
CERTAINTY
Certainty
;
70
}
71
72
73
MATCH_RESULT
;
74
76
typedef
MATCH_RESULT
SORTED_CLASSES
[
MAX_CLASS_ID
+ 1];
77
78
/*----------------------------------------------------------------------------
79
Public Function Prototypes
80
----------------------------------------------------------------------------*/
89
/* misc test functions for proto id's and feature id's */
90
#define IsValidFeature(Fid) ((Fid) < MAX_FEATURE_ID)
91
#define IsValidProto(Pid) ((Pid) >= 0)
92
93
#if defined(__STDC__) || defined(__cplusplus)
94
# define _ARGS(s) s
95
#else
96
# define _ARGS(s) ()
97
#endif
98
99
/* matchdefs.c */
100
int
CompareMatchResults
101
_ARGS
((
MATCH_RESULT
* Result1,
MATCH_RESULT
* Result2));
102
103
void
PrintMatchResult
_ARGS
((FILE * File,
MATCH_RESULT
* MatchResult));
104
105
void
PrintMatchResults
106
_ARGS
((FILE * File,
int
N,
MATCH_RESULT
MatchResults[]));
107
108
#undef _ARGS
109
110
/*----------------------------------------------------------------------------
111
Global Data Definitions and Declarations
112
----------------------------------------------------------------------------*/
113
#endif
host.h
MATCH_RESULT::Certainty
CERTAINTY Certainty
Definition:
matchdefs.h:69
SORTED_CLASSES
MATCH_RESULT SORTED_CLASSES[MAX_CLASS_ID+1]
Definition:
matchdefs.h:76
inT16
short inT16
Definition:
host.h:33
MATCH_RESULT::Class
CLASS_ID Class
Definition:
matchdefs.h:67
PROTO_ID
inT16 PROTO_ID
Definition:
matchdefs.h:41
uinT8
unsigned char uinT8
Definition:
host.h:32
MAX_CLASS_ID
#define MAX_CLASS_ID
Definition:
matchdefs.h:32
CLASS_ID
UNICHAR_ID CLASS_ID
Definition:
matchdefs.h:35
RATING
FLOAT32 RATING
Definition:
matchdefs.h:56
unichar.h
FEATURE_ID
uinT8 FEATURE_ID
Definition:
matchdefs.h:47
_ARGS
#define _ARGS(s)
Definition:
matchdefs.h:96
MATCH_RESULT
Definition:
matchdefs.h:65
FLOAT32
float FLOAT32
Definition:
host.h:44
CERTAINTY
FLOAT32 CERTAINTY
Definition:
matchdefs.h:62
MATCH_RESULT::Rating
RATING Rating
Definition:
matchdefs.h:68
UNICHAR_ID
int UNICHAR_ID
Definition:
unichar.h:33
dict
matchdefs.h
Generated on Mon Oct 29 2018 11:27:50 for tesseract by
1.8.14