#include "oldlist.h"
#include "tessclas.h"
Go to the source code of this file.
#define DisableCharDisplay | ( | ) | (DisplayCharacters = FALSE) |
Definition at line 34 of file blobclass.h.
#define DisableMatchDisplay | ( | ) | (DisplayMatchList = FALSE) |
Definition at line 38 of file blobclass.h.
#define EnableCharDisplay | ( | ) | (DisplayCharacters = TRUE) |
macros for controlling the display of recognized characters
Definition at line 33 of file blobclass.h.
#define EnableMatchDisplay | ( | ) | (DisplayMatchList = TRUE) |
macros for controlling the display of the entire match list
Definition at line 37 of file blobclass.h.
void InitBlobClassifierVars | ( | ) |
Install blob classifier variables into the wiseowl variable system.
none |
Definition at line 64 of file blobclass.cpp.
References dummy, FONT_NAME, FontName, and string_variable.
Referenced by mfeature_variables().
00064 { 00065 VALUE dummy; 00066 00067 string_variable (FontName, "FontName", FONT_NAME); 00068 00069 } /* InitBlobClassifierVars */
Extract micro-features from the specified blob and append them to the appropriate file.
Blob | blob whose micro-features are to be learned | |
Row | row of text that blob came from | |
BlobText | text that corresponds to blob | |
TextLength | number of characters in blob |
Definition at line 97 of file blobclass.cpp.
References chartoname(), cprintf(), Efopen(), EnterLearnMode, ExtractBlobFeatures(), FontName, FreeCharDescription(), GetLineStatsFromRow(), imagefile, MAXCHARNAME, MAXFILENAME, NULL, TRAIN_SUFFIX, and WriteCharDescription().
Referenced by tess_training_tester().
00098 { 00099 static FILE *FeatureFile = NULL; 00100 char Filename[MAXFILENAME]; 00101 char CharName[MAXCHARNAME]; 00102 CHAR_DESC CharDesc; 00103 LINE_STATS LineStats; 00104 00105 EnterLearnMode; 00106 00107 // throw out blobs which do not represent only one character 00108 if (TextLength != 1) 00109 return; 00110 00111 GetLineStatsFromRow(Row, &LineStats); 00112 00113 CharDesc = ExtractBlobFeatures (Blob, &LineStats); 00114 00115 // if a feature file is not yet open, open it 00116 // the name of the file is the name of the image plus TRAIN_SUFFIX 00117 if (FeatureFile == NULL) { 00118 strcpy(Filename, imagefile); 00119 strcat(Filename, TRAIN_SUFFIX); 00120 FeatureFile = Efopen (Filename, "w"); 00121 00122 cprintf ("TRAINING ... Font name = %s.\n", FontName); 00123 } 00124 00125 // get the name of the character for this blob 00126 chartoname (CharName, BlobText[0], ""); 00127 00128 // label the features with a class name and font name 00129 fprintf (FeatureFile, "\n%s %s ", FontName, CharName); 00130 00131 // write micro-features to file and clean up 00132 WriteCharDescription(FeatureFile, CharDesc); 00133 FreeCharDescription(CharDesc); 00134 00135 } // LearnBlob