src/classify/tessclassifier.cpp
int TessClassifier::DisplayClassifyAs(const TrainingSample &sample, Image page_pix, int unichar_id,
                                      int index, std::vector<ScrollView *> &windows) {
  int shape_id = unichar_id;
  // TODO(rays) Fix this so it works with both flat and real shapetables.
  //  if (GetShapeTable() != nullptr)
  //  shape_id = BestShapeForUnichar(sample, page_pix, unichar_id, nullptr);
  if (shape_id < 0) {
    return index;
  }
  if (UnusedClassIdIn(classify_->PreTrainedTemplates, shape_id)) {
    tprintf("No built-in templates for class/shape %d\n", shape_id);
    return index;
  }
#ifndef GRAPHICS_DISABLED
  classify_->ShowBestMatchFor(shape_id, sample.features(), sample.num_features());
#endif
  return index;
}
// Displays classification as the given shape_id. Creates as many windows
// as it feels fit, using index as a guide for placement. Adds any created
// windows to the windows output and returns a new index that may be used
// by any subsequent classifiers. Caller waits for the user to view and
// then destroys the windows by clearing the vector.
Displays classification as the given shape_id. Creates as many windows
as it feels fit, using index as a guide for placement. Adds any created
windows to the windows output and returns a new index that may be used
by any subsequent classifiers. Caller waits for the user to view and
then destroys the windows by clearing the vector.
Displays classification as the given shape_id . Creates as many windows as it feels fit using index as a guide for placement . Adds any created windows to the windows output and returns a new index that may be used by any subsequent classifiers . Caller waits for the user to view and then destroys the windows by clearing the vector .
int TessClassifier::DisplayClassifyAs(const TrainingSample &sample, Image page_pix, int unichar_id,
                                      int index, std::vector<ScrollView *> &windows) {
  int shape_id = unichar_id;
  if (shape_id < 0) {
    return index;
  }
  if (UnusedClassIdIn(classify_->PreTrainedTemplates, shape_id)) {
    tprintf("No built-in templates for class/shape %d\n", shape_id);
    return index;
  }
#ifndef GRAPHICS_DISABLED
  classify_->ShowBestMatchFor(shape_id, sample.features(), sample.num_features());
#endif
  return index;
}
int TessClassifier :: DisplayClassifyAs ( const TrainingSample & sample , Image page_pix , int unichar_id , int index , std :: vector < ScrollView * > & windows ) { int shape_id = unichar_id ; if ( shape_id < 0 ) { return index ; } if ( UnusedClassIdIn ( classify_ -> PreTrainedTemplates , shape_id ) ) { tprintf ( " \n " , shape_id ) ; return index ; } #ifndef GRAPHICS_DISABLED classify_ -> ShowBestMatchFor ( shape_id , sample . features ( ) , sample . num_features ( ) ) ; #endif return index ; }
Displays classification as the given shape_id.
Displays classification as the given shape_id .
// TODO(rays) Fix this so it works with both flat and real shapetables. //  if (GetShapeTable() != nullptr) //  shape_id = BestShapeForUnichar(sample, page_pix, unichar_id, nullptr);