mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-27 20:59:36 +08:00
doxygenify
This commit is contained in:
parent
524666d9fa
commit
2a36a3edec
@ -15,7 +15,7 @@
|
|||||||
** See the License for the specific language governing permissions and
|
** See the License for the specific language governing permissions and
|
||||||
** limitations under the License.
|
** limitations under the License.
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
/**----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
Include Files and Type Defines
|
Include Files and Type Defines
|
||||||
----------------------------------------------------------------------------**/
|
----------------------------------------------------------------------------**/
|
||||||
#include "normmatch.h"
|
#include "normmatch.h"
|
||||||
@ -43,7 +43,7 @@ struct NORM_PROTOS
|
|||||||
int NumProtos;
|
int NumProtos;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
Private Function Prototypes
|
Private Function Prototypes
|
||||||
----------------------------------------------------------------------------**/
|
----------------------------------------------------------------------------**/
|
||||||
double NormEvidenceOf(register double NormAdj);
|
double NormEvidenceOf(register double NormAdj);
|
||||||
@ -55,7 +55,7 @@ void PrintNormMatch(FILE *File,
|
|||||||
|
|
||||||
NORM_PROTOS *ReadNormProtos(FILE *File);
|
NORM_PROTOS *ReadNormProtos(FILE *File);
|
||||||
|
|
||||||
/**----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
Variables
|
Variables
|
||||||
----------------------------------------------------------------------------**/
|
----------------------------------------------------------------------------**/
|
||||||
|
|
||||||
@ -65,28 +65,29 @@ double_VAR(classify_norm_adj_curl, 2.0, "Norm adjust curl ...");
|
|||||||
// Weight of width variance against height and vertical position.
|
// Weight of width variance against height and vertical position.
|
||||||
const double kWidthErrorWeighting = 0.125;
|
const double kWidthErrorWeighting = 0.125;
|
||||||
|
|
||||||
/**----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
Public Code
|
Public Code
|
||||||
----------------------------------------------------------------------------**/
|
----------------------------------------------------------------------------**/
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
namespace tesseract {
|
namespace tesseract {
|
||||||
|
/**
|
||||||
|
* This routine compares Features against each character
|
||||||
|
* normalization proto for ClassId and returns the match
|
||||||
|
* rating of the best match.
|
||||||
|
* @param ClassId id of class to match against
|
||||||
|
* @param Feature character normalization feature
|
||||||
|
* @param DebugMatch controls dump of debug info
|
||||||
|
*
|
||||||
|
* Globals:
|
||||||
|
* NormProtos character normalization prototypes
|
||||||
|
*
|
||||||
|
* @return Best match rating for Feature against protos of ClassId.
|
||||||
|
* @note Exceptions: none
|
||||||
|
* @note History: Wed Dec 19 16:56:12 1990, DSJ, Created.
|
||||||
|
*/
|
||||||
FLOAT32 Classify::ComputeNormMatch(CLASS_ID ClassId,
|
FLOAT32 Classify::ComputeNormMatch(CLASS_ID ClassId,
|
||||||
const FEATURE_STRUCT& feature,
|
const FEATURE_STRUCT& feature,
|
||||||
BOOL8 DebugMatch) {
|
BOOL8 DebugMatch) {
|
||||||
/*
|
|
||||||
** Parameters:
|
|
||||||
** ClassId id of class to match against
|
|
||||||
** Feature character normalization feature
|
|
||||||
** DebugMatch controls dump of debug info
|
|
||||||
** Globals:
|
|
||||||
** NormProtos character normalization prototypes
|
|
||||||
** Operation: This routine compares Features against each character
|
|
||||||
** normalization proto for ClassId and returns the match
|
|
||||||
** rating of the best match.
|
|
||||||
** Return: Best match rating for Feature against protos of ClassId.
|
|
||||||
** Exceptions: none
|
|
||||||
** History: Wed Dec 19 16:56:12 1990, DSJ, Created.
|
|
||||||
*/
|
|
||||||
LIST Protos;
|
LIST Protos;
|
||||||
FLOAT32 BestMatch;
|
FLOAT32 BestMatch;
|
||||||
FLOAT32 Match;
|
FLOAT32 Match;
|
||||||
@ -170,16 +171,16 @@ void Classify::FreeNormProtos() {
|
|||||||
}
|
}
|
||||||
} // namespace tesseract
|
} // namespace tesseract
|
||||||
|
|
||||||
/**----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
Private Code
|
Private Code
|
||||||
----------------------------------------------------------------------------**/
|
----------------------------------------------------------------------------**/
|
||||||
/**********************************************************************
|
/**
|
||||||
* NormEvidenceOf
|
* @name NormEvidenceOf
|
||||||
*
|
*
|
||||||
* Return the new type of evidence number corresponding to this
|
* Return the new type of evidence number corresponding to this
|
||||||
* normalization adjustment. The equation that represents the transform is:
|
* normalization adjustment. The equation that represents the transform is:
|
||||||
* 1 / (1 + (NormAdj / midpoint) ^ curl)
|
* 1 / (1 + (NormAdj / midpoint) ^ curl)
|
||||||
**********************************************************************/
|
*/
|
||||||
double NormEvidenceOf(register double NormAdj) {
|
double NormEvidenceOf(register double NormAdj) {
|
||||||
NormAdj /= classify_norm_adj_midpoint;
|
NormAdj /= classify_norm_adj_midpoint;
|
||||||
|
|
||||||
@ -194,22 +195,21 @@ double NormEvidenceOf(register double NormAdj) {
|
|||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/**
|
||||||
|
* This routine dumps out detailed normalization match info.
|
||||||
|
* @param File open text file to dump match debug info to
|
||||||
|
* @param NumParams # of parameters in proto and feature
|
||||||
|
* @param Proto[] array of prototype parameters
|
||||||
|
* @param Feature[] array of feature parameters
|
||||||
|
* Globals: none
|
||||||
|
* @return none
|
||||||
|
* @note Exceptions: none
|
||||||
|
* @note History: Wed Jan 2 09:49:35 1991, DSJ, Created.
|
||||||
|
*/
|
||||||
void PrintNormMatch(FILE *File,
|
void PrintNormMatch(FILE *File,
|
||||||
int NumParams,
|
int NumParams,
|
||||||
PROTOTYPE *Proto,
|
PROTOTYPE *Proto,
|
||||||
FEATURE Feature) {
|
FEATURE Feature) {
|
||||||
/*
|
|
||||||
** Parameters:
|
|
||||||
** File open text file to dump match debug info to
|
|
||||||
** NumParams # of parameters in proto and feature
|
|
||||||
** Proto[] array of prototype parameters
|
|
||||||
** Feature[] array of feature parameters
|
|
||||||
** Globals: none
|
|
||||||
** Operation: This routine dumps out detailed normalization match info.
|
|
||||||
** Return: none
|
|
||||||
** Exceptions: none
|
|
||||||
** History: Wed Jan 2 09:49:35 1991, DSJ, Created.
|
|
||||||
*/
|
|
||||||
int i;
|
int i;
|
||||||
FLOAT32 ParamMatch;
|
FLOAT32 ParamMatch;
|
||||||
FLOAT32 TotalMatch;
|
FLOAT32 TotalMatch;
|
||||||
@ -231,18 +231,17 @@ void PrintNormMatch(FILE *File,
|
|||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
namespace tesseract {
|
namespace tesseract {
|
||||||
NORM_PROTOS *Classify::ReadNormProtos(FILE *File, inT64 end_offset) {
|
/**
|
||||||
/*
|
* This routine allocates a new data structure to hold
|
||||||
** Parameters:
|
* a set of character normalization protos. It then fills in
|
||||||
** File open text file to read normalization protos from
|
* the data structure by reading from the specified File.
|
||||||
** Globals: none
|
* @param File open text file to read normalization protos from
|
||||||
** Operation: This routine allocates a new data structure to hold
|
* Globals: none
|
||||||
** a set of character normalization protos. It then fills in
|
* @return Character normalization protos.
|
||||||
** the data structure by reading from the specified File.
|
* @note Exceptions: none
|
||||||
** Return: Character normalization protos.
|
* @note History: Wed Dec 19 16:38:49 1990, DSJ, Created.
|
||||||
** Exceptions: none
|
|
||||||
** History: Wed Dec 19 16:38:49 1990, DSJ, Created.
|
|
||||||
*/
|
*/
|
||||||
|
NORM_PROTOS *Classify::ReadNormProtos(FILE *File, inT64 end_offset) {
|
||||||
NORM_PROTOS *NormProtos;
|
NORM_PROTOS *NormProtos;
|
||||||
int i;
|
int i;
|
||||||
char unichar[2 * UNICHAR_LEN + 1];
|
char unichar[2 * UNICHAR_LEN + 1];
|
||||||
|
Loading…
Reference in New Issue
Block a user