|
Tesseract
3.02
|
#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] |
Definition at line 76 of file intmatcher.h.
| void ScratchEvidence::Clear | ( | const INT_CLASS | class_template | ) |
---------------------------------------------------------------------------- Private Code ----------------------------------------------------------------------------
Definition at line 741 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 748 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 1225 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 1183 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;
}
}
}
}
| 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.