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

#include <ctc.h>

Collaboration diagram for tesseract::CTC:

Static Public Member Functions

static void NormalizeProbs (NetworkIO *probs)
 
static bool ComputeCTCTargets (const GenericVector< int > &truth_labels, int null_char, const GENERIC_2D_ARRAY< float > &outputs, NetworkIO *targets)
 

Private Member Functions

 CTC (const GenericVector< int > &labels, int null_char, const GENERIC_2D_ARRAY< float > &outputs)
 
bool ComputeLabelLimits ()
 
void ComputeSimpleTargets (GENERIC_2D_ARRAY< float > *targets) const
 
void ComputeWidthsAndMeans (GenericVector< float > *half_widths, GenericVector< int > *means) const
 
float CalculateBiasFraction ()
 
void Forward (GENERIC_2D_ARRAY< double > *log_probs) const
 
void Backward (GENERIC_2D_ARRAY< double > *log_probs) const
 
void NormalizeSequence (GENERIC_2D_ARRAY< double > *probs) const
 
void LabelsToClasses (const GENERIC_2D_ARRAY< double > &probs, NetworkIO *targets) const
 
bool NeededNull (int index) const
 

Static Private Member Functions

static void NormalizeProbs (GENERIC_2D_ARRAY< float > *probs)
 
static double ClippedExp (double x)
 

Private Attributes

const GenericVector< int > & labels_
 
GENERIC_2D_ARRAY< float > outputs_
 
int null_char_
 
int num_timesteps_
 
int num_classes_
 
int num_labels_
 
GenericVector< int > min_labels_
 
GenericVector< int > max_labels_
 

Static Private Attributes

static const float kMinProb_ = 1e-12
 
static const double kMaxExpArg_ = 80.0
 
static const double kMinTotalTimeProb_ = 1e-8
 
static const double kMinTotalFinalProb_ = 1e-6
 

Constructor & Destructor Documentation

◆ CTC()

tesseract::CTC::CTC ( const GenericVector< int > &  labels,
int  null_char,
const GENERIC_2D_ARRAY< float > &  outputs 
)
private

Member Function Documentation

◆ Backward()

void tesseract::CTC::Backward ( GENERIC_2D_ARRAY< double > *  log_probs) const
private

◆ CalculateBiasFraction()

float tesseract::CTC::CalculateBiasFraction ( )
private

◆ ClippedExp()

static double tesseract::CTC::ClippedExp ( double  x)
inlinestaticprivate

◆ ComputeCTCTargets()

bool tesseract::CTC::ComputeCTCTargets ( const GenericVector< int > &  truth_labels,
int  null_char,
const GENERIC_2D_ARRAY< float > &  outputs,
NetworkIO targets 
)
static

◆ ComputeLabelLimits()

bool tesseract::CTC::ComputeLabelLimits ( )
private

◆ ComputeSimpleTargets()

void tesseract::CTC::ComputeSimpleTargets ( GENERIC_2D_ARRAY< float > *  targets) const
private

◆ ComputeWidthsAndMeans()

void tesseract::CTC::ComputeWidthsAndMeans ( GenericVector< float > *  half_widths,
GenericVector< int > *  means 
) const
private

◆ Forward()

void tesseract::CTC::Forward ( GENERIC_2D_ARRAY< double > *  log_probs) const
private

◆ LabelsToClasses()

void tesseract::CTC::LabelsToClasses ( const GENERIC_2D_ARRAY< double > &  probs,
NetworkIO targets 
) const
private

◆ NeededNull()

bool tesseract::CTC::NeededNull ( int  index) const
private

◆ NormalizeProbs() [1/2]

static void tesseract::CTC::NormalizeProbs ( NetworkIO probs)
inlinestatic

◆ NormalizeProbs() [2/2]

void tesseract::CTC::NormalizeProbs ( GENERIC_2D_ARRAY< float > *  probs)
staticprivate

◆ NormalizeSequence()

void tesseract::CTC::NormalizeSequence ( GENERIC_2D_ARRAY< double > *  probs) const
private

Member Data Documentation

◆ kMaxExpArg_

const double tesseract::CTC::kMaxExpArg_ = 80.0
staticprivate

◆ kMinProb_

const float tesseract::CTC::kMinProb_ = 1e-12
staticprivate

◆ kMinTotalFinalProb_

const double tesseract::CTC::kMinTotalFinalProb_ = 1e-6
staticprivate

◆ kMinTotalTimeProb_

const double tesseract::CTC::kMinTotalTimeProb_ = 1e-8
staticprivate

◆ labels_

const GenericVector<int>& tesseract::CTC::labels_
private

◆ max_labels_

GenericVector<int> tesseract::CTC::max_labels_
private

◆ min_labels_

GenericVector<int> tesseract::CTC::min_labels_
private

◆ null_char_

int tesseract::CTC::null_char_
private

◆ num_classes_

int tesseract::CTC::num_classes_
private

◆ num_labels_

int tesseract::CTC::num_labels_
private

◆ num_timesteps_

int tesseract::CTC::num_timesteps_
private

◆ outputs_

GENERIC_2D_ARRAY<float> tesseract::CTC::outputs_
private

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