Results 1 to 6 of 6

Thread: Spatial Filtering - Demystified (well, slightly...)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Administrator Redrobes's Avatar
    Join Date
    Dec 2007
    Location
    England
    Posts
    7,245
    Blog Entries
    8

    Post Spatial Filtering - Demystified (well, slightly...)

    Following a request from this thread
    http://www.cartographersguild.com/showthread.php?t=2473

    where I tried to fix up some issues with some terrain noise using a spatial filter, I have been asked to explain a bit more about the process. Its not an easy process to understand but I have uploaded my old help file and clipped some app specific bits out of it.

    It seems that Gimp at least has an FFT plugin which does exactly the same thing though the screen images might be slightly different, the principle is the same.

    Maybe RobA can do some screenies of the images posted from this next link using Gimp and we can see the same process being done.

    Spatial Imaging Help

  2. #2

    Post

    Well.....

    The FFT stuff in gimp seems a bit different. Principally, when you run an FFT on an image, it uses 50% grey as the 0 point.

    For example, your image:


    has a spectrum of this:


    Whereas the result of a FFT in gimp is this:
    gimp_spectrum.png

    The same manipulation can be done, but to zero out a portion of the specrum, instead of black, I paint with 50% grey. (Actually, I create a layer that is 50% grey and use a layer masks). For the provided image, I did the same thing as you, decomposing the image to RGB, then masking each depending on the "hotspots", replacing those areas with 50% grey in each channel. Here is the result:
    rgb-compose.png

    This seems a pain in the butt (all that manual painting) so I tried another experiment... After decomposing, I ran a sobel edge detection on each channel, applied a 10px gaussian blur, thresholded it, followed by a 5px gaussian blur, then normalized each channel. Blending down each of these masks and recompositing gave me:
    rgb-compose2.png

    I think it is a pretty impressive results for something that I could automate...(hmmm)

    Also, for reference, here is the FFT the procedure resulted in:
    rgb-compose2_fft.png

    I have been able to create gimp equivalents for the first 12 of the filters you show, but have not worked out the last three... how do you prevent image blowout?

    -Rob A>

  3. #3

    Post

    Quote Originally Posted by RobA View Post
    I have been able to create gimp equivalents for the first 12 of the filters you show, but have not worked out the last three... how do you prevent image blowout?
    Think I might have have it now... I am using a 50% layer set to divide mode (i.e. x 2) on to with a mask... Here are some results on a photo I took... do these make sense, Redrobes?

    Orig:
    test.jpg

    HF enhance:
    detail enhance 1 HF.png

    HF and MF enhance:
    detail enhance 2 HF and MF.png

    HF, MF, and some LF enhance:
    detail enhance 3 HF MF and LF.png

    -Rob A>

  4. #4
    Administrator Redrobes's Avatar
    Join Date
    Dec 2007
    Location
    England
    Posts
    7,245
    Blog Entries
    8

    Post

    Yeah I think thats doing the trick. One thing I wanted to try for a while and which you might want to expand or script up is a way of creating wave outlines for a coast using the effects of deliberate ringing. Some pics show what I mean but I haven't faffed about much to distill the idea down to something usable yet.

  5. #5

    Post

    That is pretty clever! Try reflecting the image x&y to make it symmetrical before applying the fft. That way when you reverse it it wont ring around the lower RH corner.

    Also, as an update, here is that second snippet from the other thread, processed (now that I think I have this figured out) using the edge detect/blur/mask method:
    scrubbed.png

    Not too bad, still a bit of playing with parameters required, however.

    -Rob A>

  6. #6

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •