#include <trainingsampleset.h>
Classes | |
struct | FontClassDistance |
struct | FontClassInfo |
Public Member Functions | |
TrainingSampleSet (const FontInfoTable &fontinfo_table) | |
~TrainingSampleSet () | |
bool | Serialize (FILE *fp) const |
bool | DeSerialize (bool swap, FILE *fp) |
int | num_samples () const |
int | num_raw_samples () const |
int | NumFonts () const |
const UNICHARSET & | unicharset () const |
int | charsetsize () const |
const FontInfoTable & | fontinfo_table () const |
void | LoadUnicharset (const char *filename) |
int | AddSample (const char *unichar, TrainingSample *sample) |
void | AddSample (int unichar_id, TrainingSample *sample) |
int | NumClassSamples (int font_id, int class_id, bool randomize) const |
const TrainingSample * | GetSample (int index) const |
const TrainingSample * | GetSample (int font_id, int class_id, int index) const |
TrainingSample * | MutableSample (int font_id, int class_id, int index) |
STRING | SampleToString (const TrainingSample &sample) const |
const BitVector & | GetCloudFeatures (int font_id, int class_id) const |
const GenericVector< int > & | GetCanonicalFeatures (int font_id, int class_id) const |
float | UnicharDistance (const UnicharAndFonts &uf1, const UnicharAndFonts &uf2, bool matched_fonts, const IntFeatureMap &feature_map) |
float | ClusterDistance (int font_id1, int class_id1, int font_id2, int class_id2, const IntFeatureMap &feature_map) |
float | ComputeClusterDistance (int font_id1, int class_id1, int font_id2, int class_id2, const IntFeatureMap &feature_map) const |
int | ReliablySeparable (int font_id1, int class_id1, int font_id2, int class_id2, const IntFeatureMap &feature_map, bool thorough) const |
int | GlobalSampleIndex (int font_id, int class_id, int index) const |
const TrainingSample * | GetCanonicalSample (int font_id, int class_id) const |
float | GetCanonicalDist (int font_id, int class_id) const |
TrainingSample * | mutable_sample (int index) |
TrainingSample * | extract_sample (int index) |
void | IndexFeatures (const IntFeatureSpace &feature_space) |
void | KillSample (TrainingSample *sample) |
void | DeleteDeadSamples () |
bool | DeleteableSample (const TrainingSample *sample) |
void | OrganizeByFontAndClass () |
void | SetupFontIdMap () |
void | ComputeCanonicalSamples (const IntFeatureMap &map, bool debug) |
void | ReplicateAndRandomizeSamples () |
void | ComputeCanonicalFeatures () |
void | ComputeCloudFeatures (int feature_space_size) |
void | AddAllFontsForClass (int class_id, Shape *shape) const |
void | DisplaySamplesWithFeature (int f_index, const Shape &shape, const IntFeatureSpace &feature_space, ScrollView::Color color, ScrollView *window) const |
Private Attributes | |
PointerVector< TrainingSample > | samples_ |
int | num_raw_samples_ |
UNICHARSET | unicharset_ |
int | unicharset_size_ |
IndexMapBiDi | font_id_map_ |
GENERIC_2D_ARRAY< FontClassInfo > * | font_class_array_ |
const FontInfoTable & | fontinfo_table_ |
|
explicit |
tesseract::TrainingSampleSet::~TrainingSampleSet | ( | ) |
void tesseract::TrainingSampleSet::AddAllFontsForClass | ( | int | class_id, |
Shape * | shape | ||
) | const |
int tesseract::TrainingSampleSet::AddSample | ( | const char * | unichar, |
TrainingSample * | sample | ||
) |
void tesseract::TrainingSampleSet::AddSample | ( | int | unichar_id, |
TrainingSample * | sample | ||
) |
|
inline |
float tesseract::TrainingSampleSet::ClusterDistance | ( | int | font_id1, |
int | class_id1, | ||
int | font_id2, | ||
int | class_id2, | ||
const IntFeatureMap & | feature_map | ||
) |
void tesseract::TrainingSampleSet::ComputeCanonicalFeatures | ( | ) |
void tesseract::TrainingSampleSet::ComputeCanonicalSamples | ( | const IntFeatureMap & | map, |
bool | debug | ||
) |
void tesseract::TrainingSampleSet::ComputeCloudFeatures | ( | int | feature_space_size | ) |
float tesseract::TrainingSampleSet::ComputeClusterDistance | ( | int | font_id1, |
int | class_id1, | ||
int | font_id2, | ||
int | class_id2, | ||
const IntFeatureMap & | feature_map | ||
) | const |
bool tesseract::TrainingSampleSet::DeleteableSample | ( | const TrainingSample * | sample | ) |
void tesseract::TrainingSampleSet::DeleteDeadSamples | ( | ) |
bool tesseract::TrainingSampleSet::DeSerialize | ( | bool | swap, |
FILE * | fp | ||
) |
void tesseract::TrainingSampleSet::DisplaySamplesWithFeature | ( | int | f_index, |
const Shape & | shape, | ||
const IntFeatureSpace & | feature_space, | ||
ScrollView::Color | color, | ||
ScrollView * | window | ||
) | const |
|
inline |
|
inline |
float tesseract::TrainingSampleSet::GetCanonicalDist | ( | int | font_id, |
int | class_id | ||
) | const |
const GenericVector< int > & tesseract::TrainingSampleSet::GetCanonicalFeatures | ( | int | font_id, |
int | class_id | ||
) | const |
const TrainingSample * tesseract::TrainingSampleSet::GetCanonicalSample | ( | int | font_id, |
int | class_id | ||
) | const |
const BitVector & tesseract::TrainingSampleSet::GetCloudFeatures | ( | int | font_id, |
int | class_id | ||
) | const |
const TrainingSample * tesseract::TrainingSampleSet::GetSample | ( | int | index | ) | const |
const TrainingSample * tesseract::TrainingSampleSet::GetSample | ( | int | font_id, |
int | class_id, | ||
int | index | ||
) | const |
int tesseract::TrainingSampleSet::GlobalSampleIndex | ( | int | font_id, |
int | class_id, | ||
int | index | ||
) | const |
void tesseract::TrainingSampleSet::IndexFeatures | ( | const IntFeatureSpace & | feature_space | ) |
void tesseract::TrainingSampleSet::KillSample | ( | TrainingSample * | sample | ) |
void tesseract::TrainingSampleSet::LoadUnicharset | ( | const char * | filename | ) |
|
inline |
TrainingSample * tesseract::TrainingSampleSet::MutableSample | ( | int | font_id, |
int | class_id, | ||
int | index | ||
) |
|
inline |
|
inline |
int tesseract::TrainingSampleSet::NumClassSamples | ( | int | font_id, |
int | class_id, | ||
bool | randomize | ||
) | const |
|
inline |
void tesseract::TrainingSampleSet::OrganizeByFontAndClass | ( | ) |
int tesseract::TrainingSampleSet::ReliablySeparable | ( | int | font_id1, |
int | class_id1, | ||
int | font_id2, | ||
int | class_id2, | ||
const IntFeatureMap & | feature_map, | ||
bool | thorough | ||
) | const |
void tesseract::TrainingSampleSet::ReplicateAndRandomizeSamples | ( | ) |
STRING tesseract::TrainingSampleSet::SampleToString | ( | const TrainingSample & | sample | ) | const |
bool tesseract::TrainingSampleSet::Serialize | ( | FILE * | fp | ) | const |
void tesseract::TrainingSampleSet::SetupFontIdMap | ( | ) |
float tesseract::TrainingSampleSet::UnicharDistance | ( | const UnicharAndFonts & | uf1, |
const UnicharAndFonts & | uf2, | ||
bool | matched_fonts, | ||
const IntFeatureMap & | feature_map | ||
) |
|
inline |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |