tesseract  v4.0.0-17-g361f3264
Open Source OCR Engine
tesseract::TrainingSample Class Reference

#include <trainingsample.h>

Inheritance diagram for tesseract::TrainingSample:
Collaboration diagram for tesseract::TrainingSample:

Public Member Functions

 TrainingSample ()
 
 ~TrainingSample ()
 
FEATURE_STRUCTGetCNFeature () const
 
TrainingSampleRandomizedCopy (int index) const
 
TrainingSampleCopy () const
 
bool Serialize (FILE *fp) const
 
bool DeSerialize (bool swap, FILE *fp)
 
void ExtractCharDesc (int feature_type, int micro_type, int cn_type, int geo_type, CHAR_DESC_STRUCT *char_desc)
 
void IndexFeatures (const IntFeatureSpace &feature_space)
 
void MapFeatures (const IntFeatureMap &feature_map)
 
Pix * RenderToPix (const UNICHARSET *unicharset) const
 
void DisplayFeatures (ScrollView::Color color, ScrollView *window) const
 
Pix * GetSamplePix (int padding, Pix *page_pix) const
 
UNICHAR_ID class_id () const
 
void set_class_id (int id)
 
int font_id () const
 
void set_font_id (int id)
 
int page_num () const
 
void set_page_num (int page)
 
const TBOXbounding_box () const
 
void set_bounding_box (const TBOX &box)
 
uint32_t num_features () const
 
const INT_FEATURE_STRUCTfeatures () const
 
uint32_t num_micro_features () const
 
const MicroFeature * micro_features () const
 
int outline_length () const
 
float cn_feature (int index) const
 
int geo_feature (int index) const
 
double weight () const
 
void set_weight (double value)
 
double max_dist () const
 
void set_max_dist (double value)
 
int sample_index () const
 
void set_sample_index (int value)
 
bool features_are_mapped () const
 
const GenericVector< int > & mapped_features () const
 
const GenericVector< int > & indexed_features () const
 
bool is_error () const
 
void set_is_error (bool value)
 

Static Public Member Functions

static TrainingSampleCopyFromFeatures (const INT_FX_RESULT_STRUCT &fx_info, const TBOX &bounding_box, const INT_FEATURE_STRUCT *features, int num_features)
 
static TrainingSampleDeSerializeCreate (bool swap, FILE *fp)
 

Private Attributes

UNICHAR_ID class_id_
 
int font_id_
 
int page_num_
 
TBOX bounding_box_
 
uint32_t num_features_
 
uint32_t num_micro_features_
 
int outline_length_
 
INT_FEATURE_STRUCTfeatures_
 
MicroFeature * micro_features_
 
float cn_feature_ [kNumCNParams]
 
int geo_feature_ [GeoCount]
 
double weight_
 
double max_dist_
 
int sample_index_
 
GenericVector< int > mapped_features_
 
bool features_are_indexed_
 
bool features_are_mapped_
 
bool is_error_
 

Static Private Attributes

static const int kYShiftValues [kSampleYShiftSize]
 
static const double kScaleValues [kSampleScaleSize]
 

Constructor & Destructor Documentation

◆ TrainingSample()

tesseract::TrainingSample::TrainingSample ( )
inline

◆ ~TrainingSample()

tesseract::TrainingSample::~TrainingSample ( )

Member Function Documentation

◆ bounding_box()

const TBOX& tesseract::TrainingSample::bounding_box ( ) const
inline

◆ class_id()

UNICHAR_ID tesseract::TrainingSample::class_id ( ) const
inline

◆ cn_feature()

float tesseract::TrainingSample::cn_feature ( int  index) const
inline

◆ Copy()

TrainingSample * tesseract::TrainingSample::Copy ( ) const

◆ CopyFromFeatures()

TrainingSample * tesseract::TrainingSample::CopyFromFeatures ( const INT_FX_RESULT_STRUCT fx_info,
const TBOX bounding_box,
const INT_FEATURE_STRUCT features,
int  num_features 
)
static

◆ DeSerialize()

bool tesseract::TrainingSample::DeSerialize ( bool  swap,
FILE *  fp 
)

◆ DeSerializeCreate()

TrainingSample * tesseract::TrainingSample::DeSerializeCreate ( bool  swap,
FILE *  fp 
)
static

◆ DisplayFeatures()

void tesseract::TrainingSample::DisplayFeatures ( ScrollView::Color  color,
ScrollView window 
) const

◆ ExtractCharDesc()

void tesseract::TrainingSample::ExtractCharDesc ( int  feature_type,
int  micro_type,
int  cn_type,
int  geo_type,
CHAR_DESC_STRUCT char_desc 
)

◆ features()

const INT_FEATURE_STRUCT* tesseract::TrainingSample::features ( ) const
inline

◆ features_are_mapped()

