We’re rewarding the question askers & reputations are being recalculated! Read more.

Hot answers tagged

9

Matlab's fft functions are all based on FFTW (this is confirmed here), so I guess the obvious choice for you should be FFTW. FFTW is hardware-independent but it can take advantage of some hardware-specific features.


6

The reason for that is that you don't normalize the DFT samples properly. Dividing by number of samples in time domain is valid only for Rectangular Window. For simple case of DFT, you should divide your amplitude by sum of window samples: $$S=\sum_{i=0}^{N-1}w_i $$ This for Rectangular Window will be obviously equal to $N$ ($8192$ in your case), whereas ...


4

Since FFT treats the signal as if it is periodic you need either to apply a window function (for example hanning) on your signal or make it coherent. In the image3 you attached you may make it coherent by only using data for a number of cycles; use samples 0..31 or 0..63. If the signal is non-coherent it will be seen by the FFT as a concatenated signal with ...


3

I would like to direct you to 3 references: C. Steger: “Extracting Curvilinear Structures: A Differential Geometric Approach”. In B. Buxton, R. Cipolla, eds., “Fourth European Conference on Computer Vision”, Lecture Notes in Computer Science, Volume 1064, Springer Verlag, pp. 630-641, 1996. C. Steger: “Extraction of Curved Lines from Images”. ...


3

From BFMatcher constructor documentation: NORM_HAMMING should be used with ORB, BRISK and BRIEF, NORM_HAMMING2 should be used with ORB when WTA_K==3 or 4 (see ORB::ORB constructor description) And ORB constructor documentation: WTA_K - [...] Other possible values are 3 and 4. [...] Such output will occupy 2 bits, and therefore it will need a special ...


3

There's also FFTS (written in C, not C++, though), which has some impressive benchmarks: https://github.com/anthonix/ffts I compiled it under Linux, but haven't had a chance to play with it yet.


3

I second the fftw suggestion. One of the nice features of fftw is "wisdom". That is, if you call many times the same Fourier Transform (with the same array size), you can ask fftw to look for the fastest way to do it, and then it will use that way for all the following computation in your code.


3

Simply put, you need a bank of passband filters. You feed your signal through each of the filters, and sum up the outputs from the filters. Designing the filters is where the fun comes in. First off, assuming this is just audio (music or the like) then there's no need of special filters. You can use the simplest and fastest and not worry too much about ...


3

In computer programs, complex numbers are usually represented by an array, field or vector containing two values: one value represents the real part, the other represents the imaginary part of the complex number. The imaginary unit itself is usually not represented at all, because this information would be redundant. An alternative representation is to ...


3

I think least squares is going to be the best approach, and that's not going to be that computationally expensive (I think! Please correct me if I'm wrong). The gradient can be estimated from a sliding window of your data using: $$ \hat{k} = \frac{\sum (x_n - \bar{x})(y_n - \bar{y})}{\sum (x_n - \bar{x})^2 } $$ where the sum over $n$ is taken over the ...


2

Try dilation, a technique used to enlargen light spots over darker spots in an image. Start by dilating the image such that many of the enlargened white blobs will overlap and form a complete connected contour, as such: Now, when OpenCV finds contours from this large figure to make convex hulls, it will find a complete circle rather than loose seperate ...


2

I was also searching for fast FFT library to be used from C++. Let me share what I think the situation is in 2019. FFTW is the most popular FFT library. It has planty of features and it's often used as the reference point, but a number of other libraries has comparable or better performance. Intel MKL library, which is now freely redistributable, is ...


2

The two that I see being used most often are: Ooura FFT: http://www.kurims.kyoto-u.ac.jp/~ooura/fft.html IPP: https://software.intel.com/en-us/intel-ipp You have to pay for a license for IPP (Intel Performance Primatives) but it would be the tool of choice for a commercial offering. Ooura FFT has good all round performance and a permissive license. On a ...


2

The UINT8 type is limited to integer numbers on the range [0, 1, 2, ..., 255]. Hence negative values are clipped into 0. A solution could be wither use other types (Floating Points) or scale and shift. For instance, given a Floating Point image with values imageMax and imageMean you can scale it into the [0, 1, 2, ..., 255] by doing: Create only ...


2

