Add InkShifter
Augmentation to Shift Ink Pixels Randomly and Follow Background Shadows
#243
Labels
enhancement
New feature or request
Add jitter to ink and follow shadows or other physical deformations in paper layer
Lettering in real-world document scans aren't perfectly oriented on the page. Either the source is handwritten or just a natural artifact of being physically processed, paper stretching, wrinkling, imperfections in printing process, etc.
The sherlockdoyle/Handwriter repo offers some excellent perturbations that make the output look pretty realistic that we should consider.
Noise masks are used with the following techniques:
Random Jitter Pixel Shifting
To add variation in every letter, the text is randomly moved just tiny amount using a noise map. The code uses noise maps (one for each axis). The amount to move the text with these maps can scaled from 0 (no movement) to any specified number of pixels (either in the positive or negative direction). The scale of the noise map itself is also controlled to adjust the frequency of the noise.
Shadow-Driven Pixel Shifting
Shadows in the background can be used to further displace the image to give the effect that the text curves with the page. The code for this step is less clear, but debugging their code should reveal how the distortion mask is being created to validate any assumptions.
Main
Handwriter
Codeblockhttps://github.com/sherlockdoyle/Handwriter/blob/main/writing_artifact.py#L388-L428
The text was updated successfully, but these errors were encountered: