tesseract  4.00.00dev
text2image.cpp File Reference
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <utility>
#include <vector>
#include "allheaders.h"
#include "boxchar.h"
#include "commandlineflags.h"
#include "degradeimage.h"
#include "errcode.h"
#include "fileio.h"
#include "helpers.h"
#include "normstrngs.h"
#include "stringrenderer.h"
#include "tlog.h"
#include "unicharset.h"
#include "util.h"

Go to the source code of this file.

Classes

struct  tesseract::SpacingProperties
 

Namespaces

 tesseract
 

Functions

 STRING_PARAM_FLAG (text, "", "File name of text input to process")
 
 STRING_PARAM_FLAG (outputbase, "", "Basename for output image/box file")
 
 BOOL_PARAM_FLAG (degrade_image, true, "Degrade rendered image with speckle noise, dilation/erosion " "and rotation")
 
 BOOL_PARAM_FLAG (rotate_image, true, "Rotate the image in a random way.")
 
 INT_PARAM_FLAG (exposure, 0, "Exposure level in photocopier")
 
 INT_PARAM_FLAG (resolution, 300, "Pixels per inch")
 
 INT_PARAM_FLAG (xsize, 3600, "Width of output image")
 
 INT_PARAM_FLAG (ysize, 4800, "Height of output image")
 
 INT_PARAM_FLAG (max_pages, 0, "Maximum number of pages to output (0=unlimited)")
 
 INT_PARAM_FLAG (margin, 100, "Margin round edges of image")
 
 INT_PARAM_FLAG (ptsize, 12, "Size of printed text")
 
 DOUBLE_PARAM_FLAG (char_spacing, 0, "Inter-character space in ems")
 
 DOUBLE_PARAM_FLAG (underline_start_prob, 0, "Fraction of words to underline (value in [0,1])")
 
 DOUBLE_PARAM_FLAG (underline_continuation_prob, 0, "Fraction of words to underline (value in [0,1])")
 
 INT_PARAM_FLAG (leading, 12, "Inter-line space (in pixels)")
 
 STRING_PARAM_FLAG (writing_mode, "horizontal", "Specify one of the following writing" " modes.\ " 'horizontal' :Render regular horizontal text.(default)\" " 'vertical' :Render vertical text. Glyph orientation is" " selected by Pango.\" " 'vertical-upright' :Render vertical text. Glyph " " orientation is set to be upright.")
 
 INT_PARAM_FLAG (box_padding, 0, "Padding around produced bounding boxes")
 
 BOOL_PARAM_FLAG (strip_unrenderable_words, true, "Remove unrenderable words from source text")
 
 STRING_PARAM_FLAG (font, "Arial", "Font description name to use")
 
 BOOL_PARAM_FLAG (ligatures, false, "Rebuild and render ligatures")
 
 BOOL_PARAM_FLAG (find_fonts, false, "Search for all fonts that can render the text")
 
 BOOL_PARAM_FLAG (render_per_font, true, "If find_fonts==true, render each font to its own image. " "Image filenames are of the form output_name.font_name.tif")
 
 DOUBLE_PARAM_FLAG (min_coverage, 1.0, "If find_fonts==true, the minimum coverage the font has of " "the characters in the text file to include it, between " "0 and 1.")
 
 BOOL_PARAM_FLAG (list_available_fonts, false, "List available fonts and quit.")
 
 BOOL_PARAM_FLAG (render_ngrams, false, "Put each space-separated entity from the" " input file into one bounding box. The ngrams in the input" " file will be randomly permuted before rendering (so that" " there is sufficient variety of characters on each line).")
 
 BOOL_PARAM_FLAG (output_word_boxes, false, "Output word bounding boxes instead of character boxes. " "This is used for Cube training, and implied by " "--render_ngrams.")
 
 STRING_PARAM_FLAG (unicharset_file, "", "File with characters in the unicharset. If --render_ngrams" " is true and --unicharset_file is specified, ngrams with" " characters that are not in unicharset will be omitted")
 
 BOOL_PARAM_FLAG (bidirectional_rotation, false, "Rotate the generated characters both ways.")
 
 BOOL_PARAM_FLAG (only_extract_font_properties, false, "Assumes that the input file contains a list of ngrams. Renders" " each ngram, extracts spacing properties and records them in" " output_base/[font_name].fontinfo file.")
 
 BOOL_PARAM_FLAG (output_individual_glyph_images, false, "If true also outputs individual character images")
 
 INT_PARAM_FLAG (glyph_resized_size, 0, "Each glyph is square with this side length in pixels")
 
 INT_PARAM_FLAG (glyph_num_border_pixels_to_pad, 0, "Final_size=glyph_resized_size+2*glyph_num_border_pixels_to_pad")
 
void tesseract::ExtractFontProperties (const string &utf8_text, StringRenderer *render, const string &output_base)
 
bool tesseract::MakeIndividualGlyphs (Pix *pix, const std::vector< BoxChar *> &vbox, const int input_tiff_page)
 
int Main ()
 
int main (int argc, char **argv)
 

Variables

const int kRandomSeed = 0x18273645
 

Function Documentation

◆ BOOL_PARAM_FLAG() [1/12]

BOOL_PARAM_FLAG ( degrade_image  ,
true  ,
"Degrade rendered image with speckle  noise,
dilation/erosion " "and rotation"   
)

◆ BOOL_PARAM_FLAG() [2/12]

BOOL_PARAM_FLAG ( rotate_image  ,
true  ,
"Rotate the image in a random way."   
)

◆ BOOL_PARAM_FLAG() [3/12]

BOOL_PARAM_FLAG ( strip_unrenderable_words  ,
true  ,
"Remove unrenderable words from source text"   
)

◆ BOOL_PARAM_FLAG() [4/12]

BOOL_PARAM_FLAG ( ligatures  ,
false  ,
"Rebuild and render ligatures"   
)

◆ BOOL_PARAM_FLAG() [5/12]

BOOL_PARAM_FLAG ( find_fonts  ,
false  ,
"Search for all fonts that can render the text"   
)

◆ BOOL_PARAM_FLAG() [6/12]

BOOL_PARAM_FLAG ( render_per_font  ,
true  ,
"If  find_fonts = =true,
render each font to its own image. " "Image filenames are of the form output_name.font_name.tif"   
)

◆ BOOL_PARAM_FLAG() [7/12]

BOOL_PARAM_FLAG ( list_available_fonts  ,
false  ,
"List available fonts and quit."   
)

◆ BOOL_PARAM_FLAG() [8/12]

BOOL_PARAM_FLAG ( render_ngrams  ,
false  ,
"Put each space-separated entity from the" " input file into one bounding box. The ngrams in the input" " file will be randomly permuted before rendering (so that" " there is sufficient variety of characters on each line)."   
)

◆ BOOL_PARAM_FLAG() [9/12]

BOOL_PARAM_FLAG ( output_word_boxes  ,
false  ,
"Output word bounding boxes instead of character boxes. " "This is used for Cube  training,
and implied by " "--render_ngrams."   
)

◆ BOOL_PARAM_FLAG() [10/12]

BOOL_PARAM_FLAG ( bidirectional_rotation  ,
false  ,
"Rotate the generated characters both ways."   
)

◆ BOOL_PARAM_FLAG() [11/12]

BOOL_PARAM_FLAG ( only_extract_font_properties  ,
false  ,
"Assumes that the input file contains a list of ngrams. Renders" " each  ngram,
extracts spacing properties and records them in" " output_base/.fontinfo file."  [font_name] 
)

◆ BOOL_PARAM_FLAG() [12/12]

BOOL_PARAM_FLAG ( output_individual_glyph_images  ,
false  ,
"If true also outputs individual character images"   
)

◆ DOUBLE_PARAM_FLAG() [1/4]

DOUBLE_PARAM_FLAG ( char_spacing  ,
,
"Inter-character space in ems"   
)

◆ DOUBLE_PARAM_FLAG() [2/4]

DOUBLE_PARAM_FLAG ( underline_start_prob  ,
,
"Fraction of words to underline (value in [0,1])"   
)

◆ DOUBLE_PARAM_FLAG() [3/4]

DOUBLE_PARAM_FLAG ( underline_continuation_prob  ,
,
"Fraction of words to underline (value in [0,1])"   
)

◆ DOUBLE_PARAM_FLAG() [4/4]

DOUBLE_PARAM_FLAG ( min_coverage  ,
1.  0,
"If  find_fonts = =true,
the minimum coverage the font has of " "the characters in the text file to include  it,
between " "0 and 1."   
)

◆ INT_PARAM_FLAG() [1/11]

INT_PARAM_FLAG ( exposure  ,
,
"Exposure level in photocopier"   
)

◆ INT_PARAM_FLAG() [2/11]

INT_PARAM_FLAG ( resolution  ,
300  ,
"Pixels per inch"   
)

◆ INT_PARAM_FLAG() [3/11]

INT_PARAM_FLAG ( xsize  ,
3600  ,
"Width of output image"   
)

◆ INT_PARAM_FLAG() [4/11]

INT_PARAM_FLAG ( ysize  ,
4800  ,
"Height of output image"   
)

◆ INT_PARAM_FLAG() [5/11]

INT_PARAM_FLAG ( max_pages  ,
,
"Maximum number of pages to output (0=unlimited)"   
)

◆ INT_PARAM_FLAG() [6/11]

INT_PARAM_FLAG ( margin  ,
100  ,
"Margin round edges of image"   
)

◆ INT_PARAM_FLAG() [7/11]

INT_PARAM_FLAG ( ptsize  ,
12  ,
"Size of printed text"   
)

◆ INT_PARAM_FLAG() [8/11]

INT_PARAM_FLAG ( leading  ,
12  ,
"Inter-line space (in pixels)"   
)

◆ INT_PARAM_FLAG() [9/11]

INT_PARAM_FLAG ( box_padding  ,
,
"Padding around produced bounding boxes"   
)

◆ INT_PARAM_FLAG() [10/11]

INT_PARAM_FLAG ( glyph_resized_size  ,
,
"Each glyph is square with this side length in pixels"   
)

◆ INT_PARAM_FLAG() [11/11]

INT_PARAM_FLAG ( glyph_num_border_pixels_to_pad  ,
 
)

◆ Main()

int Main ( )

Definition at line 415 of file text2image.cpp.

415  {
416  if (FLAGS_list_available_fonts) {
417  const std::vector<string>& all_fonts = FontUtils::ListAvailableFonts();
418  for (unsigned int i = 0; i < all_fonts.size(); ++i) {
419  printf("%3u: %s\n", i, all_fonts[i].c_str());
420  ASSERT_HOST_MSG(FontUtils::IsAvailableFont(all_fonts[i].c_str()),
421  "Font %s is unrecognized.\n", all_fonts[i].c_str());
422  }
423  return EXIT_SUCCESS;
424  }
425 
426  // Check validity of input flags.
427  if (FLAGS_text.empty()) {
428  tprintf("'--text' option is missing!\n");
429  exit(1);
430  }
431  if (FLAGS_outputbase.empty()) {
432  tprintf("'--outputbase' option is missing!\n");
433  exit(1);
434  }
435  if (!FLAGS_unicharset_file.empty() && FLAGS_render_ngrams) {
436  tprintf("Use '--unicharset_file' only if '--render_ngrams' is set.\n");
437  exit(1);
438  }
439 
440  if (!FLAGS_find_fonts && !FontUtils::IsAvailableFont(FLAGS_font.c_str())) {
441  string pango_name;
442  if (!FontUtils::IsAvailableFont(FLAGS_font.c_str(), &pango_name)) {
443  tprintf("Could not find font named %s.\n", FLAGS_font.c_str());
444  if (!pango_name.empty()) {
445  tprintf("Pango suggested font %s.\n", pango_name.c_str());
446  }
447  tprintf("Please correct --font arg.\n");
448  exit(1);
449  }
450  }
451 
452  if (FLAGS_render_ngrams)
453  FLAGS_output_word_boxes = true;
454 
455  char font_desc_name[1024];
456  snprintf(font_desc_name, 1024, "%s %d", FLAGS_font.c_str(),
457  static_cast<int>(FLAGS_ptsize));
458  StringRenderer render(font_desc_name, FLAGS_xsize, FLAGS_ysize);
459  render.set_add_ligatures(FLAGS_ligatures);
460  render.set_leading(FLAGS_leading);
461  render.set_resolution(FLAGS_resolution);
462  render.set_char_spacing(FLAGS_char_spacing * FLAGS_ptsize);
463  render.set_h_margin(FLAGS_margin);
464  render.set_v_margin(FLAGS_margin);
465  render.set_output_word_boxes(FLAGS_output_word_boxes);
466  render.set_box_padding(FLAGS_box_padding);
467  render.set_strip_unrenderable_words(FLAGS_strip_unrenderable_words);
468  render.set_underline_start_prob(FLAGS_underline_start_prob);
469  render.set_underline_continuation_prob(FLAGS_underline_continuation_prob);
470 
471  // Set text rendering orientation and their forms.
472  if (FLAGS_writing_mode == "horizontal") {
473  // Render regular horizontal text (default).
474  render.set_vertical_text(false);
475  render.set_gravity_hint_strong(false);
476  render.set_render_fullwidth_latin(false);
477  } else if (FLAGS_writing_mode == "vertical") {
478  // Render vertical text. Glyph orientation is selected by Pango.
479  render.set_vertical_text(true);
480  render.set_gravity_hint_strong(false);
481  render.set_render_fullwidth_latin(false);
482  } else if (FLAGS_writing_mode == "vertical-upright") {
483  // Render vertical text. Glyph orientation is set to be upright.
484  // Also Basic Latin characters are converted to their fullwidth forms
485  // on rendering, since fullwidth Latin characters are well designed to fit
486  // vertical text lines, while .box files store halfwidth Basic Latin
487  // unichars.
488  render.set_vertical_text(true);
489  render.set_gravity_hint_strong(true);
490  render.set_render_fullwidth_latin(true);
491  } else {
492  tprintf("Invalid writing mode: %s\n", FLAGS_writing_mode.c_str());
493  exit(1);
494  }
495 
496  string src_utf8;
497  // This c_str is NOT redundant!
498  if (!File::ReadFileToString(FLAGS_text.c_str(), &src_utf8)) {
499  tprintf("Failed to read file: %s\n", FLAGS_text.c_str());
500  exit(1);
501  }
502 
503  // Remove the unicode mark if present.
504  if (strncmp(src_utf8.c_str(), "\xef\xbb\xbf", 3) == 0) {
505  src_utf8.erase(0, 3);
506  }
507  tlog(1, "Render string of size %d\n", src_utf8.length());
508 
509  if (FLAGS_render_ngrams || FLAGS_only_extract_font_properties) {
510  // Try to preserve behavior of old text2image by expanding inter-word
511  // spaces by a factor of 4.
512  const string kSeparator = FLAGS_render_ngrams ? " " : " ";
513  // Also restrict the number of characters per line to try and avoid
514  // line-breaking in the middle of words like "-A", "R$" etc. which are
515  // otherwise allowed by the standard unicode line-breaking rules.
516  const unsigned int kCharsPerLine = (FLAGS_ptsize > 20) ? 50 : 100;
517  string rand_utf8;
518  UNICHARSET unicharset;
519  if (FLAGS_render_ngrams && !FLAGS_unicharset_file.empty() &&
520  !unicharset.load_from_file(FLAGS_unicharset_file.c_str())) {
521  tprintf("Failed to load unicharset from file %s\n",
522  FLAGS_unicharset_file.c_str());
523  exit(1);
524  }
525 
526  // If we are rendering ngrams that will be OCRed later, shuffle them so that
527  // tesseract does not have difficulties finding correct baseline, word
528  // spaces, etc.
529  const char *str8 = src_utf8.c_str();
530  int len = src_utf8.length();
531  int step;
532  std::vector<std::pair<int, int> > offsets;
533  int offset = SpanUTF8Whitespace(str8);
534  while (offset < len) {
535  step = SpanUTF8NotWhitespace(str8 + offset);
536  offsets.push_back(std::make_pair(offset, step));
537  offset += step;
538  offset += SpanUTF8Whitespace(str8 + offset);
539  }
540  if (FLAGS_render_ngrams)
541  std::random_shuffle(offsets.begin(), offsets.end());
542 
543  for (size_t i = 0, line = 1; i < offsets.size(); ++i) {
544  const char *curr_pos = str8 + offsets[i].first;
545  int ngram_len = offsets[i].second;
546  // Skip words that contain characters not in found in unicharset.
547  string cleaned = UNICHARSET::CleanupString(curr_pos, ngram_len);
548  if (!FLAGS_unicharset_file.empty() &&
549  !unicharset.encodable_string(cleaned.c_str(), nullptr)) {
550  continue;
551  }
552  rand_utf8.append(curr_pos, ngram_len);
553  if (rand_utf8.length() > line * kCharsPerLine) {
554  rand_utf8.append(" \n");
555  ++line;
556  if (line & 0x1) rand_utf8.append(kSeparator);
557  } else {
558  rand_utf8.append(kSeparator);
559  }
560  }
561  tlog(1, "Rendered ngram string of size %d\n", rand_utf8.length());
562  src_utf8.swap(rand_utf8);
563  }
564  if (FLAGS_only_extract_font_properties) {
565  tprintf("Extracting font properties only\n");
566  ExtractFontProperties(src_utf8, &render, FLAGS_outputbase.c_str());
567  tprintf("Done!\n");
568  return 0;
569  }
570 
571  int im = 0;
572  std::vector<float> page_rotation;
573  const char* to_render_utf8 = src_utf8.c_str();
574 
575  tesseract::TRand randomizer;
576  randomizer.set_seed(kRandomSeed);
577  std::vector<string> font_names;
578  // We use a two pass mechanism to rotate images in both direction.
579  // The first pass(0) will rotate the images in random directions and
580  // the second pass(1) will mirror those rotations.
581  int num_pass = FLAGS_bidirectional_rotation ? 2 : 1;
582  for (int pass = 0; pass < num_pass; ++pass) {
583  int page_num = 0;
584  string font_used;
585  for (size_t offset = 0;
586  offset < strlen(to_render_utf8) &&
587  (FLAGS_max_pages == 0 || page_num < FLAGS_max_pages);
588  ++im, ++page_num) {
589  tlog(1, "Starting page %d\n", im);
590  Pix* pix = nullptr;
591  if (FLAGS_find_fonts) {
592  offset += render.RenderAllFontsToImage(FLAGS_min_coverage,
593  to_render_utf8 + offset,
594  strlen(to_render_utf8 + offset),
595  &font_used, &pix);
596  } else {
597  offset += render.RenderToImage(to_render_utf8 + offset,
598  strlen(to_render_utf8 + offset), &pix);
599  }
600  if (pix != nullptr) {
601  float rotation = 0;
602  if (pass == 1) {
603  // Pass 2, do mirror rotation.
604  rotation = -1 * page_rotation[page_num];
605  }
606  if (FLAGS_degrade_image) {
607  pix = DegradeImage(pix, FLAGS_exposure, &randomizer,
608  FLAGS_rotate_image ? &rotation : nullptr);
609  }
610  render.RotatePageBoxes(rotation);
611 
612  if (pass == 0) {
613  // Pass 1, rotate randomly and store the rotation..
614  page_rotation.push_back(rotation);
615  }
616 
617  Pix* gray_pix = pixConvertTo8(pix, false);
618  pixDestroy(&pix);
619  Pix* binary = pixThresholdToBinary(gray_pix, 128);
620  pixDestroy(&gray_pix);
621  char tiff_name[1024];
622  if (FLAGS_find_fonts) {
623  if (FLAGS_render_per_font) {
624  string fontname_for_file = tesseract::StringReplace(
625  font_used, " ", "_");
626  snprintf(tiff_name, 1024, "%s.%s.tif", FLAGS_outputbase.c_str(),
627  fontname_for_file.c_str());
628  pixWriteTiff(tiff_name, binary, IFF_TIFF_G4, "w");
629  tprintf("Rendered page %d to file %s\n", im, tiff_name);
630  } else {
631  font_names.push_back(font_used);
632  }
633  } else {
634  snprintf(tiff_name, 1024, "%s.tif", FLAGS_outputbase.c_str());
635  pixWriteTiff(tiff_name, binary, IFF_TIFF_G4, im == 0 ? "w" : "a");
636  tprintf("Rendered page %d to file %s\n", im, tiff_name);
637  }
638  // Make individual glyphs
639  if (FLAGS_output_individual_glyph_images) {
640  if (!MakeIndividualGlyphs(binary, render.GetBoxes(), im)) {
641  tprintf("ERROR: Individual glyphs not saved\n");
642  }
643  }
644  pixDestroy(&binary);
645  }
646  if (FLAGS_find_fonts && offset != 0) {
647  // We just want a list of names, or some sample images so we don't need
648  // to render more than the first page of the text.
649  break;
650  }
651  }
652  }
653  if (!FLAGS_find_fonts) {
654  string box_name = FLAGS_outputbase.c_str();
655  box_name += ".box";
656  render.WriteAllBoxes(box_name);
657  } else if (!FLAGS_render_per_font && !font_names.empty()) {
658  string filename = FLAGS_outputbase.c_str();
659  filename += ".fontlist.txt";
660  FILE* fp = fopen(filename.c_str(), "wb");
661  if (fp == nullptr) {
662  tprintf("Failed to create output font list %s\n", filename.c_str());
663  } else {
664  for (size_t i = 0; i < font_names.size(); ++i) {
665  fprintf(fp, "%s\n", font_names[i].c_str());
666  }
667  fclose(fp);
668  }
669  }
670 
671  return 0;
672 }
#define ASSERT_HOST_MSG(x,...)
Definition: errcode.h:90
unsigned int SpanUTF8NotWhitespace(const char *text)
Definition: normstrngs.cpp:243
unsigned int SpanUTF8Whitespace(const char *text)
Definition: normstrngs.cpp:233
static string CleanupString(const char *utf8_str)
Definition: unicharset.h:241
void set_seed(uinT64 seed)
Definition: helpers.h:45
void ExtractFontProperties(const string &utf8_text, StringRenderer *render, const string &output_base)
Definition: text2image.cpp:210
#define tprintf(...)
Definition: tprintf.h:31
bool encodable_string(const char *str, int *first_bad_position) const
Definition: unicharset.cpp:241
const int kRandomSeed
Definition: text2image.cpp:54
bool load_from_file(const char *const filename, bool skip_fragments)
Definition: unicharset.h:387
#define tlog(level,...)
Definition: tlog.h:33
Pix * DegradeImage(Pix *input, int exposure, TRand *randomizer, float *rotation)
bool MakeIndividualGlyphs(Pix *pix, const std::vector< BoxChar *> &vbox, const int input_tiff_page)
Definition: text2image.cpp:310

◆ main()

int main ( int  argc,
char **  argv 
)

This program reads in a text file consisting of feature samples from a training page in the following format:

   FontName UTF8-char-str xmin ymin xmax ymax page-number
    NumberOfFeatureTypes(N)
      FeatureTypeName1 NumberOfFeatures(M)
         Feature1
         ...
         FeatureM
      FeatureTypeName2 NumberOfFeatures(M)
         Feature1
         ...
         FeatureM
      ...
      FeatureTypeNameN NumberOfFeatures(M)
         Feature1
         ...
         FeatureM
   FontName CharName ...

The result of this program is a binary inttemp file used by the OCR engine.

Parameters
argcnumber of command line arguments
argvarray of command line arguments
Returns
none
Note
Exceptions: none
History: Fri Aug 18 08:56:17 1989, DSJ, Created.
History: Mon May 18 1998, Christy Russson, Revistion started.

Definition at line 674 of file text2image.cpp.

674  {
675  tesseract::ParseCommandLineFlags(argv[0], &argc, &argv, true);
676  Main();
677 }
void ParseCommandLineFlags(const char *usage, int *argc, char ***argv, const bool remove_flags)
int Main()
Definition: text2image.cpp:415

◆ STRING_PARAM_FLAG() [1/5]

STRING_PARAM_FLAG ( text  ,
""  ,
"File name of text input to process"   
)

◆ STRING_PARAM_FLAG() [2/5]

STRING_PARAM_FLAG ( outputbase  ,
""  ,
"Basename for output image/box file"   
)

◆ STRING_PARAM_FLAG() [3/5]

STRING_PARAM_FLAG ( writing_mode  ,
"horizontal"  ,
"Specify one of the following writing" " modes.\ 'horizontal' :Render regular horizontal text.(default)\ " 'vertical' :Render vertical text. Glyph orientation is" " selected by Pango.\" " 'vertical-upright' :Render vertical text. Glyph " " orientation is set to be upright."   
)

◆ STRING_PARAM_FLAG() [4/5]

STRING_PARAM_FLAG ( font  ,
"Arial"  ,
"Font description name to use"   
)

◆ STRING_PARAM_FLAG() [5/5]

STRING_PARAM_FLAG ( unicharset_file  ,
""  ,
"File with characters in the unicharset. If --render_ngrams" " is true and --unicharset_file is  specified,
ngrams with" " characters that are not in unicharset will be omitted"   
)

Variable Documentation

◆ kRandomSeed

const int kRandomSeed = 0x18273645

Definition at line 54 of file text2image.cpp.