tesseract  4.00.00dev
ScratchEvidence Struct Reference

#include <intmatcher.h>

Public Member Functions

void Clear (const INT_CLASS class_template)
 
void ClearFeatureEvidence (const INT_CLASS class_template)
 
void NormalizeSums (INT_CLASS ClassTemplate, inT16 NumFeatures, inT32 used_features)
 
void UpdateSumOfProtoEvidences (INT_CLASS ClassTemplate, BIT_VECTOR ConfigMask, inT16 NumFeatures)
 

Public Attributes

uinT8 feature_evidence_ [MAX_NUM_CONFIGS]
 
int sum_feature_evidence_ [MAX_NUM_CONFIGS]
 
uinT8 proto_evidence_ [MAX_NUM_PROTOS][MAX_PROTO_INDEX]
 

Detailed Description

Definition at line 69 of file intmatcher.h.

Member Function Documentation

◆ Clear()

void ScratchEvidence::Clear ( const INT_CLASS  class_template)

Definition at line 708 of file intmatcher.cpp.

708  {
709  memset(sum_feature_evidence_, 0,
710  class_template->NumConfigs * sizeof(sum_feature_evidence_[0]));
711  memset(proto_evidence_, 0,
712  class_template->NumProtos * sizeof(proto_evidence_[0]));
713 }
uinT16 NumProtos
Definition: intproto.h:108
uinT8 proto_evidence_[MAX_NUM_PROTOS][MAX_PROTO_INDEX]
Definition: intmatcher.h:72
int sum_feature_evidence_[MAX_NUM_CONFIGS]
Definition: intmatcher.h:71
uinT8 NumConfigs
Definition: intproto.h:110

◆ ClearFeatureEvidence()

void ScratchEvidence::ClearFeatureEvidence ( const INT_CLASS  class_template)

Definition at line 715 of file intmatcher.cpp.

715  {
716  memset(feature_evidence_, 0,
717  class_template->NumConfigs * sizeof(feature_evidence_[0]));
718 }
uinT8 feature_evidence_[MAX_NUM_CONFIGS]
Definition: intmatcher.h:70
uinT8 NumConfigs
Definition: intproto.h:110

◆ NormalizeSums()

void ScratchEvidence::NormalizeSums ( INT_CLASS  ClassTemplate,
inT16  NumFeatures,
inT32  used_features 
)

Normalize Sum of Proto and Feature Evidence by dividing by the sum of the Feature Lengths and the Proto Lengths for each configuration.

Definition at line 1168 of file intmatcher.cpp.

1169  {
1170 
1171  for (int i = 0; i < ClassTemplate->NumConfigs; i++) {
1173  (NumFeatures + ClassTemplate->ConfigLengths[i]);
1174  }
1175 }
int sum_feature_evidence_[MAX_NUM_CONFIGS]
Definition: intmatcher.h:71
uinT16 ConfigLengths[MAX_NUM_CONFIGS]
Definition: intproto.h:113
uinT8 NumConfigs
Definition: intproto.h:110

◆ UpdateSumOfProtoEvidences()

void ScratchEvidence::UpdateSumOfProtoEvidences ( INT_CLASS  ClassTemplate,
BIT_VECTOR  ConfigMask,
inT16  NumFeatures 
)

Add sum of Proto Evidences into Sum Of Feature Evidence Array

Definition at line 1127 of file intmatcher.cpp.

1128  {
1129 
1130  int *IntPointer;
1131  uinT32 ConfigWord;
1132  int ProtoSetIndex;
1133  uinT16 ProtoNum;
1134  PROTO_SET ProtoSet;
1135  int NumProtos;
1136  uinT16 ActualProtoNum;
1137 
1138  NumProtos = ClassTemplate->NumProtos;
1139 
1140  for (ProtoSetIndex = 0; ProtoSetIndex < ClassTemplate->NumProtoSets;
1141  ProtoSetIndex++) {
1142  ProtoSet = ClassTemplate->ProtoSets[ProtoSetIndex];
1143  ActualProtoNum = (ProtoSetIndex * PROTOS_PER_PROTO_SET);
1144  for (ProtoNum = 0;
1145  ((ProtoNum < PROTOS_PER_PROTO_SET) && (ActualProtoNum < NumProtos));
1146  ProtoNum++, ActualProtoNum++) {
1147  int temp = 0;
1148  for (int i = 0; i < ClassTemplate->ProtoLengths[ActualProtoNum]; i++)
1149  temp += proto_evidence_[ActualProtoNum] [i];
1150 
1151  ConfigWord = ProtoSet->Protos[ProtoNum].Configs[0];
1152  ConfigWord &= *ConfigMask;
1153  IntPointer = sum_feature_evidence_;
1154  while (ConfigWord) {
1155  if (ConfigWord & 1)
1156  *IntPointer += temp;
1157  IntPointer++;
1158  ConfigWord >>= 1;
1159  }
1160  }
1161  }
1162 }
uint32_t uinT32
Definition: host.h:39
uinT16 NumProtos
Definition: intproto.h:108
PROTO_SET ProtoSets[MAX_NUM_PROTO_SETS]
Definition: intproto.h:111
#define PROTOS_PER_PROTO_SET
Definition: intproto.h:48
uinT8 proto_evidence_[MAX_NUM_PROTOS][MAX_PROTO_INDEX]
Definition: intmatcher.h:72
uinT8 NumProtoSets
Definition: intproto.h:109
int sum_feature_evidence_[MAX_NUM_CONFIGS]
Definition: intmatcher.h:71
uinT8 * ProtoLengths
Definition: intproto.h:112
INT_PROTO_STRUCT Protos[PROTOS_PER_PROTO_SET]
Definition: intproto.h:97
uinT32 Configs[WERDS_PER_CONFIG_VEC]
Definition: intproto.h:86
uint16_t uinT16
Definition: host.h:37

Member Data Documentation

◆ feature_evidence_

uinT8 ScratchEvidence::feature_evidence_[MAX_NUM_CONFIGS]

Definition at line 70 of file intmatcher.h.

◆ proto_evidence_

uinT8 ScratchEvidence::proto_evidence_[MAX_NUM_PROTOS][MAX_PROTO_INDEX]

Definition at line 72 of file intmatcher.h.

◆ sum_feature_evidence_

int ScratchEvidence::sum_feature_evidence_[MAX_NUM_CONFIGS]

Definition at line 71 of file intmatcher.h.


The documentation for this struct was generated from the following files: