Removing Pattern from Scanned Image

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Removing Pattern from Scanned Image

i_am_jim
I've gotten so many messages from the Listserve people I don't know if
this message got through or not.  If so, delete it and reply to my
earlier one(s).

I am a complete novice at this but I found imagej on the web and it
appeared it would do what I need.  I have scanned images from a book
printed in the 60's.  They were poor quality in the book.  I am trying
to remove the pattern used to print them.  Below is a sample from the
image and the FFT pattern painted as I understood it was to be done.

First: is this what I should do?

Second:  I cannot figure out how to apply the painted FFT pattern to the
image.  If it is supposed to be happening as I paint, it isn't.

*
pattern from a light area
*


**


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

kaeglibnokchijbe.png (35K) Download Attachment
cfndhodfbjhdigbh.png (650K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Removing Pattern from Scanned Image

Cardone, Giovanni
Hi jim,

showing the original image would help to understand if you are doing things correctly. In any case you don't "apply the painted FFT pattern to the image", rather you calculate the inverse FFT (menu Process/FFT/Inverse FFT) of the painted FFT. Therefore it is a trial and error procedure, unless you know exactly what you are doing.

Giovanni


-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of jim
Sent: Montag, 24. September 2018 22:20
To: [hidden email]
Subject: Removing Pattern from Scanned Image

I've gotten so many messages from the Listserve people I don't know if this message got through or not.  If so, delete it and reply to my earlier one(s).

I am a complete novice at this but I found imagej on the web and it appeared it would do what I need.  I have scanned images from a book printed in the 60's.  They were poor quality in the book.  I am trying to remove the pattern used to print them.  Below is a sample from the image and the FFT pattern painted as I understood it was to be done.

First: is this what I should do?

Second:  I cannot figure out how to apply the painted FFT pattern to the image.  If it is supposed to be happening as I paint, it isn't.

*
pattern from a light area
*


**


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Removing Pattern from Scanned Image

Burger Wilhelm
In reply to this post by i_am_jim
Hi Jim,

perhaps you may find this paper by one of my former students useful:
http://staff.fh-hagenberg.at/burger/publications/pdf/elmar2009.pdf
The implementation was done with ImageJ.

--Wilhelm


-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of jim
Sent: Montag, 24. September 2018 22:20
To: [hidden email]
Subject: Removing Pattern from Scanned Image

I've gotten so many messages from the Listserve people I don't know if this message got through or not.  If so, delete it and reply to my earlier one(s).

I am a complete novice at this but I found imagej on the web and it appeared it would do what I need.  I have scanned images from a book printed in the 60's.  They were poor quality in the book.  I am trying to remove the pattern used to print them.  Below is a sample from the image and the FFT pattern painted as I understood it was to be done.

First: is this what I should do?

Second:  I cannot figure out how to apply the painted FFT pattern to the image.  If it is supposed to be happening as I paint, it isn't.

*
pattern from a light area
*


**


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Removing Pattern from Scanned Image

Michael Schmid
In reply to this post by i_am_jim
Hi Jim,

yes, if you want to get rid of the halftoning screen patter the best
method is a Fourier transform and setting the values of the spots (plus
some surrounding, at least 3 pixels radius around them) to zero (black).
Then use Process>FFT>Inverse FFT.

In your case, there are more spots that have to be set to zero than in
the FFT in your attachment.
You do not need to paint the spots on both sides; since the FFT is
symmetric, it is enough to paint on one side; ImageJ automatically cares
about the spots on the other sides. (Strictly speaking, the symmetric
image that you see is the power spectrum with logarithmic scaling; the
actual FFT data are invisible).

Anyhow, don't expect a perfect result; you will usually see some
remainder of the screen or moiré patter, especially in regions where the
brightness changes. A way out is the following:
Before filtering, try to find out which radius of a Mean filter best
suppresses the screen. For your sample, a radius of 2 works best. Don't
apply the filter, just use 'preview' and press cancel when done.
Then do the Fourier filtering, and apply the Mean filter with the radius
previously determined previously. That should give you a much better
result than just filtering in the Fourier domain.


Michael
________________________________________________________________


On 24/09/2018 22:20, jim wrote:

I've gotten so many messages from the Listserve people I don't know if
this message got through or not.  If so, delete it and reply to my
earlier one(s).

I am a complete novice at this but I found imagej on the web and it
appeared it would do what I need.  I have scanned images from a book
printed in the 60's.  They were poor quality in the book.  I am trying
to remove the pattern used to print them.  Below is a sample from the
image and the FFT pattern painted as I understood it was to be done.

First: is this what I should do?

Second:Â  I cannot figure out how to apply the painted FFT pattern to the
image.  If it is supposed to be happening as I paint, it isn't.

*
pattern from a light area
*


**


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Removing Pattern from Scanned Image

i_am_jim
In reply to this post by Cardone, Giovanni
OK

That answers my most critical question -- not knowing how to apply the
painted pattern.   Thank you.  The articles in the other replies
indicate I'm doing the painting correctly and now I'm seeing some very
satisfying results.

On 9/25/2018 2:28 AM, Cardone, Giovanni wrote:

> Hi jim,
>
> showing the original image would help to understand if you are doing things correctly. In any case you don't "apply the painted FFT pattern to the image", rather you calculate the inverse FFT (menu Process/FFT/Inverse FFT) of the painted FFT. Therefore it is a trial and error procedure, unless you know exactly what you are doing.
>
> Giovanni
>
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of jim
> Sent: Montag, 24. September 2018 22:20
> To: [hidden email]
> Subject: Removing Pattern from Scanned Image
>
> I've gotten so many messages from the Listserve people I don't know if this message got through or not.  If so, delete it and reply to my earlier one(s).
>
> I am a complete novice at this but I found imagej on the web and it appeared it would do what I need.  I have scanned images from a book printed in the 60's.  They were poor quality in the book.  I am trying to remove the pattern used to print them.  Below is a sample from the image and the FFT pattern painted as I understood it was to be done.
>
> First: is this what I should do?
>
> Second:  I cannot figure out how to apply the painted FFT pattern to the image.  If it is supposed to be happening as I paint, it isn't.
>
> *
> pattern from a light area
> *
>
>
> **
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Removing Pattern from Scanned Image

i_am_jim
In reply to this post by Michael Schmid
Thank you Michael.

A most helpful reply.  Realizing I don't have to paint the spots on both
sides has saved me time (I'm working on several pictures).  And, I
didn't realize the size of the dots was as important as it is.  I had
been using large 60-100 (pixel?) ones. Now I've made them smaller and am
getting better results.

When you say '*/make the size of the spots about 3 pixels larger/*', I'm
not sure larger than what?  The bright things are not just dots, they
radiate vertically and horizontally, starlike.  To cover the entire
'star' would cover a large amount of the area.

See included image.  I found these small dots to be too small.  By
increasing them to about the size of the larger dots did better.

But, I didn't understand the purpose of the Mean filter nor how to use
it.  When I applied it at 2 pixals it blurred the entire image.

jim



On 9/25/2018 5:07 AM, Michael Schmid wrote:

> Hi Jim,
>
> yes, if you want to get rid of the halftoning screen patter the best
> method is a Fourier transform and setting the values of the spots
> (plus some surrounding, at least 3 pixels radius around them) to zero
> (black).
> Then use Process>FFT>Inverse FFT.
>
> In your case, there are more spots that have to be set to zero than in
> the FFT in your attachment.
> You do not need to paint the spots on both sides; since the FFT is
> symmetric, it is enough to paint on one side; ImageJ automatically
> cares about the spots on the other sides. (Strictly speaking, the
> symmetric image that you see is the power spectrum with logarithmic
> scaling; the actual FFT data are invisible).
>
> Anyhow, don't expect a perfect result; you will usually see some
> remainder of the screen or moiré patter, especially in regions where
> the brightness changes. A way out is the following:
> Before filtering, try to find out which radius of a Mean filter best
> suppresses the screen. For your sample, a radius of 2 works best.
> Don't apply the filter, just use 'preview' and press cancel when done.
> Then do the Fourier filtering, and apply the Mean filter with the
> radius previously determined previously. That should give you a much
> better result than just filtering in the Fourier domain.
>
>
> Michael
> ________________________________________________________________


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

onhlnjlhkhghocpg.png (1M) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Removing Pattern from Scanned Image

Michael Schmid
Hi Jim,

concerning the size of the spots you painting in the FFT: what I wanted
to say is "3 pixels larger than the area you want to cover".
That's because these spots will get blurred by about 3 pxl before they
are applied (sharp borders would lead to artifacts).

Note that the FFT displayed has logarithmic grayscale, usually over many
orders of magnitude. So you will almost always see some weak intensity
rather far from the center of the bright spots in the FFT display, but
it is actually very low. If you select 'Raw Power Spectrum' in the FFT
options, you will get an idea about how many orders of magnitude are
involved (typically, in the "Power Spectrum" image, you will only see
the spot at the center, with "Auto Brightness&Contrast" you might see
some of the very brightest spots.


Additional filtering with radius=2: This was for the small 142x90 pixels
sample image in your mail. I had the impression that the features in
this image did not appear blurred very much. If you can get satisfactory
results without the blurring, it's ok.


By the way, if all of your images have the same screen pattern, you can
use the same pattern for all:
E.g. threshold the image with the painted black spots from 0 to 0,
Edit>Selection>Create Selection and type 't' to add it to the ROI manager.
In some other FFT, simply click on the ROI in the list (maybe twice if
it is not selected the first time), and set the ROI contents to zero
(Process>Math>Set or 'fill' if you have defined black as background color)



Michael
________________________________________________________________


On 25/09/2018 18:01, jim wrote:

> Thank you Michael.
>
> A most helpful reply.  Realizing I don't have to paint the spots on both
> sides has saved me time (I'm working on several pictures).  And, I
> didn't realize the size of the dots was as important as it is.  I had
> been using large 60-100 (pixel?) ones. Now I've made them smaller and am
> getting better results.
>
> When you say '*/make the size of the spots about 3 pixels larger/*', I'm
> not sure larger than what?  The bright things are not just dots, they
> radiate vertically and horizontally, starlike.  To cover the entire
> 'star' would cover a large amount of the area.
>
> See included image.  I found these small dots to be too small.  By
> increasing them to about the size of the larger dots did better.
>
> But, I didn't understand the purpose of the Mean filter nor how to use
> it.  When I applied it at 2 pixals it blurred the entire image.
>
> jim
>
>
>
> On 9/25/2018 5:07 AM, Michael Schmid wrote:
>> Hi Jim,
>>
>> yes, if you want to get rid of the halftoning screen patter the best
>> method is a Fourier transform and setting the values of the spots
>> (plus some surrounding, at least 3 pixels radius around them) to zero
>> (black).
>> Then use Process>FFT>Inverse FFT.
>>
>> In your case, there are more spots that have to be set to zero than in
>> the FFT in your attachment.
>> You do not need to paint the spots on both sides; since the FFT is
>> symmetric, it is enough to paint on one side; ImageJ automatically
>> cares about the spots on the other sides. (Strictly speaking, the
>> symmetric image that you see is the power spectrum with logarithmic
>> scaling; the actual FFT data are invisible).
>>
>> Anyhow, don't expect a perfect result; you will usually see some
>> remainder of the screen or moiré patter, especially in regions where
>> the brightness changes. A way out is the following:
>> Before filtering, try to find out which radius of a Mean filter best
>> suppresses the screen. For your sample, a radius of 2 works best.
>> Don't apply the filter, just use 'preview' and press cancel when done.
>> Then do the Fourier filtering, and apply the Mean filter with the
>> radius previously determined previously. That should give you a much
>> better result than just filtering in the Fourier domain.
>>
>>
>> Michael
>> ________________________________________________________________
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html