You can fully reconstruct L and R from M and S, as you suspect. In your case: $ M = {{L + R} \over 2} $ $ L = 2M - R $ $ S = {{L - R} \over 2} $ then $ S = {{2M - R - R} \over 2} $. So the math checks out. Are you not getting the results you expect? When I've worked with M&S in the past, I've alyways just done the scaling by 1/2 when returning ...


2

I am not familiar with signal processing for audio, but I would like give answer which contain common programming suggestions. Sorry, I really do not know your programming level and may be this suggestions will be look obvious and ridiculous, but I hope it will be useful. I'm getting some odd results with some code I'm working on. When you get odd ...


2

Reading the manual, even though only half the data is returned, the full length FFT is calculated: So you should normalize by whatever the full length is normalized to: fft_size.


2

As a first step, try just a simple first order smoother on your already-smoothed (but still too spiky) data: $$ v_f[n] = (1-\alpha) v_f[n-1] + \alpha v[n] $$ where $v_f$ is the velocity with extra filtering, $v$ is your current filtered velocity, and $0 \lt \alpha \lt 1$, and usually close to 1. If I do this in the R code below, then I get the green line in ...


2

Your implementation of the delay line is flawed. It's just copying the second last sample over each element. Try this instead: for (int i = 7; i >=0; i--) { // delayLine being 9 values long delayLine[i + 1] = delayLine[i]; } Previous answer below Your filter seems to be a lossy low pass filter --- even the passband has -15dB ...


2

If you require two outputs, which belong to a movement in x and the other in y direction, you could start with the assumption, that both movements are independent an simply implement two PID controller, each caring for one direction. It gets interesting at the point where you translate the output of these two controller to signals to the actuators. Here it ...


2

Here are some approaches to consider: FMCW: Transmit a "chirp" signal where the frequency transmitted is slowly ramped from a low frequency to a high frequency (repeatably as a sawtooth or ramp pattern). Multiply the received chirp with a replica of the transmitted chirp. The frequency of the resulting signal (after low pass filtering) will be ...


2

The best performance you will be able to squeeze out of a PC is with an audio interface that supports ASIO. To be able to get near 10ms of total delay (input and output) you will also need a very fast machine. Not only in terms of CPU but more importantly in terms of memory performance. On top of this delay, you are going to have to add the delay in ...


2

Your sine wave should use 2pi instead of frame rate. Also, your frequency data should have window size/2 points and go from 0 to frame rate/2, not frame rate.


2

There is (at least) one error in your routine. It concerns the definition of alpha. The correct formula is $$\alpha=\frac{\sin(\omega_0)}{2Q}$$ However, you implemented $$\alpha=\frac{\sin(\omega_0)\cdot Q}{2}$$ But that shouldn't influence the function of the filter as a high pass filter; it just implements the inverse of the given $Q$ value. Other ...


1

The answer here suggests that checkerboard patterns may yield more accurate (subpixel) calibration results and be more robust. You may have edited your question because the title asks which pattern but the text asks about rows and columns. In either case, you may consider using checkerboard instead of circle pattern maybe?


1

For dealing with images like this in the past, I have always had good luck using the "Vesselness" filter designed by Frangi et al. It utilizes the eigenvectors of the Hessian to determine the probability of a given pixel belonging to a vessel. The code is available on the MATLAB File Exchange and using the default parameters I was able to get the following ...


1

Your FFT code initializes a complex array because that is what the Fourier Transform produces. You should understand the complex exponential, and the nature of the transform as a change of basis (i.e. a projection onto a basis of sines & cosines). It is a big topic that is well travelled, start here: https://stackoverflow.com/questions/10304532/why-...


1

The problem occurred due to the pixel values of temp had the type uchar. The solution to my problem was to output the pixel values as uchar, manipulate them as double, and store them as uchar. double den=0,num=0; for(int i = -(kernel/2); i <= (kernel/2) ; i++) { for(int j = -(kernel/2) ; j <= (kernel/2); j++) { ...


1

At the "dawn" of modern image processing/computer vision, C++ had the best combination of speed and industry support (meaning tools, libraries, etc and infrastructure to support them). OpenCV is natively written in C++, look at the OpenCV about page, and you can quickly get a sense for these historical currents.


Only top voted, non community-wiki answers of a minimum length are eligible