Splitcrop with fuzzy parameter

A plethora of command-line scripts that perform geometric transforms, blurs, sharpens, edging, noise removal, and color manipulations.
Post Reply
Vilius
Posts: 3
Joined: 2016-08-02T04:13:55-07:00
Authentication code: 1151

Splitcrop with fuzzy parameter

Post by Vilius »

Hello,

I am trying to process the scanned text. What I would like to achieve is to split a page horizontally _between_ two lines of text, and then add some space around the croped part of the page. Any idea how to recognize the block of the text to avoid cutting the textlines?

https://s31.postimg.org/5cq033qhn/Lorem_ipsum_1.jpg

https://s32.postimg.org/bil1g048l/Lorem_ipsum_2.jpg

https://s31.postimg.org/e3rz0ryhn/Lorem_ipsum_3.jpg
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Splitcrop with fuzzy parameter

Post by fmw42 »

Average the image down to one column and look for white values that represent spaces between lines. For this to work, the image cannot be rotated. All lines of text must be horizontal and the space between lines must avoid letters that drop down or rise up into the spaces.
Post Reply