Tesseract 3.02

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes
ScratchEvidence Struct Reference

`#include <intmatcher.h>`

List of all members.

## 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 76 of file intmatcher.h.

## Member Function Documentation

void ScratchEvidence::Clear | ( | const INT_CLASS | class_template | ) |

Private Code —————————————————————————-

Definition at line 742 of file intmatcher.cpp.

{
memset(sum_feature_evidence_, 0,
class_template->NumConfigs * sizeof(sum_feature_evidence_[0]));
memset(proto_evidence_, 0,
class_template->NumProtos * sizeof(proto_evidence_[0]));
}

void ScratchEvidence::ClearFeatureEvidence | ( | const INT_CLASS | class_template | ) |

Definition at line 749 of file intmatcher.cpp.

{
memset(feature_evidence_, 0,
class_template->NumConfigs * sizeof(feature_evidence_[0]));
}

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

Definition at line 1226 of file intmatcher.cpp.

{
for (int i = 0; i < ClassTemplate->NumConfigs; i++) {
sum_feature_evidence_[i] = (sum_feature_evidence_[i] << 8) /
(NumFeatures + ClassTemplate->ConfigLengths[i]);
}
}

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

Definition at line 1184 of file intmatcher.cpp.

{
int *IntPointer;
uinT32 ConfigWord;
int ProtoSetIndex;
uinT16 ProtoNum;
PROTO_SET ProtoSet;
int NumProtos;
uinT16 ActualProtoNum;
NumProtos = ClassTemplate->NumProtos;
for (ProtoSetIndex = 0; ProtoSetIndex < ClassTemplate->NumProtoSets;
ProtoSetIndex++) {
ProtoSet = ClassTemplate->ProtoSets[ProtoSetIndex];
ActualProtoNum = (ProtoSetIndex * PROTOS_PER_PROTO_SET);
for (ProtoNum = 0;
((ProtoNum < PROTOS_PER_PROTO_SET) && (ActualProtoNum < NumProtos));
ProtoNum++, ActualProtoNum++) {
int temp = 0;
for (int i = 0; i < ClassTemplate->ProtoLengths[ActualProtoNum]; i++)
temp += proto_evidence_[ActualProtoNum] [i];
ConfigWord = ProtoSet->Protos[ProtoNum].Configs[0];
ConfigWord &= *ConfigMask;
IntPointer = sum_feature_evidence_;
while (ConfigWord) {
if (ConfigWord & 1)
*IntPointer += temp;
IntPointer++;
ConfigWord >>= 1;
}
}
}
}

## Member Data Documentation

uinT8 ScratchEvidence::feature_evidence_[MAX_NUM_CONFIGS]

Definition at line 77 of file intmatcher.h.

uinT8 ScratchEvidence::proto_evidence_[MAX_NUM_PROTOS][MAX_PROTO_INDEX]

Definition at line 79 of file intmatcher.h.

int ScratchEvidence::sum_feature_evidence_[MAX_NUM_CONFIGS]

Definition at line 78 of file intmatcher.h.

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

- /mnt/data/src/tesseract-ocr/classify/intmatcher.h
- /mnt/data/src/tesseract-ocr/classify/intmatcher.cpp