Recently i saw a topic about line removal using leptonica.http://www.leptonica.org/line-removal.html.So i tried it in imagemagick and i made it till
Figure 9
But i cant figure out the correct command for the Final figure which fills up the mixing pixels only in the image(which is below).So please help me.
Filling the gaps made in pixels due to line removal
-
- Posts: 6
- Joined: 2017-10-22T04:06:07-07:00
- Authentication code: 1151
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Filling the gaps made in pixels due to line removal
I've written a couple of web pages on the topic, plus code -- search "filling holes" on my web page.
The example on your link uses a morphological open to join lines across the gap. My hole-filling code copies suitable areas from elsewhere in the image. The gap is only 2 or 3 pixels high, so they should work fine. Almost anything could be used, such as a vertical blur.
I've also written a page about joining broken lines, but that's mostly designed for binary images.
The example on your link uses a morphological open to join lines across the gap. My hole-filling code copies suitable areas from elsewhere in the image. The gap is only 2 or 3 pixels high, so they should work fine. Almost anything could be used, such as a vertical blur.
I've also written a page about joining broken lines, but that's mostly designed for binary images.
snibgo's IM pages: im.snibgo.com
-
- Posts: 6
- Joined: 2017-10-22T04:06:07-07:00
- Authentication code: 1151
Re: Filling the gaps made in pixels due to line removal
where to save the script file fillholespri?
magick: unable to load module `fillholespri' @ error/module.c/InvokeDynamicImageFilter/1663.
magick: unable to load module `fillholespri' @ error/module.c/InvokeDynamicImageFilter/1663.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Filling the gaps made in pixels due to line removal
This is not perfect, but try
Unix:
Windows:
Unix:
Code: Select all
convert dave-proc8.png \
\( -clone 0 -morphology convolve blur:0x5+90 -level 50x100% \) \
\( -clone 0 -threshold 99% -blur 0x1 \) \
-compose over -composite -level 30x100% \
result.png
Windows:
Code: Select all
convert dave-proc8.png ^
( -clone 0 -morphology convolve blur:0x5+90 -level 50x100% ) ^
( -clone 0 -threshold 99% -blur 0x1 ) ^
-compose over -composite -level 30x100% ^
result.png
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Filling the gaps made in pixels due to line removal
fillholespri.c isn't a script, but C code. Put it in the "filters" directory of your IM source, and re-build IM. Instructions are in Process modules.
snibgo's IM pages: im.snibgo.com