Setting font size of generated training data

42 views
Skip to first unread message

anonynamja

unread,
Sep 30, 2018, 3:43:02 PM9/30/18
to tesseract-ocr
I wish to produce training images of text from a specific font with a font size (40 pts) specific to my target domain. So far, training on the standard 12 point size produced poor results for differentiating complex kanji characters.

I have identified the relevant line of code in text2image.cpp, lines 89-90:

// Size of text (in points).

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

Should I directly change the value to 40 here in text2image.cpp or in tesstrain_utils.sh lines 229-233:


local common_args="--fontconfig_tmpdir=${FONT_CONFIG_CACHE}"

    common_args+=" --fonts_dir=${FONTS_DIR} --strip_unrenderable_words"

    common_args+=" --leading=${LEADING}"

    common_args+=" --char_spacing=${CHAR_SPACING} --exposure=${EXPOSURE}"

    common_args+=" --outputbase=${outbase} --max_pages=${MAX_PAGES}"

such as adding a --ptsize 40 argument after --leading? 

anonynamja

unread,
Oct 5, 2018, 12:07:46 PM10/5/18
to tesseract-ocr
If anyone else wants to do this, adding the --ptsize argument in tesstrain_utils.sh did the trick.
Reply all
Reply to author
Forward
0 new messages