fourier-transform | Discrete Fourier Transform in OpenCV and JavaFX

 by   opencv-java Java Version: v1.0 License: No License

kandi X-RAY | fourier-transform Summary

kandi X-RAY | fourier-transform Summary

fourier-transform is a Java library typically used in User Interface, OpenCV, JavaFX applications. fourier-transform has no bugs, it has no vulnerabilities and it has low support. However fourier-transform build file is not available. You can download it from GitHub.

A project, made in Eclipse (Neon), for experimenting with the Discrete Fourier transform (and its inverse), starting from two grayscale images: a circle and the sin function. Example images are provided in the images folder. Please, note that the project is an Eclipse project, made for teaching purposes. Before using it, you need to install the OpenCV library (version 3.x) and JavaFX 8 and create a User Library named opencv that links to the OpenCV jar and native libraries. A guide for getting started with OpenCV and Java is available at
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              fourier-transform has a low active ecosystem.
              It has 12 star(s) with 13 fork(s). There are 1 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 1 open issues and 0 have been closed. On average issues are closed in 810 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of fourier-transform is v1.0

            kandi-Quality Quality

              fourier-transform has 0 bugs and 0 code smells.

            kandi-Security Security

              fourier-transform has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              fourier-transform code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              fourier-transform does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              fourier-transform releases are available to install and integrate.
              fourier-transform has no build file. You will be need to create the build yourself to build the component from source.
              fourier-transform saves you 68 person hours of effort in developing the same functionality from scratch.
              It has 178 lines of code, 11 functions and 3 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed fourier-transform and discovered the below as its top functions. This is intended to give you an instant insight into fourier-transform implemented functionality, and help decide if they suit your requirements.
            • Loads an image from disk
            • Convert a mat object to a buffered image
            • Converts a Mat object into an Image
            • Places a property on the JavaFX thread on the JavaFX thread
            • Updates an ImageView
            • Action called when the button is applied
            • Adjust the magnitude of the quaternion to re - order
            • Optimizes the magnitude of the complex image
            • Optimize the image
            • Starts the Fourier process
            • Initialize the variables
            • Set the current stage
            • Action called when a matrix is applied
            • Starts the OpenCV library
            Get all kandi verified functions for this library.

            fourier-transform Key Features

            No Key Features are available at this moment for fourier-transform.

            fourier-transform Examples and Code Snippets

            No Code Snippets are available at this moment for fourier-transform.

            Community Discussions

            QUESTION

            Plot a fourier transform of a sin wav with matplotlib
            Asked 2021-Jan-15 at 00:30

            I am trying to plot a fourier transform of a sign wave based on the scipy documentation

            ...

            ANSWER

            Answered 2021-Jan-11 at 04:24
            import numpy as np
            import matplotlib.pyplot as plt
            import scipy.fft
            
            def sinWav(amp, freq, time, phase=0):
                return amp * np.sin(2 * np.pi * (freq * time - phase))
            
            def plotFFT(f, speriod, time):
                """Plots a fast fourier transform
            
                Args:
                    f (np.arr): A signal wave
                    speriod (int): Number of samples per second
                    time ([type]): total seconds in wave
                """
            
                N = speriod * time
                # sample spacing
                T = 1.0 / 800.0
                x = np.linspace(0.0, N*T, N, endpoint=False)
            
                yf = scipy.fft.fft(f)
                xf = scipy.fft.fftfreq(N, T)[:N//2]
            
                amplitudes = 1/speriod* np.abs(yf[:N//2])
              
                plt.plot(xf, amplitudes)
                plt.grid()
                plt.xlim([1,3])
                plt.show()
            
            
            speriod = 800
            time  = {
                0: np.arange(0, 4, 1/speriod),
                1: np.arange(4, 8, 1/speriod),
                2: np.arange(8, 12, 1/speriod)
            }
            
            signal = np.concatenate([
                sinWav(amp=0.25, freq=2, time=time[0]),
                sinWav(amp=1, freq=2, time=time[1]),
                sinWav(amp=0.5, freq=2, time=time[2])
            ])   # generate signal
            
            plotFFT(signal, speriod, 12)
            

            Source https://stackoverflow.com/questions/65660991

            QUESTION

            Issue with displaying DFT output with openCV's imshow
            Asked 2020-Dec-21 at 21:28

            I was following the tutorial on this website to create a low-pass filter using NumPy and OpenCV in python. Instead of displaying the transformed image using pyplot as shown in the tutorial, I tried using OpenCV's imshow function but I am not getting the desired output.

            ...

            ANSWER

            Answered 2020-Dec-19 at 12:20

            If you want to display data in type np.float32 you have to normalize it to 1.0

            Source https://stackoverflow.com/questions/65369482

            QUESTION

            Efficient Kullback–Leibler calculation
            Asked 2020-Oct-10 at 21:40

            I am looking to implement KL Divergence in C++ efficiently. (CPU Only for now).

            Much like AES or FTT (Fast Fourier transform) whereby use of a common function has lead to hardware level optimizations (Intel AES and Intel FTT). Is there anything similar for natural log, or slightly higher level efficiencies (ASM/C) that prevent bottlenecks of executing many Natural log functions in success (If they exist)?

            Same use case examples:

            ...

            ANSWER

            Answered 2020-Oct-10 at 21:28

            You can use SSE instructions to calculate the logarithm of many values in parallel. But whether you can actually make use of those instructions depends heavily on how the rest of the calculations you are going to do depend on the logarithms you calculate, so it is not possible to give a more specific answer.

            Source https://stackoverflow.com/questions/64298405

            QUESTION

            Spectrogram generation in java using FFT on a .wav file not producing expected output
            Asked 2020-Jul-25 at 11:07

            So I am making an AI project that classifies speech into either "up", "down", "left", right or background noise, and from this, a character in a videogame is moved.

            I have made an FFT algorithm deriving it from the mathematical explanation, which I believe is correct as I have tested its output against that from this site (https://engineering.icalculator.info/discrete-fourier-transform-calculator.html)

            I then have tried to generate a spectrogram and have used code based on the code from the main function of the App class from this site (Creating spectrogram from .wav using FFT in java)

            I tested my code on a .wav file of me saying hello and the spectrogram generated is not what I was expecting out, see below the difference between my java made spectrogram and my python made spectrogram (ignore the colour difference).

            Java Spectrogram

            Python Spectrogram

            New Java Spectrogram with SleuthEyes help

            Here is the original code I have used/written:

            ...

            ANSWER

            Answered 2020-Jul-24 at 10:47

            Reading the .wav file

            The .wav file decoding included in that other question you linked is hardly a full blown decoder. It accounts for the OP's specific stereo 2bytes-per-sample use-case.

            It looks like you stumbled upon other decoding issues while trying to adapt it to a different use case. As a general piece of advice, I'd suggest to use a more complete .wav decoder which would take into account the number of channels, the number of bytes-per-sample, etc.

            If on the other hand you want to craft your own decoder (for example as a learning exercise), then a slightly more robust implementation may look like the following:

            Source https://stackoverflow.com/questions/63015469

            QUESTION

            Intel integrated performance primitives Fourier Transform magnitudes
            Asked 2020-Jul-23 at 02:17

            When I am using Intel IPP's ippsFFTFwd_RToCCS_64f and then ippsMagnitude_64fc I get a massive peak at zero index in magnitudes array.

            My sine wave is long and main component I am interested is somewhere between 0.15 Hz and 0.25 Hz. I take the sample with 500Hz sampling frequency. If I reduce mean from the signal before FFT I get really small zero component not that peak anymore. Below is a pic of magnitudes array head:

            Also the magnitude scaling seems to be 10 times the magnitude I see in the time series of the signal e.g. if amplitude is 29 in magnitudes it is 290.

            I Am not sure why this is so and my question is 1. Do I really need to address the zero index peak with mean reduction and 2. Where does this scale of 10 come?

            ...

            ANSWER

            Answered 2020-Jul-23 at 02:17

            Do I really need to address the zero index peak with mean reduction?

            For low frequency signal analysis a small bias can really interfere (especially due to spectral leakage). For sake of illustration, consider the following low-frequency signal tone and another one with a constant bias tone_with_bias:

            Source https://stackoverflow.com/questions/62896442

            QUESTION

            ValueError: x and y can be no greater than 2-D, but have shapes (2, 1, 1) and (2,)
            Asked 2020-Jul-07 at 16:56

            Source code

            ...

            ANSWER

            Answered 2020-Jul-07 at 16:09

            You need to use reshape:

            Source https://stackoverflow.com/questions/62779125

            QUESTION

            Want to detect blur from image, but couldn't get it right
            Asked 2020-Jun-29 at 12:43

            I am actually want to convert this blur detection into C++. As a beginner in OpenCV, I am actually following this for conversion, But maybe I am getting it wrong. Here is my approach. I have to use DFT instead of FFT in C++.

            ...

            ANSWER

            Answered 2020-Jun-29 at 12:43

            I think this comes close to the original Python code

            Source https://stackoverflow.com/questions/62611751

            QUESTION

            FFT using Python
            Asked 2020-Jun-19 at 16:47

            I am receiving data from a vibration sensor in the form of two numpy arrays. The first array represents the actual values for the vibration measurement and the second array is the corresponding time information (timestamp). For example:

            ...

            ANSWER

            Answered 2020-Jun-19 at 16:45

            This is really a signal processing question, not a Python one. You have several options here:

            • if your data is uniformly sampled - you can ignore the timestamps altogether. All the information you need is in the data, and the (constant) sampling frequency: f_s = 1.0 / (timestamps[1] - timestamps[0])
            • if not, you can either:
              • use Non-uniform DFT (here is one implementation, haven't tried)
              • interpolate the data between non-uniform timestamps so it becomes uniform. Note that effectively, this applies a low-pass filter to your data, which may be not what you want (more on the effects of interpolation here).

            In all cases, when you perform FFT, time information is not required anymore, as you are in the frequency domain.

            Source https://stackoverflow.com/questions/62474562

            QUESTION

            Using Intel MKL to convert real time domain data to complex frequency and phase data and the inverse as well
            Asked 2020-Jun-07 at 15:50

            I'm writing an audio plugin and I would like to convert a series of real numbers representing sample values into a complex array representing frequency and phase. Then I want to be able to do the opposite, turning a complex array of frequency and phases to a series of real numbers, reconstructing the original data.

            I'm using Intel MKL and I see only the possibility to perform real->real conversions or complex->complex conversions. Here's the reference I'm using: Intel MKL FFT Functions.

            In that reference, there are two overloaded functions: DftiComputeForward and DftiComputeBackward. So, I would like to use these to do the conversions. In the reference for DftiCreateDescriptor, the only options available for DFTI_FORWARD_DOMAIN are DFTI_COMPLEX and DFTI_REAL, but no option for mixed conversions.

            Edit I found that the phase is actually equal to atan(imaginary/real). I don't want to mislead anyone getting information from questions.

            Edit I just learned that it's best to use atan2(imaginary,real). More information is in the comments.

            ...

            ANSWER

            Answered 2020-Jun-07 at 15:50

            Every real number is a complex number: ℝ ⊂ ℤ. So going forward from float or double in time domain to complex is trivial. The language does that for you!

            Source https://stackoverflow.com/questions/62238240

            QUESTION

            Manipulate lists in a pandas data frame column (e.g. divide by another column)
            Asked 2020-May-28 at 09:24

            I have a pandas data frame with one column containing lists. I wish to divide each list element in each row by a scalar value in another column. In the following example, I wish to divide each element in a by b:

            ...

            ANSWER

            Answered 2020-May-28 at 09:03

            zip the two columns, divide each entry in col a with its corresponding entry in col b, through a combination of product and starmap, and convert the iterator back into a list.

            Source https://stackoverflow.com/questions/62060584

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install fourier-transform

            You can download it from GitHub.
            You can use fourier-transform like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the fourier-transform component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/opencv-java/fourier-transform.git

          • CLI

            gh repo clone opencv-java/fourier-transform

          • sshUrl

            git@github.com:opencv-java/fourier-transform.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Java Libraries

            CS-Notes

            by CyC2018

            JavaGuide

            by Snailclimb

            LeetCodeAnimation

            by MisterBooo

            spring-boot

            by spring-projects

            Try Top Libraries by opencv-java

            face-detection

            by opencv-javaJava

            getting-started

            by opencv-javaJava

            object-detection

            by opencv-javaJava

            image-segmentation

            by opencv-javaJava

            video-basics

            by opencv-javaJava