having trouble removing image artifacts with FFT

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

having trouble removing image artifacts with FFT

JonI
I have an image I am trying to work on here:

http://img825.imageshack.us/img825/9227/testfci.jpg

As can be seen, this image has horizontal and vertical lines throughout
which I am trying to eliminate using FFT/ inverse FFT.  I have tried to
paint out several lines, blobs on the FFT, but either the image ends up
distorted or the lines are not removed.  Can anyone help with a proper
FFT filtering to remove the lines?

Thanks,
Jon

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

Re: having trouble removing image artifacts with FFT

John Dunsmuir
Jon,
     Is there a special reason for using FFTs?  A Gaussian blur will remove the lines, similar to FFT with a cutoff.
John D.

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

Re: having trouble removing image artifacts with FFT

JonI
Yes, I am attempting to increase sharpness as well.  I tried a gaussian
blur and, if no other choice, I can use it, but the lines still show
after sharpening post blur.

Jon

> Jon,
>       Is there a special reason for using FFTs?  A Gaussian blur will remove the lines, similar to FFT with a cutoff.
> John D.
>
> --
> 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: having trouble removing image artifacts with FFT

Luke Stuyvenberg
Jon,

I believe what you're looking for is a low-pass filter: since the lines are at a high spacial frequency, if you cut off those frequencies you'll be left with the remaining structure of your image, as desired.


While possible to perform a low-pass manually (using the Fourier transform, modifying the spectrum, then inverting it), it would probably be a lot easier to use the Bandpass Filter option under Process -> FFT -> Bandpass Filter...
By setting the maximum large structure size to be the largest dimension of your image (1440 px), you won't filter out any low-frequency (big) things. Then set the minimum small-structure size to 1 or 2 pixels. (You can play with the directional tolerance, but it should be able to be pretty low without trouble.) Running this filter over your image should reduce the vertical lines without sacrificing much else.


Hope this helps,
Luke Stuyvenberg

On 04/22/13, JonI  wrote:

> Yes, I am attempting to increase sharpness as well. I tried a gaussian blur and, if no other choice, I can use it, but the lines still show after sharpening post blur.
>
> Jon
>
> >Jon,
> > Is there a special reason for using FFTs? A Gaussian blur will remove the lines, similar to FFT with a cutoff.
> >John D.
> >
> >--
> >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: having trouble removing image artifacts with FFT

Benjamin Grant
A low pass filter is going to give results pretty similar to Gaussian blur.
Band stop would be best
On Apr 22, 2013 7:01 PM, "Luke Stuyvenberg" <[hidden email]> wrote:

> Jon,
>
> I believe what you're looking for is a low-pass filter: since the lines
> are at a high spacial frequency, if you cut off those frequencies you'll be
> left with the remaining structure of your image, as desired.
>
>
> While possible to perform a low-pass manually (using the Fourier
> transform, modifying the spectrum, then inverting it), it would probably be
> a lot easier to use the Bandpass Filter option under Process -> FFT ->
> Bandpass Filter...
> By setting the maximum large structure size to be the largest dimension of
> your image (1440 px), you won't filter out any low-frequency (big) things.
> Then set the minimum small-structure size to 1 or 2 pixels. (You can play
> with the directional tolerance, but it should be able to be pretty low
> without trouble.) Running this filter over your image should reduce the
> vertical lines without sacrificing much else.
>
>
> Hope this helps,
> Luke Stuyvenberg
>
> On 04/22/13, JonI  wrote:
> > Yes, I am attempting to increase sharpness as well. I tried a gaussian
> blur and, if no other choice, I can use it, but the lines still show after
> sharpening post blur.
> >
> > Jon
> >
> > >Jon,
> > > Is there a special reason for using FFTs? A Gaussian blur will remove
> the lines, similar to FFT with a cutoff.
> > >John D.
> > >
> > >--
> > >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
>

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

Re: having trouble removing image artifacts with FFT

Michael Schmid
In reply to this post by JonI
Hi Jon,

you can try convolution with the following kernel:

