Author Topic: Fast Fourier Transform Process  (Read 9121 times)

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Fast Fourier Transform Process
« on: 2009 October 29 07:24:17 »
Way back at the time PI v1.1 was released, there was the following quote from Juan :

Quote
- FourierTransform process. The idea behind this tool is quite simple, but powerful: transform an image into the frequency (Fourier) domain, and provide a graphical interface to edit the Fourier transform, including pixel drawing tools. Then perform the inverse FFT, back to the spatial domain. An ideal tool to handle periodic image features, as interferences or repetitive textures and patterns.

Am I missing something obvious (BTW, I am not near my PI install, so I can't check), but do we now have an FFT Process, or is this something still 'in the pipeline' ?

The reason I am asking is that I would like to have a look at my Flat subs, and my MasterFlats after FFT, specifically to see whether there is any residual 'regular pattern' present, the existence of which would leave me considering 'why', and 'what next' as far as Flats acquisition was concerned. (The same analyisis might also show interesting results when applied to Darks, FlatDarks and Offsets, of course)



This follows on from a discussion I had here on the Forum with Simon Hicks, who pointed out that, just because my MasterFlat showed almost 'zero' Standard Deviation, this would not necessarily mean that the 'minimal' distribution of ADU values on the image didn't in fact have some sort of 'pattern' associated with it. For example, consider an image with ADU values that were either '1000' or '1001'. Now, a simple statistical analysis would show a very narrow 'peak', centred around a Median value of '1000.5'. However, the '1000' values might represent the 'every ODD line', and the '1000.5' values might represent 'every EVEN line'. In other words, an image with a very obvious spatial pattern (trivial in this case, as it would be easily observed with a suitable STF for example), and one that would produce a very obvious result in the FFT domain. However, a 'true' MasterFlat, with no anomalies other than vignetting gradients and 'dust donuts', would not show the FFT 'spikes' associated with regular frequencies.

Hopefully, if I understand the concept of FFT correctly, if there is no obvious 'pattern' in the FFT domain, then the source image probably does NOT have any regular spatial patterning.

Of course, my interpretation may be completely flawed - but that is why I want to 'play' with my data and an FFT Process in the first place  :D

Cheers,
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline Cheyenne

  • PixInsight Addict
  • ***
  • Posts: 146
    • Link to Picasa gallery of my astronomy photos
Re: Fast Fourier Transform Process
« Reply #1 on: 2009 October 29 09:11:29 »
Looks like FFT is a method of the Image class and is available to scripts.  Take a look at the FFTRegistration script
Cheyenne Wills
Takahashi 130 TOA
Losmandy G11
SBIG STF8300M
Canon 20Da
SBIG ST-i + openPHD for autoguiding

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Fast Fourier Transform Process
« Reply #2 on: 2009 October 29 12:10:32 »
Hi Niall

You are right. Spikes in the FFT image shows sinusoidal patterns on the real image. The location of the spike indicates the direction and amplitude. So, FFT analysis and manipulation could be a very powerful way to perform many task... and we have a lot of deficiencies here, in terms of effective implementations. There should be a process to transform images either way (to, and from, fouries space). There is a slight problem there, because fourier space images have complex values... but we may always create two real valued images, properly identified.

This looks as a simple task that I may turn into a new process module... Everything is already defined in the PCL. Just need a "front end".

Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: Fast Fourier Transform Process
« Reply #3 on: 2009 October 29 14:30:30 »
Thanks for coming back to me guys,

At least I was right in thinking that there was NOT an FFT 'Process' as such.

I was also aware of the 'complex number' requirements in the maths needed to implement FFT's - and both of my brain cells went into overload shutdown mode at the thought of trying to code THAT in PJSR !!!

As usual, I will be at the mercy of the PCL programmers out there !

Cheers,
« Last Edit: 2009 November 03 04:30:27 by Niall Saunders »
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: Fast Fourier Transform Process
« Reply #4 on: 2009 October 29 19:40:25 »
Niall,

have you tried to use the extractwaveletlayers script? I've used it to find various patterns in my images. The other day I used it find I had a green 'glob' in one corner. I then ran SCNR and the green glob was gone. I've also used it to identify a circular pattern in my flats.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: Fast Fourier Transform Process
« Reply #5 on: 2009 November 03 04:33:41 »
Hi again,

As a matter of interest, what does the FFT of a 'circle' (or an 'annulus', or an 'airy disk') look like ?

Does anybody know this offhand?

Cheers,
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Fast Fourier Transform Process
« Reply #6 on: 2009 November 03 05:24:41 »
Nope... but I think that something like a pattern could be visible on the power spectrum.
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: Fast Fourier Transform Process
« Reply #7 on: 2009 November 03 06:10:23 »
I know wavelets can show them without problem:

http://gallery.tungstentech.com/main.php?g2_itemId=1196
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Fast Fourier Transform Process
« Reply #8 on: 2009 November 03 06:20:54 »
Sander, the "main" difference between wavelets and FT is that wavelets work in the common space, while FT works on the frequency domain, and with trigonometrical/infinite/periodical functions. So, if you wanna "see" a feature, of course wavelets are the best choise... but FT is very helpful for another kind of analysis. For example, the curvature of space is determined on background radiation data reading the power spectrum (the radial dimension of the FFT). :)
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: Fast Fourier Transform Process
« Reply #9 on: 2009 November 03 06:24:53 »
Hi all,

