A new Live Fourier Transform demonstration

Поділитися
Вставка
  • Опубліковано 6 жов 2024
  • A new version of the Live Fourier Transform demonstration. This can be used to explain the patterns we see in X-ray scattering and diffraction experiments. The live FT program can be downloaded and should work on any modern mac with Python 2.7 with the OpenCV library.
    For more info, read here: www.lookingatno...
    Code is available here: bitbucket.org/...

КОМЕНТАРІ • 30

  • @HuygensOptics
    @HuygensOptics 4 роки тому +1

    This is a very nice demonstration, I wish I had found it earlier...

  • @VictorAndScience
    @VictorAndScience 9 років тому +4

    I've been studying microscopy for some time and I hadn't not found a video that was this helpful and intuitive. I appreciate the work done here. Thank you.

  • @bostaphkatya
    @bostaphkatya 8 років тому +7

    omg! I cannot believe I finally found this! Brian, thank you soooo much! It is so helpful. I finally can visualize the Fourier space and central slice theorem. All the books just show the basic schematics and formula but I couldn't really understand it for so long! Thank you again. I'll include your simulation in my presentation and cite you of course.

  • @aretew6373
    @aretew6373 5 років тому +2

    Wow very interesting !! Another interesting thing to do would be inverse transform using diffraction pattern. The imaging using inverse transform is very important now a days.

  • @Drteixeiradasilva
    @Drteixeiradasilva 10 років тому +1

    Dear Brian,
    Thank you very much for the video and for the program. It is a really nice way to introduce the concept of FT and the relationship between direct and reciprocal space in XRD/SAS courses.
    Congratulations.

    • @drheaddamage
      @drheaddamage  10 років тому

      Dear Emerson,
      Thanks for the positive comments! Please enjoy the programs and feel free to buy me a drink at the next SAS meeting :).
      Cheers,
      Brian.

  • @sattysatish
    @sattysatish 8 років тому +1

    I have some SANS data from a recent experiment and it really helped me to differentiate the shapes .
    Many thanks for sharing.

  • @reztaft
    @reztaft 8 років тому +1

    What a great demo!

  • @fudgesauce
    @fudgesauce 4 роки тому +1

    It would be interesting to capture the fourier transformed image for some object, print it on paper, then hold it up in front of the live feed. It seems like the second pass should recover the original image somewhat, as the transform is its own inverse (modulo scale/sign differences, and all the noise of an imperfect capture).

    • @drheaddamage
      @drheaddamage  4 роки тому +1

      Unfortunately, that won't work because of an essential problem in scattering: the loss of the phase information of the Fourier transform. So, when you do a Fourier transform of a signal, you get two pieces of information out as a complex number: the amplitude and the phase. However, what you see in small-angle scattering (and what is shown here) is the scattering intensity. This is the amplitude squared, phase information is lost there. That means that a unique back-transformation is not possible, and is the reason why we can't reconstruct the 3D electron density distribution from a scattering pattern.

  • @chrismofer
    @chrismofer 5 років тому +1

    cool! thanks for posting the code!

  • @neojohns2487
    @neojohns2487 4 роки тому

    Superman about fourier transform!!! Briliant.

  • @Tadesan
    @Tadesan 6 років тому +1

    Joseph Fourier knew his shit!!!

  • @devrim-oguz
    @devrim-oguz 7 років тому

    Really thank you for your effort and your code, I have tried some fractals and got weird results. It was an eye opening experience for me. Tried on Ubuntu 17.04 with Python 2.7 This actually reveals some deep insights about how our brains and how the universe works, I don't know if you noticed that?

    • @devrim-oguz
      @devrim-oguz 7 років тому

      And also, thank you for sharing this public on youtube.

  • @HallowWorld262
    @HallowWorld262 7 років тому +1

    Hello, i am in the early stages of my PHD research and part of my program involves mapping images into 2D FT. could you please share the code or the mathematical models used to achieve these results. many thanks

    • @drheaddamage
      @drheaddamage  7 років тому

      Hello Jo,
      The link to the code is in the video description. The line you're looking for is line 195, the rest is for cleaning up images. Line 195 reads:
      Intensity = np.abs( np.fft.fftshift( np.fft.fft2(im) ) )**2
      That's all there is to it!

  • @henrmota
    @henrmota 3 роки тому

    Anyone notice how the voice alters the ft?

  • @笨土豆
    @笨土豆 7 років тому

    I have a question of Fourier transform, when you rotate the object, it look like the image in the fourier transform is rotate as well. Can you detect the orientation from frequency domain image? I'm try to study how to figure out the orientation of object by FFT

    • @drheaddamage
      @drheaddamage  7 років тому

      Yes, rotations in Fourier space are the only thing that make sense: you rotate an anisotropic object in space, and the 3D Fourier transform rotates accordingly.

  • @r0galik
    @r0galik 10 років тому

    Hi, I tested the software on Linux. It works but there is no video output.

    • @drheaddamage
      @drheaddamage  10 років тому +1

      If you try to open an OpenCV "NamedWindow", does that appear fine? I had some trouble at the start with the NamedWindow not being initialised fully before the video stream started. If the window opens fine, please uncomment line 112 in the code (raw_input('Press Enter to start')). When starting the live FT, wait until you see the window, then press "return" in the terminal/python window to start.

    • @r0galik
      @r0galik 10 років тому

      Thanks for the reply!
      Firstly, I am an almost complete and utter noob. I don't know how to open NamedWindow. But what I can say is that the first script from this page: www.betasix.net/opencv-2-2-python-examples/ works (the camera window appears). It contains this code element.
      Alas, when running both scripts - this one and yours, I get an error "HIGHGUI ERROR: V4L/V4L2: VIDIOC_S_CROP". When I compiled OpenCV it said that V4L2 is available, but it couldn't find a file called "videoio.h", if this is important in any way.
      Uncommenting the line you suggested does not make it work...

    • @drheaddamage
      @drheaddamage  10 років тому +1

      r0galik No need to apologise for a lack of experience, we all had to start from zero at some point!
      As far as I understand from the OpenCV docs, the HIGHGUI environment provides the basis for the window handling and display. Additionally, the video IO could be related to the image capture procedure, but if you can run the example from the betasix website and capture the video, this one shouldn't be a big issue either.
      So you are seeing the framerates come by when you run the code? The only problem is the video display? I did use the newer cv2 bindings as opposed to the older calls used in their example..
      Sorry, I can't seem to figure out what goes wrong in your case. If you find out (perhaps ask a friend?), please let me know!

    • @r0galik
      @r0galik 10 років тому

      Yes, I'm seeing the framerates only. I'll contact you if I find the solution!

    • @drheaddamage
      @drheaddamage  10 років тому

      r0galik Hey again. Some people at the Australian Syncrotron got it working under windows with a minimum of modification. I have uploaded their modified code to the Git/BitBucket repository a few days ago. Hope it'll work this time!

  • @cmdalbem
    @cmdalbem 4 роки тому

    Ladies, gentlemen...

    • @drheaddamage
      @drheaddamage  4 роки тому

      yea, that used to be my standard opener a while ago, I've abandoned it since as it imposes a false dichotomy on the gender spectrum.