1 2 1
2 4 2
1 2 1

It causes only very slight blurring.

Michael
________________________________________________________________
On Apr 22, 2013, at 21:36, JonI wrote:

> I have an image I am trying to work on here:
>
> http://img825.imageshack.us/img825/9227/testfci.jpg
>
> As can be seen, this image has horizontal and vertical lines throughout which I am trying to eliminate using FFT/ inverse FFT.  I have tried to paint out several lines, blobs on the FFT, but either the image ends up distorted or the lines are not removed.  Can anyone help with a proper FFT filtering to remove the lines?
>
> Thanks,
> Jon
>
> --
> 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: having trouble removing image artifacts with FFT

JonI
Thanks to all and I appreciate the tips so far.  I tried the low pass
and the convolution numbers.  They both seem to rid the noise, but it
doesn't appear to be to the extent where I can apply additional
sharpening without bringing the artifacts back.  I have yet to try a
bandstop filter- not sure how to implement that in the program as I
don't see a menu item for it.  The same for the low pass, so I used
another program to apply that one, but not bandstop.

Jon

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

Re: having trouble removing image artifacts with FFT

Gabriel Landini
On Tuesday 23 Apr 2013 12:30:11 you wrote:
> Thanks to all and I appreciate the tips so far.  I tried the low pass
> and the convolution numbers.  They both seem to rid the noise, but it
> doesn't appear to be to the extent where I can apply additional
> sharpening without bringing the artifacts back.  I have yet to try a
> bandstop filter- not sure how to implement that in the program as I
> don't see a menu item for it.  The same for the low pass, so I used
> another program to apply that one, but not bandstop.

You could try also some small size (radius=1) median filter, before
sharpening. But the problem might have no easy solution: the pattern you want
to remove is also the thing that a simple sharpening algorithm would enhance.
If your banding was lower frequency, then maybe FFT would be more appropriate.

If the noise is not fixed (it changes from frame to frame) you could do some
integration/averaging of shots to get rid of it.

Cheers

Gabriel

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

Re: having trouble removing image artifacts with FFT

Michael Schmid
In reply to this post by JonI
Hi Jon,

for sharpening, if you just want sharp edges, you might try an unconventional approach: Some edge-preserving smoothing filters like the Thresholded Blur plugin also do a good job to make edges sharper.

http://imagejdocu.tudor.lu/doku.php?id=plugin:filter:thresholded_blur:start

Michael
________________________________________________________________
On Apr 23, 2013, at 13:30, JonI wrote:

> Thanks to all and I appreciate the tips so far.  I tried the low pass and the convolution numbers.  They both seem to rid the noise, but it doesn't appear to be to the extent where I can apply additional sharpening without bringing the artifacts back.  I have yet to try a bandstop filter- not sure how to implement that in the program as I don't see a menu item for it.  The same for the low pass, so I used another program to apply that one, but not bandstop.
>
> Jon
>
> --
> 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: having trouble removing image artifacts with FFT

JonI
I'll try more of the suggestions, thanks.  The problem truly lies in the
original source material.  There is an apparent grid embedded within
every image taken this way due to the device the images are taken from.  
Since there's no way to eliminate the grid from the device (as it's part
of the way the images are made), I was wondering if there was any way to
filter it out after images were captured, and was why I turned here.  So
far the suggestions have been very good and I am wondering something
else:  I'm wondering if it would be possible to take a blank image and
then use that to somehow cancel out the gridding when an image is
taken?  Jon

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

Re: having trouble removing image artifacts with FFT

Gabriel Landini
If the positoning of the grid in the image does not change and it is visible,
you could image only the grid and then use transmittance to get rid of it.

http://imagejdocu.tudor.lu/doku.php?id=howto:working:how_to_correct_background_illumination_in_brightfield_microscopy

That assumes that the background intensity should remain unchanged between the
shots.
Regards

Gabriel

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

Re: having trouble removing image artifacts with FFT

Herbie-2
In reply to this post by JonI
Jon,

my inspection of the sample image in the space- and in the
spatial-frequency domain doesn't reveal any horizontal or vertical lines.