bool tesseract::TrainingSample::features_are_mapped ( ) const
inline

◆ font_id()

int tesseract::TrainingSample::font_id ( ) const
inline

◆ geo_feature()

int tesseract::TrainingSample::geo_feature ( int  index) const
inline

◆ GetCNFeature()

FEATURE_STRUCT * tesseract::TrainingSample::GetCNFeature ( ) const

◆ GetSamplePix()

Pix * tesseract::TrainingSample::GetSamplePix ( int  padding,
Pix *  page_pix 
) const

◆ indexed_features()

const GenericVector<int>& tesseract::TrainingSample::indexed_features ( ) const
inline

◆ IndexFeatures()

void tesseract::TrainingSample::IndexFeatures ( const IntFeatureSpace feature_space)

◆ is_error()

bool tesseract::TrainingSample::is_error ( ) const
inline

◆ MapFeatures()

void tesseract::TrainingSample::MapFeatures ( const IntFeatureMap feature_map)

◆ mapped_features()

const GenericVector<int>& tesseract::TrainingSample::mapped_features ( ) const
inline

◆ max_dist()

double tesseract::TrainingSample::max_dist ( ) const
inline

◆ micro_features()

const MicroFeature* tesseract::TrainingSample::micro_features ( ) const
inline

◆ num_features()

uint32_t tesseract::TrainingSample::num_features ( ) const
inline

◆ num_micro_features()

uint32_t tesseract::TrainingSample::num_micro_features ( ) const
inline

◆ outline_length()

int tesseract::TrainingSample::outline_length ( ) const
inline

◆ page_num()

int tesseract::TrainingSample::page_num ( ) const
inline

◆ RandomizedCopy()

TrainingSample * tesseract::TrainingSample::RandomizedCopy ( int  index) const

◆ RenderToPix()

Pix * tesseract::TrainingSample::RenderToPix ( const UNICHARSET unicharset) const

◆ sample_index()

int tesseract::TrainingSample::sample_index ( ) const
inline

◆ Serialize()

bool tesseract::TrainingSample::Serialize ( FILE *  fp) const

◆ set_bounding_box()

void tesseract::TrainingSample::set_bounding_box ( const TBOX box)
inline

◆ set_class_id()

void tesseract::TrainingSample::set_class_id ( int  id)
inline

◆ set_font_id()

void tesseract::TrainingSample::set_font_id ( int  id)
inline

◆ set_is_error()

void tesseract::TrainingSample::set_is_error ( bool  value)
inline

◆ set_max_dist()

void tesseract::TrainingSample::set_max_dist ( double  value)
inline

◆ set_page_num()

void tesseract::TrainingSample::set_page_num ( int  page)
inline

◆ set_sample_index()

void tesseract::TrainingSample::set_sample_index ( int  value)
inline

◆ set_weight()

void tesseract::TrainingSample::set_weight ( double  value)
inline

◆ weight()

double tesseract::TrainingSample::weight ( ) const
inline

Member Data Documentation

◆ bounding_box_

TBOX tesseract::TrainingSample::bounding_box_
private

◆ class_id_

UNICHAR_ID tesseract::TrainingSample::class_id_
private

◆ cn_feature_

float tesseract::TrainingSample::cn_feature_[kNumCNParams]
private

◆ features_

INT_FEATURE_STRUCT* tesseract::TrainingSample::features_
private

◆ features_are_indexed_

bool tesseract::TrainingSample::features_are_indexed_
private

◆ features_are_mapped_

bool tesseract::TrainingSample::features_are_mapped_
private

◆ font_id_

int tesseract::TrainingSample::font_id_
private

◆ geo_feature_

int tesseract::TrainingSample::geo_feature_[GeoCount]
private

◆ is_error_

bool tesseract::TrainingSample::is_error_
private

◆ kScaleValues

const double tesseract::TrainingSample::kScaleValues
staticprivate
Initial value:
= {
1.0625, 0.9375, 1.0
}

◆ kYShiftValues

const int tesseract::TrainingSample::kYShiftValues
staticprivate
Initial value:
= {
6, 3, -3, -6, 0
}

◆ mapped_features_

GenericVector<int> tesseract::TrainingSample::mapped_features_
private

◆ max_dist_

double tesseract::TrainingSample::max_dist_
private

◆ micro_features_

MicroFeature* tesseract::TrainingSample::micro_features_
private

◆ num_features_

uint32_t tesseract::TrainingSample::num_features_
private

◆ num_micro_features_

uint32_t tesseract::TrainingSample::num_micro_features_
private

◆ outline_length_

int tesseract::TrainingSample::outline_length_
private

◆ page_num_

int tesseract::TrainingSample::page_num_
private

◆ sample_index_

int tesseract::TrainingSample::sample_index_
private

◆ weight_

double tesseract::TrainingSample::weight_
private

The documentation for this class was generated from the following files: