开发者

Frequency vs spatial domain filtering

开发者 https://www.devze.com 2023-03-14 16:00 出处:网络
I applied a Gaussian low pass filter on an image using MATLAB for different standard deviations and record开发者_如何学JAVAed the time each method takes. I saw that implementing the filter in the freq

I applied a Gaussian low pass filter on an image using MATLAB for different standard deviations and record开发者_如何学JAVAed the time each method takes. I saw that implementing the filter in the frequency domain is much more efficient (faster). Does anyone has an explanation for this?


Assuming that you use imfilter, this function performs a convolution of the original image with the kernel (the gaussian filter image).

For going into the frequency domain and back, fast fourier transform (FFT) algorithms are used, and only an image multiplication is performed in the frequency domain.

imfilter will therefore take about N.M operations, being N and M the number of pixels in the image and kernel respectively.

Each of FFT or its inverse have complexity N log_2 N, and the multiplication has complexity N, for a total complexity of approximately N log_2 N, which is much faster than the convolution.

0

精彩评论

暂无评论...
验证码 换一张
取 消