diff --git a/src/classify/protos.cpp b/src/classify/protos.cpp index f316b02db9..9958c321d4 100644 --- a/src/classify/protos.cpp +++ b/src/classify/protos.cpp @@ -2,13 +2,7 @@ ****************************************************************************** * * File: protos.cpp (Formerly protos.c) - * Description: - * Author: Mark Seaman, OCR Technology - * Created: Fri Oct 16 14:37:00 1987 - * Modified: Mon Mar 4 14:51:24 1991 (Dan Johnson) danj@hpgrlj - * Language: C - * Package: N/A - * Status: Reusable Software Component + * Author: Mark Seaman, OCR Technology * * (c) Copyright 1987, Hewlett-Packard Company. ** Licensed under the Apache License, Version 2.0 (the "License"); @@ -39,13 +33,6 @@ #define PROTO_INCREMENT 32 #define CONFIG_INCREMENT 16 -/*---------------------------------------------------------------------- - V a r i a b l e s -----------------------------------------------------------------------*/ -CLASS_STRUCT TrainingData[NUMBER_OF_CLASSES]; - -STRING_VAR(classify_training_file, "MicroFeatures", "Training file"); - /*---------------------------------------------------------------------- F u n c t i o n s ----------------------------------------------------------------------*/ @@ -128,65 +115,6 @@ int AddProtoToClass(CLASS_TYPE Class) { } -/** - * @name ClassConfigLength - * - * Return the length of all the protos in this class. - * - * @param Class The class to add to - * @param Config FIXME - */ -float ClassConfigLength(CLASS_TYPE Class, BIT_VECTOR Config) { - int16_t Pid; - float TotalLength = 0; - - for (Pid = 0; Pid < Class->NumProtos; Pid++) { - if (test_bit (Config, Pid)) { - - TotalLength += (ProtoIn (Class, Pid))->Length; - } - } - return (TotalLength); -} - - -/** - * @name ClassProtoLength - * - * Return the length of all the protos in this class. - * - * @param Class The class to use - */ -float ClassProtoLength(CLASS_TYPE Class) { - int16_t Pid; - float TotalLength = 0; - - for (Pid = 0; Pid < Class->NumProtos; Pid++) { - TotalLength += (ProtoIn (Class, Pid))->Length; - } - return (TotalLength); -} - - -/** - * @name CopyProto - * - * Copy the first proto into the second. - * - * @param Src Source - * @param Dest Destination - */ -void CopyProto(PROTO Src, PROTO Dest) { - Dest->X = Src->X; - Dest->Y = Src->Y; - Dest->Length = Src->Length; - Dest->Angle = Src->Angle; - Dest->A = Src->A; - Dest->B = Src->B; - Dest->C = Src->C; -} - - /********************************************************************** * FillABC * @@ -259,21 +187,3 @@ CLASS_TYPE NewClass(int NumProtos, int NumConfigs) { return (Class); } - - -/********************************************************************** - * PrintProtos - * - * Print the list of prototypes in this class type. - **********************************************************************/ -void PrintProtos(CLASS_TYPE Class) { - int16_t Pid; - - for (Pid = 0; Pid < Class->NumProtos; Pid++) { - cprintf ("Proto %d:\t", Pid); - PrintProto (ProtoIn (Class, Pid)); - cprintf ("\t"); - PrintProtoLine (ProtoIn (Class, Pid)); - tprintf("\n"); - } -} diff --git a/src/classify/protos.h b/src/classify/protos.h index 299f617a51..532e5c4ede 100644 --- a/src/classify/protos.h +++ b/src/classify/protos.h @@ -2,13 +2,7 @@ ****************************************************************************** * * File: protos.h - * Description: * Author: Mark Seaman, SW Productivity - * Created: Fri Oct 16 14:37:00 1987 - * Modified: Fri Jul 12 10:06:55 1991 (Dan Johnson) danj@hpgrlj - * Language: C - * Package: N/A - * Status: Reusable Software Component * * (c) Copyright 1987, Hewlett-Packard Company. ** Licensed under the Apache License, Version 2.0 (the "License"); @@ -69,20 +63,6 @@ struct CLASS_STRUCT { using CLASS_TYPE = CLASS_STRUCT*; using CLASSES = CLASS_STRUCT*; -/*---------------------------------------------------------------------- - C o n s t a n t s -----------------------------------------------------------------------*/ -#define NUMBER_OF_CLASSES MAX_NUM_CLASSES -#define Y_OFFSET -40.0 -#define FEATURE_SCALE 100.0 - -/*---------------------------------------------------------------------- - V a r i a b l e s -----------------------------------------------------------------------*/ -extern CLASS_STRUCT TrainingData[]; - -extern STRING_VAR_H(classify_training_file, "MicroFeatures", "Training file"); - /*---------------------------------------------------------------------- M a c r o s ----------------------------------------------------------------------*/ @@ -94,23 +74,6 @@ extern STRING_VAR_H(classify_training_file, "MicroFeatures", "Training file"); #define AddProtoToConfig(Pid, Config) (SET_BIT(Config, Pid)) -/** - * RemoveProtoFromConfig - * - * Clear a single proto bit in the specified configuration. - */ - -#define RemoveProtoFromConfig(Pid, Config) (reset_bit(Config, Pid)) - -/** - * ClassOfChar - * - * Return the class of a particular ASCII character value. - */ - -#define ClassOfChar(Char) \ - ((TrainingData[Char].NumProtos) ? (&TrainingData[Char]) : NO_CLASS) - /** * ProtoIn * @@ -120,27 +83,6 @@ extern STRING_VAR_H(classify_training_file, "MicroFeatures", "Training file"); #define ProtoIn(Class, Pid) (&(Class)->Prototypes[Pid]) -/** - * PrintProto - * - * Print out the contents of a prototype. The 'Proto' argument is of - * type 'PROTO'. - */ - -#define PrintProto(Proto) \ - (tprintf("X=%4.2f, Y=%4.2f, Length=%4.2f, Angle=%4.2f", Proto->X, Proto->Y, \ - Proto->Length, Proto->Angle)) - -/** - * PrintProtoLine - * - * Print out the contents of a prototype. The 'Proto' argument is of - * type 'PROTO'. - */ - -#define PrintProtoLine(Proto) \ - (cprintf("A=%4.2f, B=%4.2f, C=%4.2f", Proto->A, Proto->B, Proto->C)) - /*---------------------------------------------------------------------- F u n c t i o n s ----------------------------------------------------------------------*/ @@ -148,12 +90,6 @@ int AddConfigToClass(CLASS_TYPE Class); int AddProtoToClass(CLASS_TYPE Class); -float ClassConfigLength(CLASS_TYPE Class, BIT_VECTOR Config); - -float ClassProtoLength(CLASS_TYPE Class); - -void CopyProto(PROTO Src, PROTO Dest); - void FillABC(PROTO Proto); void FreeClass(CLASS_TYPE Class); @@ -164,6 +100,4 @@ void InitPrototypes(); CLASS_TYPE NewClass(int NumProtos, int NumConfigs); -void PrintProtos(CLASS_TYPE Class); - #endif