Summary of Image frequency domain and filter

Source: Internet
Author: User
Tags abs to domain

The previous period of time to see a lot of concepts and knowledge, and found that because it is a quick pass through, so look at the confused, and then many places confuse the concept, especially about the image frequency domain part of the understanding (including image frequency domain filtering and so on), so the following summarizes this period of time to re-see "Digital Image Processing" (Electronic industry publishing house, MATLAB undergraduate Teaching edition) Chapter III re-harvesting the understanding of the frequency domain.

First, we want to clear the concept is the space domain and the frequency domain, we through the Imread function obtains the image (basically also is the image which we usually say), is in the spatial domain, namely uses the F (x, Y) to characterize a certain point the gray value (or is the monochrome image a certain point brightness) this form, is in the space domain.

So what is the frequency domain of the image? Understanding the concept of the frequency of the image, it is not difficult to understand the frequency domain. My personal understanding is so analogy, the image can be regarded as a special two-dimensional signal, and then a certain point of the gray level, in fact, the image signal this point of "amplitude", then according to the concept of signal, frequency is the speed of the signal change, so that the so-called frequency is the graph space on the gray scale transformation speed , or is called the gradient change of the image, where the gradient frequency is relatively large. This is the natural "boundary" in the image is relatively large. For example, if a picture does not change much (for example, a picture of a wall), then he has many low-frequency components in the frequency domain, and the high-frequency component is very small. And obviously if it's a chess board, his high-frequency composition is certainly much more than the picture of the wall just now.

Then from the image domain to the frequency domain, we use the function is the famous two-dimensional discrete Fourier transform:

Enables f (x, Y) to represent a digital image of the size of mxn pixels, where x=0,1,2 M-1, y=0,1,2 N-1, the two-dimensional discrete Fourier transform (DFT) of f (x, y) represented by F (u,v) is given by the following formula:


In the equation, U also belongs to 0 to m-1,v belonging to 0 to N-1. The frequency domain is a coordinate system consisting of u,v as a frequency variable, composed of f (u,v), which we often call a frequency rectangle, and it is obvious that the size of the frequency rectangle is the same as the size of the input image.

There are Fourier transforms, of course there are Fourier inverse Transformations (IDFT):


To mention here, according to the book, in the expression of the DFT, the 1/MN item is now in front of the transformation, and in some expressions like the above-mentioned in front of the reverse transformation, because MATLAB uses the latter, so the book formula is the type of the kind.

Several points can be seen from the above formula:

1. It is not difficult to see that F (0,0) is equal to the mn of the F (x, y) mean, as the resulting 0,0 in the Fourier transform formula is actually the sum of all f (x, y) in the image. So we often call F (0,0) the DC component of the Fourier transform.

2. We can clearly see that the value F (u,v) of a point in the frequency domain (U,V), he does not determine the value in the spatial domain (x, y), but is related to all points in the entire image space domain, so the value of a point (u,v) in the frequency domain, for example, F (5,5) It has nothing to do with this point F (5,5) on the spatial domain, but rather depends on the entire image.

The next book on the Fourier transform some of the properties, as well as Fourier spectrum, transformation of the definition of phase angle, power spectrum definition and so on, because the formula is too cumbersome, here is not more than the above, you can find out on the Internet formula definition and concepts.

Fourier transform properties inside the individual think the more important is the periodicity, because of the periodicity, so in the Fourier transform after the frequency map, the four corners of the low-frequency component (I am not very clear, but for example, low-frequency components), we will shift the low-frequency components to the central position, Because most of the low-frequency components of the image is actually more, so it will be relatively bright in the corner, put in the middle to better look.

Here is an example of a picture illustrating a frequency domain Fourier spectrum:

F=imread (' 3.jpg ');
Imshow (f);% show original f=fft2 (f);%
do Fourier transform
s=abs (f);% Fourier spectrum
 
figure,imshow (s,[]);% display Fourier spectrum


The left image is the original picture, the right is the frequency map, the frequency map shows how much the corresponding frequency, the above has been discussed, if from the right figure can be seen on the edge of the four points relatively bright, which shows that the original image of the low-frequency components, that is, the original image of the changes relatively few. In other words, if the original image is considered a terrain, it means that most of the terrain is very flat.

