tesseract  4.0.0-1-g2a2b
matchdefs.h File Reference
#include "host.h"
#include <cstdio>
#include "unichar.h"

Go to the source code of this file.

Classes

struct  MATCH_RESULT
 

Macros

#define MAX_NUM_CLASSES   INT16_MAX
 
#define MAX_CLASS_ID   (MAX_NUM_CLASSES - 1)
 
#define NO_CLASS   (0)
 
#define NO_PROTO   (-1)
 
#define NO_FEATURE   255
 
#define NOISE_FEATURE   254
 
#define MISSING_PROTO   254
 
#define MAX_NUM_FEAT   40
 
#define MAX_FEATURE_ID   250
 
#define IsValidFeature(Fid)   ((Fid) < MAX_FEATURE_ID)
 
#define IsValidProto(Pid)   ((Pid) >= 0)
 
#define _ARGS(s)   ()
 

Typedefs

using CLASS_ID = UNICHAR_ID
 
using PROTO_ID = int16_t
 
using FEATURE_ID = uint8_t
 
using RATING = float
 
using CERTAINTY = float
 
typedef MATCH_RESULT SORTED_CLASSES[MAX_CLASS_ID+1]
 

Functions

int CompareMatchResults _ARGS ((MATCH_RESULT *Result1, MATCH_RESULT *Result2))
 
void PrintMatchResult _ARGS ((FILE *File, MATCH_RESULT *MatchResult))
 
void PrintMatchResults _ARGS ((FILE *File, int N, MATCH_RESULT MatchResults[]))
 

Macro Definition Documentation

◆ _ARGS

#define _ARGS (   s)    ()

Definition at line 97 of file matchdefs.h.

◆ IsValidFeature

#define IsValidFeature (   Fid)    ((Fid) < MAX_FEATURE_ID)

all feature matchers that are to be used with the high level classifier must support the following interface. The names will, of course, be unique for each different matcher. Note also that FEATURE_STRUCT is a data structure that is defined specifically for each feature extractor/matcher pair.

Definition at line 91 of file matchdefs.h.

◆ IsValidProto

#define IsValidProto (   Pid)    ((Pid) >= 0)

Definition at line 92 of file matchdefs.h.

◆ MAX_CLASS_ID

#define MAX_CLASS_ID   (MAX_NUM_CLASSES - 1)

Definition at line 33 of file matchdefs.h.

◆ MAX_FEATURE_ID

#define MAX_FEATURE_ID   250

Definition at line 53 of file matchdefs.h.

◆ MAX_NUM_CLASSES

#define MAX_NUM_CLASSES   INT16_MAX

Include Files and Type Defines

Definition at line 32 of file matchdefs.h.

◆ MAX_NUM_FEAT

#define MAX_NUM_FEAT   40

Definition at line 52 of file matchdefs.h.

◆ MISSING_PROTO

#define MISSING_PROTO   254

Definition at line 51 of file matchdefs.h.

◆ NO_CLASS

#define NO_CLASS   (0)

Definition at line 37 of file matchdefs.h.

◆ NO_FEATURE

#define NO_FEATURE   255

Definition at line 49 of file matchdefs.h.

◆ NO_PROTO

#define NO_PROTO   (-1)

Definition at line 43 of file matchdefs.h.

◆ NOISE_FEATURE

#define NOISE_FEATURE   254

Definition at line 50 of file matchdefs.h.

Typedef Documentation

◆ CERTAINTY

using CERTAINTY = float

a CERTAINTY is an indication of the degree of confidence of the classifier. Higher is better. 0 means the match is as good as the mean of the matches seen in training. -1 means the match was one standard deviation worse than the training matches, etc.

Definition at line 63 of file matchdefs.h.

◆ CLASS_ID

a CLASS_ID is the ascii character to be associated with a class

Definition at line 36 of file matchdefs.h.

◆ FEATURE_ID

using FEATURE_ID = uint8_t

FEATURE_ID is the index of a feature within a character description The feature id ranges from 0 to N-1 where N is the number of features in a character description.

Definition at line 48 of file matchdefs.h.

◆ PROTO_ID

using PROTO_ID = int16_t

a PROTO_ID is the index of a prototype within it's class. Valid proto id's are 0 to N-1 where N is the number of prototypes that make up the class.

Definition at line 42 of file matchdefs.h.

◆ RATING

using RATING = float

a RATING is the match rating returned by a classifier. Higher is better.

Definition at line 57 of file matchdefs.h.

◆ SORTED_CLASSES

typedef MATCH_RESULT SORTED_CLASSES[MAX_CLASS_ID+1]

define a data structure for holding an array of match results

Definition at line 77 of file matchdefs.h.

Function Documentation

◆ _ARGS() [1/3]

int CompareMatchResults _ARGS ( (MATCH_RESULT *Result1, MATCH_RESULT *Result2)  )

◆ _ARGS() [2/3]

void PrintMatchResult _ARGS ( (FILE *File, MATCH_RESULT *MatchResult)  )

◆ _ARGS() [3/3]

void PrintMatchResults _ARGS ( (FILE *File, int N, MATCH_RESULT MatchResults[])  )