Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
imagemorph
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FLAGS = -pedantic -Wunused -Wunused-function -Wunused-parameter -Wunused-variable -Wall
# -pg
imagemorph: imagemorph.o Makefile
gcc $(FLAGS) imagemorph.o -static -static-libgcc -lm -o imagemorph
gcc $(FLAGS) imagemorph.c -lm -o imagemorph

clean:
\rm imagemorph imagemorph.o
Expand Down
51 changes: 45 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,49 @@
# imagemorph.c
Program to apply random elastic rubbersheet transforms to Netpbm color (.ppm) images for augmenting training sets in machine learning/deep learning. The program reads an input .ppm image from stdin and writes a ppm image to stdout. Original Author: Marius Bulacu (.pgm version for characters). Adapted for .ppm and color: Lambert Schomaker

Program to apply random elastic 'rubbersheet' transforms to Netpbm images (.ppm P6 raw binary and .pgm P5 raw binary) images for augmenting training sets in machine learning.

The program reads an input image from stdin and writes a ppm or pgm image to stdout.

Original Author: Marius Bulacu (.pgm version for characters)

Adapted for .ppm and color: Lambert Schomaker

Adapted for .ppm and .pgm: Nick Ubels

Please cite:

M Bulacu, A Brink, T van der Zant, L Schomaker (2009).
Recognition of handwritten numerical fields in a
large single-writer historical collection,
10th International Conference on Document Analysis and Recognition,
pp. 808-812, DOI: 10.1109/ICDAR.2009.8
> M Bulacu, A Brink, T van der Zant, L Schomaker (2009).
> Recognition of handwritten numerical fields in a
> large single-writer historical collection,
> 10th International Conference on Document Analysis and Recognition,
> pp. 808-812, DOI: 10.1109/ICDAR.2009.8

## Usage:

First compile with `make imagemorph`.

For .ppm (P6 raw binary) images:

`imagemorph [displacement] [smoothing radius] < input.ppm > random-morph.ppm`

For .pgm (P5 raw binary) images:

`imagemorph [displacement] [smoothing radius] < input.pgm > random-morph.pgm`

Parameters are real values

### Example
Input:

![input](sample-input.png)

Output:

![output](sample-output.png)

PS Please note that for an even more realistic augmentation
of handwriting training data, also random slant (shear) and
ink thickness, using mathematical morphology are needed
as additional deformations.

Lambert Schomaker
37 changes: 0 additions & 37 deletions README.txt

This file was deleted.

Binary file removed imagemorph
Binary file not shown.
Loading