We can find out by formula (Euler formula e^ (2*pi*j) =1 and exponential calculation) that it is easy to see (the figure is stolen-):


The leftmost symbol on the upper-left indicates the Fourier transform. It is possible to place the origin of the frequency map in the center of the image after the above is known.

The Fftshift function is used in MATLAB.

The frequency spectrum after centering is shown as follows:


Can be seen more clearly, this time because in fact the range of frequency spectrum is very large, relative to the low-frequency component, high-frequency component value is relatively small, so you can use a logarithmic transform (log (1+abs (F)) to extend the high-frequency details, shown as follows:


The details are still prominent in the more obvious Kazakhstan.

The following talk about the understanding of filtering, do not know is not entirely correct.

Filter and operator are the basic operation of digital image processing, in which filtering refers to domain processing (median filtering, mean filtering) or in the image frequency domain (which requires Fourier transform) for processing (low-pass filtering, high-pass filtering, bandpass filtering) in the field of pixels (spatial domain). Operators generally refer to the convolution operator.

First, we talk about the filtering of the spatial domain. What do you call field processing? The domain deals with a series of operations on the domain:

(1) Select the center point (x, y);

(2) Perform operations only on pixels in a predefined point (x, Y) field;

(3) Making the result of the operation a response at that point;

(4) Repeat the processing for each point in the image.

A new field is generated in the center point movement, and each field corresponds to a pixel on the input image. The two main terms used to identify this process are domain processing and spatial filtering, where the latter is more general. If the calculation performed on a pixel in the domain is linear, the operation is called linear spatial filtering. (also in terms of space convolution); otherwise, it is called nonlinear spatial filtering.

The linear operation involves multiplying each pixel in the field by the corresponding factor, summing the result, and obtaining a response at the point (x, y). If the size of the field is MXN, a MN coefficient is required. These coefficients are arranged as a matrix, called a filter (template)/filter template/core/mask or window. Top three of them are among the most common. To become more obvious, it is also used in terms of convolution filter, convolution template, or convolution kernel.

Let's say what the convolution operator means:

Here to steal a picture of the Internet:


Then, as shown above, the matrix in the upper right corner of the picture is h=[2 9 4;

7 5 3;

6 1 8;]

is often mentioned in the back of the template, in the relevant books are generally also written w (x, y). If the value based on the product sum is substituted for the original (x, y) value, then this filter is called linear filter (for example, Laplace operator). The other is called nonlinear filtering.

The most common filter in spatial domain is median filter and mean filter, as the name implies, median filter is substituted by the median of the sort set of pixels contained in the image domain, and mean filter is filtered by the mean value of domain pixels. Median filtering also belongs to the statistical sorting filter.

Next, we introduce the frequency domain filter:

First, there is a theorem called convolution theorem:

f (x, Y) ★h (x, y) óh (u,v) f (u,v)

The above formula ★ represents the convolution, ó represents a Fourier transform pair.

The frequency domain filter is more than the Gaussian low-pass/Gaussian high-pass filter, and the spatial domain is slightly different, in the frequency domain is not the domain processing, but the function is modified:

G (u,v) = H (u,v) F (u,v)

function h (u,v) is also called filter transfer function, the idea of frequency domain filtering is to select a filter transfer function, which modifies F (u,v) in the way specified.

By convolution theorem, in the frequency domain let F (u,v) multiplied by the spatial filter Fourier transform H (u,v), and then do a Fourier inverse transformation, you can get the image filtered by the spatial domain filter (this is equivalent to using DFT in the way of convolution, in this way to do convolution is called cyclic convolution).

It is worth mentioning, note, as a cyclic convolution, because F and H are periodic functions, so g is also a periodic function, in the period close to the function is not 0 part of the continuous period of the periodic function of the convolution will cause the adjacent period of crosstalk (this crosstalk is called folding error), so to be avoided by the method of filling zeros. More difficult, or for example: a black white block picture, in the DfT convolution when we assume that the edge of processing, the result is because of the cycle of the upper edge is actually processed by the upper edge of the other block on the bottom edge of the white part of the effect (specific examples see the book P63 page), After 0, it will not be affected.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.