Skip to content

kiko77/2021_Spring_DIP_Final_Project

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Handwriting Generator

Requirement

opencv-python 4.5.1

opencv-contrib-python 4.5.1

webcolors 1.11.1

Usage

  • Part I: divide characters into parts : ) ) )

    python3 pre_process.py [-h] [--out ./MyHandWriting] [--extension .png] in_path
    
    *********************************     hint     *******************************
    positional arguments:
    in_path               input directory
                        (containing the images of hanwritten words)
    
    optional arguments:
      -h, --help            show this help message and exit
      --out ./MyHandWriting
                        output directory
      --extension .png      extension of the input images
    
    Run "generating.py" after this part!!
    ******************************************************************************
    
    
  • Part II: generate your own handwritten script!!

    generate.py [-h] [--l LEADING] [--w WORD_SPACING] [--t TRACKING] [--head HEADER] [--foot FOOTER] [-b] [--s FONT_SIZE] [--col FONT_COLOR]
                     [--btlin_col BTLIN_COL] [--initpos WORD_START] [--endpos WORD_END]
                     text_path data_path
    
    **********************************     hint     ************************************
    positional arguments:
      text_path             input text file
      data_path             handwriting directory generate by "dividing.py"
    
    optional arguments:
      -h, --help            show this help message and exit
      --l LEADING           leading, default: 80
      --w WORD_SPACING      word-spacing, default: 30
      --t TRACKING          letter-spacing, default: 5
      --head HEADER         page header, default: 150
      --foot FOOTER         page footer, default: 150
      -b                    draw bottom line
      --s FONT_SIZE         font size, default: 12
      --col FONT_COLOR      font color, default: black
      --btlin_col BTLIN_COL
                            bottom line color, default: gray
      --initpos WORD_START  word start position, default: 30
      --endpos WORD_END     word end position, default: 30
    
    Here you go : ) ) ) )
    ************************************************************************************
    

Inputs

input image example

text.txt

I'm lazy in everything.
I don't wanna write anything.
My hands are not born for writing.
As a CSIE student.
Typing is everything.
Sorry for the bad rhyming.
Maybe you can do better than me.

Result

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%