With respect to your desire of sharpening such images I should like to
note that at least the sample image has already been sharpened much too
much! (There is pronounced ringing at the object boundaries.)

What you are perhaps referring to by "horizontal and vertical lines" are
strange effects at the object boundaries that go together with the ringing.

I don't think that these effects can be removed without loss of spatial
resolution. At least for the sample image, further sharpening seems not
to be advisable.

Best

Herbie

________________________
On 22.04.13 21:36, JonI wrote:

> I have an image I am trying to work on here:
>
> http://img825.imageshack.us/img825/9227/testfci.jpg
>
> As can be seen, this image has horizontal and vertical lines throughout
> which I am trying to eliminate using FFT/ inverse FFT. I have tried to
> paint out several lines, blobs on the FFT, but either the image ends up
> distorted or the lines are not removed. Can anyone help with a proper
> FFT filtering to remove the lines?
>
> Thanks,
> Jon
>
> --
> 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: having trouble removing image artifacts with FFT

Graeme Ball-2
In reply to this post by JonI
Hi Jon,

which lines are the problem? the very fine vertical lines? if so,
convolution or band stop should work as the others have said.

However, I notice you sent a .jpg, and just wanted to check you're not
trying to work on this compressed file?

If you are trying to use ImageJ's Fourier filtering (i.e.
Process->FFT->Bandpass Filter), the "Suppress stripes: vertical" option
does not work on such a compressed image. Normally vertical lines should
give a horizontal stripe in the center of the Fourier image, but i guess
that here, areas of constant intensity are smoothed by the compression and
the stripes are only apparent at sharp edges in your image - to filter
these out, you would need a very weird custom Fourier filter (a mask image
can be used to pass/block any frequencies you want using:
Process->FFT->Custom filter). Also, if you are Fourier filtering, it is
best to crop the image to e.g. 1024 by 1024, because FFT otherwise pads to
the nearest power of 2.

Regards,

Graeme


On Mon, Apr 22, 2013 at 8:36 PM, JonI <[hidden email]> wrote:

> I have an image I am trying to work on here:
>
> http://img825.imageshack.us/img825/9227/testfci.jpg
>
> As can be seen, this image has horizontal and vertical lines throughout
> which I am trying to eliminate using FFT/ inverse FFT.  I have tried to
> paint out several lines, blobs on the FFT, but either the image ends up
> distorted or the lines are not removed.  Can anyone help with a proper
> FFT filtering to remove the lines?
>
> Thanks,
> Jon
>
> --
> 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: having trouble removing image artifacts with FFT

Michael Schmid
In reply to this post by JonI
Hi Jon,

looking at it closely, it seems that you have some ringing with a spatial frequency of two pixels at all edges.

Of course, it would be best to find the reason for that problem in the instrument or the image acquisition.  My guess it that it is an artifact caused by sharpening the image (actually over-sharpening, as mentioned by Herbie) - e.g. the result of a wavelet filter. If you can, disable all the image processing on your x-ray machine. You can then apply some sharpening yourself (e.g. 'unsharp mask') if you need.

I tried FFT filtering with that knowledge, also with limiting it to near-edge areas, but it tends to produce artifacts. The simple convolution that I had mentioned earlier is much better, no artifacts, and the blurring it introduces is absolutely negligible compared to the resolution of the image.
The simple convolution does not remove the 'turned-up edges' caused by over-sharpening the image; you have to care about this separately.

Michael
________________________________________________________________
On Apr 23, 2013, at 14:08, JonI wrote:

> I'll try more of the suggestions, thanks.  The problem truly lies in the original source material.  There is an apparent grid embedded within every image taken this way due to the device the images are taken from.  Since there's no way to eliminate the grid from the device (as it's part of the way the images are made), I was wondering if there was any way to filter it out after images were captured, and was why I turned here.  So far the suggestions have been very good and I am wondering something else:  I'm wondering if it would be possible to take a blank image and then use that to somehow cancel out the gridding when an image is taken?  Jon
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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