I almost answered my own question.

The QSI website has an interesting section on FFT analysis (specifically on 'Read Noise', but interesting in general)

Have a look at http://www.qsimaging.com/ccd_noise.html

Cheers,
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: Fast Fourier Transform Process
« Reply #10 on: 2009 November 03 06:29:01 »
Hi,

yes, I realize they are very different but I thought I'd point out wavelets may be usable in this case. Depends on what Niall wants to do.

Niall: have you tried FFT in AIP4WIN? I haven't started that up in a long time so I don't know if it would do what you want.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline David Serrano

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 503
Re: Fast Fourier Transform Process
« Reply #11 on: 2009 November 03 06:37:49 »
There should be a process to transform images either way (to, and from, fouries space). There is a slight problem there, because fourier space images have complex values... but we may always create two real valued images, properly identified.

This looks as a simple task that I may turn into a new process module... Everything is already defined in the PCL. Just need a "front end".

Crap, I had done something in JS but the source file lived in /tmp and my laptop crashed precisely yesterday after 3 months of uptime (thanks to suspend/resume). Upon rebooting, the contents of /tmp were deleted as usual and I lost the script.

It generated 2 images, with identifiers "real" and "imag". I think the red channel was the result of "FFT(true); inverseFFT();", the green channel came from "FFT(false); inverseFFT();" and the blue from "FFT(true);". From an M45 image I obtained a series of horizontal green lines in the "real" image, and a 1-pixel wide discontinuous vertical blue line on both images, horizontally centered. Don't ask me how to interpret that, though  :angel:
--
 David Serrano

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: Fast Fourier Transform Process
« Reply #12 on: 2009 November 03 06:38:43 »
Hi Sander,

Yep - it was only whilst I was sniffing around the QSI site that I suddenly remembered (of course) where I knew I had an FFT tool. (Which kind of explains my original post on this thread  :footinmouth:)

I will need to fire it up tonight, and throw my 'questions' at it, and see what the results are.

Basically, at the moment I am just 'curious', I don't even know how, or if, FFT results will help me - but, heck, its been cloudy for MONTHS now, and a guy has to keep himself amused somehow  :laugh:

Cheers,
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: Fast Fourier Transform Process
« Reply #13 on: 2009 November 03 06:42:48 »
Hi David,

Quote
horizontal green lines in the "real" image, and a 1-pixel wide discontinuous vertical blue line

Green lines are always indicative of a salvo of Photon Torpedos. The blue line is almost certainly a Romulan Disruptor beam.

 ::)
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline Astrocava

  • PixInsight Addict
  • ***
  • Posts: 180
    • Astrocava.com
Re: Fast Fourier Transform Process
« Reply #14 on: 2009 November 03 09:20:02 »
Hi David,

Quote
horizontal green lines in the "real" image, and a 1-pixel wide discontinuous vertical blue line

Green lines are always indicative of a salvo of Photon Torpedos. The blue line is almost certainly a Romulan Disruptor beam.

 ::)


That's good!. You make my day a little better. ;D

Sergi
Moonfish ED80 over a Meade LX200GPS 8"