tesseract
4.0.0-1-g2a2b
|
#include <trainingsampleset.h>
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 |
Definition at line 43 of file trainingsampleset.h.
|
explicit |
Definition at line 70 of file trainingsampleset.cpp.
tesseract::TrainingSampleSet::~TrainingSampleSet | ( | ) |
Definition at line 75 of file trainingsampleset.cpp.
void tesseract::TrainingSampleSet::AddAllFontsForClass | ( | int | class_id, |
Shape * | shape | ||
) | const |
Definition at line 733 of file trainingsampleset.cpp.
int tesseract::TrainingSampleSet::AddSample | ( | const char * | unichar, |
TrainingSample * | sample | ||
) |
Definition at line 129 of file trainingsampleset.cpp.
void tesseract::TrainingSampleSet::AddSample | ( | int | unichar_id, |
TrainingSample * | sample | ||
) |
Definition at line 145 of file trainingsampleset.cpp.
|
inline |
Definition at line 67 of file trainingsampleset.h.
float tesseract::TrainingSampleSet::ClusterDistance | ( | int | font_id1, |
int | class_id1, | ||
int | font_id2, | ||
int | class_id2, | ||
const IntFeatureMap & | feature_map | ||
) |
Definition at line 296 of file trainingsampleset.cpp.
void tesseract::TrainingSampleSet::ComputeCanonicalFeatures | ( | ) |
Definition at line 693 of file trainingsampleset.cpp.
void tesseract::TrainingSampleSet::ComputeCanonicalSamples | ( | const IntFeatureMap & | map, |
bool | debug | ||
) |
Definition at line 568 of file trainingsampleset.cpp.
void tesseract::TrainingSampleSet::ComputeCloudFeatures | ( | int | feature_space_size | ) |
Definition at line 711 of file trainingsampleset.cpp.
float tesseract::TrainingSampleSet::ComputeClusterDistance | ( | int | font_id1, |
int | class_id1, | ||
int | font_id2, | ||
int | class_id2, | ||
const IntFeatureMap & | feature_map | ||
) | const |
Definition at line 367 of file trainingsampleset.cpp.
bool tesseract::TrainingSampleSet::DeleteableSample | ( | const TrainingSample * | sample | ) |
Definition at line 506 of file trainingsampleset.cpp.
void tesseract::TrainingSampleSet::DeleteDeadSamples | ( | ) |
Definition at line 497 of file trainingsampleset.cpp.
bool tesseract::TrainingSampleSet::DeSerialize | ( | bool | swap, |
FILE * | fp | ||
) |
Definition at line 94 of file trainingsampleset.cpp.
void tesseract::TrainingSampleSet::DisplaySamplesWithFeature | ( | int | f_index, |
const Shape & | shape, | ||
const IntFeatureSpace & | feature_space, | ||
ScrollView::Color | color, | ||
ScrollView * | window | ||
) | const |
Definition at line 742 of file trainingsampleset.cpp.
|
inline |
Definition at line 165 of file trainingsampleset.h.
|
inline |
Definition at line 70 of file trainingsampleset.h.
float tesseract::TrainingSampleSet::GetCanonicalDist | ( | int | font_id, |
int | class_id | ||
) | const |
Definition at line 474 of file trainingsampleset.cpp.
const GenericVector< int > & tesseract::TrainingSampleSet::GetCanonicalFeatures | ( | int | font_id, |
int | class_id | ||
) | const |
Definition at line 219 of file trainingsampleset.cpp.
const TrainingSample * tesseract::TrainingSampleSet::GetCanonicalSample | ( | int | font_id, |
int | class_id | ||
) | const |
Definition at line 462 of file trainingsampleset.cpp.
const BitVector & tesseract::TrainingSampleSet::GetCloudFeatures | ( | int | font_id, |
int | class_id | ||
) | const |
Definition at line 211 of file trainingsampleset.cpp.
const TrainingSample * tesseract::TrainingSampleSet::GetSample | ( | int | index | ) | const |
Definition at line 174 of file trainingsampleset.cpp.
const TrainingSample * tesseract::TrainingSampleSet::GetSample | ( | int | font_id, |
int | class_id, | ||
int | index | ||
) | const |
Definition at line 180 of file trainingsampleset.cpp.
int tesseract::TrainingSampleSet::GlobalSampleIndex | ( | int | font_id, |
int | class_id, | ||
int | index | ||
) | const |
Definition at line 452 of file trainingsampleset.cpp.
void tesseract::TrainingSampleSet::IndexFeatures | ( | const IntFeatureSpace & | feature_space | ) |
Definition at line 485 of file trainingsampleset.cpp.
void tesseract::TrainingSampleSet::KillSample | ( | TrainingSample * | sample | ) |
Definition at line 492 of file trainingsampleset.cpp.
void tesseract::TrainingSampleSet::LoadUnicharset | ( | const char * | filename | ) |
Definition at line 113 of file trainingsampleset.cpp.
|
inline |
Definition at line 161 of file trainingsampleset.h.
TrainingSample * tesseract::TrainingSampleSet::MutableSample | ( | int | font_id, |
int | class_id, | ||
int | index | ||
) |
Definition at line 191 of file trainingsampleset.cpp.
|
inline |
Definition at line 58 of file trainingsampleset.h.
|
inline |
Definition at line 55 of file trainingsampleset.h.
int tesseract::TrainingSampleSet::NumClassSamples | ( | int | font_id, |
int | class_id, | ||
bool | randomize | ||
) | const |
Definition at line 156 of file trainingsampleset.cpp.
|
inline |
Definition at line 61 of file trainingsampleset.h.
void tesseract::TrainingSampleSet::OrganizeByFontAndClass | ( | ) |
Definition at line 511 of file trainingsampleset.cpp.
int tesseract::TrainingSampleSet::ReliablySeparable | ( | int | font_id1, |
int | class_id1, | ||
int | font_id2, | ||
int | class_id2, | ||
const IntFeatureMap & | feature_map, | ||
bool | thorough | ||
) | const |
Definition at line 413 of file trainingsampleset.cpp.
void tesseract::TrainingSampleSet::ReplicateAndRandomizeSamples | ( | ) |
Definition at line 664 of file trainingsampleset.cpp.
STRING tesseract::TrainingSampleSet::SampleToString | ( | const TrainingSample & | sample | ) | const |
Definition at line 202 of file trainingsampleset.cpp.
bool tesseract::TrainingSampleSet::Serialize | ( | FILE * | fp | ) | const |
Definition at line 80 of file trainingsampleset.cpp.
void tesseract::TrainingSampleSet::SetupFontIdMap | ( | ) |
Definition at line 548 of file trainingsampleset.cpp.
float tesseract::TrainingSampleSet::UnicharDistance | ( | const UnicharAndFonts & | uf1, |
const UnicharAndFonts & | uf2, | ||
bool | matched_fonts, | ||
const IntFeatureMap & | feature_map | ||
) |
Definition at line 230 of file trainingsampleset.cpp.
|
inline |
Definition at line 64 of file trainingsampleset.h.