Page 1 of 1

Remove difficult noise from scan

Posted: 2017-09-12T07:05:01-07:00
by brighthero
I've scanned a page of notebook paper and my scanner always introduces this weird noise.
I want to keep the lines and also the notes themselves.
Any ideas?

Example: https://i.imgur.com/4dl23SS.jpg

Re: Remove difficult noise from scan

Posted: 2017-09-12T09:06:38-07:00
by fmw42
brighthero wrote: 2017-09-12T07:05:01-07:00 I've scanned a page of notebook paper and my scanner always introduces this weird noise.
I want to keep the lines and also the notes themselves.
Any ideas?

Example: https://i.imgur.com/4dl23SS.jpg

Please always provide your IM version and platform/OS, since syntax and scripting differs.

If on Unix-like system, you can use my script text cleaner to improve your document.

Code: Select all

textcleaner -f 25 -o 10 4dl23SS.jpg 4dl23SS_clean25x10.jpg
Image

Otherwise, try

Code: Select all

convert 4dl23SS.jpg -negate -lat 25x25+10% -negate 4dl23SS_lat25x10.jpg
That will lose color, but you can use it as a mask to clean up your image.

Re: Remove difficult noise from scan

Posted: 2017-09-12T09:35:01-07:00
by brighthero
Thanks man, I really like your website and have used your scripts before.
The only problem I have with your script is that the filter removes big dark shapes, like logos and so on (see the punch holes in the page). Is there any way to prevent this?

Re: Remove difficult noise from scan

Posted: 2017-09-12T10:28:01-07:00
by fmw42
Increase the -f argument until it does not remove the holes. The argument will depend upon how large a region you want to preserve. But it will take longer. At -f 75 it leaves the holes. But at -f 50 they are only about half filled. So somewhere in between they get filled.

Re: Remove difficult noise from scan

Posted: 2017-09-12T10:56:29-07:00
by Tillomar
Did you try to put a black background behind your notepad page (during scanning)? Depending on the paper, that might help a lot.

Re: Remove difficult noise from scan

Posted: 2017-09-14T01:18:31-07:00
by ozbigben
fmw42 wrote: 2017-09-12T09:06:38-07:00

Code: Select all

convert 4dl23SS.jpg -negate -lat 25x25+10% -negate 4dl23SS_lat25x10.jpg
you can shorten this to

Code: Select all

convert 4dl23SS.jpg -lat 25x25-10% 4dl23SS_lat25x10.jpg
Tillomar wrote: 2017-09-12T10:56:29-07:00 Did you try to put a black background behind your notepad page (during scanning)? Depending on the paper, that might help a lot.
Black paper reduces bleed through of writing on the back but darkens the image with thin paper which is the problem here. If there is no writing then white paper produces a cleaner scan of thin paper.

As a quick clean up (for those on Win) you can then use composite to add the cleaned image to the original, using the cleaned image as a mask.