Hi, short and sweet
Input: Scanned text pages, pure black/white pixels with rough/jagged edges
What I have done so far
file.jpg -> -depth 1 -compress none binarized.pgm -> HMT Thicken, Thinning using custom kernels -> Adaptive blur 0x0.55
What I wish for?
I will be using these images further down the stream as input to potrace, OCR and stuffs. Before that I want the text enhanced further morphologically.
What morphological changes I would love to have?
In the jagged/staircase edge, is it possible to fill the triangular part with black color so that they may look more curved than rough? Something like the bottom right character where I have painted the rough edges. How to achieve this.
Assumptions:
No background image
No colors
No skews
P.S: Am just an entry level to ImageMagick or image enhancement. Please forgive my ignorance if the answer is very obvious or simple.
Between, I LOVE IMAGEMAGICK
Smoothing scanned text jagged/rough edges using Hit-And-Miss
-
- Posts: 34
- Joined: 2010-02-25T15:22:50-07:00
- Authentication code: 8675308
Re: Smoothing scanned text jagged/rough edges using Hit-And-
Just FYI: Tesseract recognizes all lines in your sample correctly.
Re: Smoothing scanned text jagged/rough edges using Hit-And-
Hi,
My ultimate goal is to convert the source image into an enhanced, cleaner final image(The final artifact). OCR is just another assisting tool in my workflow. In other words am worried more with visually pleasantness than OCR accuracy.
Thanks
My ultimate goal is to convert the source image into an enhanced, cleaner final image(The final artifact). OCR is just another assisting tool in my workflow. In other words am worried more with visually pleasantness than OCR accuracy.
Thanks
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Smoothing scanned text jagged/rough edges using Hit-And-
That letter "d" looks as if it has been crudely enlarged from a small version. So, as a first attempt, I screen-caught the letter, shrunk it to (very approximately) the original size, and re-enlarged it using IM's more sophisticated methods.
The result is already (IMO) more pleasing than your hand-drawn version, although it has rounded off the sharp corners of the vertical. Getting the scale-down exactly right would probably be even better.
Code: Select all
convert d.png -resize 23x30! -resize 232x303! -threshold 50% dr.png
snibgo's IM pages: im.snibgo.com