Otwarty dostęp

Image design and interaction technology based on Fourier inverse transform


Zacytuj

Background
Definition 1

Fourier transform (FT) is a very complicated analysis theory, but it plays an important role in image design and interactive technology. Especially for the discrete Fourier transform (DFT), since the image is a two-dimensional discrete data matrix based on the grey level (RGB), the implementation of FT on it belongs to the DFT. First, the image data is defined as x = 0, 1, ..., M − 1; y = 0, 1, ..., N − 1; then its DFT can be defined as F(u,v)=1MNx=0M1y=0N1f(x,y)exp[i2π(uxM+vyN)] F\left( {u,v} \right) = {1 \over {MN}}\sum\limits_{x = 0}^{M - 1} \sum\limits_{y = 0}^{N - 1} f\left( {x,y} \right)\exp \left[ { - i2\pi \left( {{{ux} \over M} + {{vy} \over N}} \right)} \right]

Proof

One of them, one of the formulas u = 0, 1,..., M − 1;v = 0, 1,...,N − 1

The corresponding inverse transformation is: f(x,y)=1MNx=0M1y=0N1F(u,v)exp[i2π(uxM+vyN)] f\left( {x,y} \right) = {1 \over {MN}}\sum\limits_{x = 0}^{M - 1} \sum\limits_{y = 0}^{N - 1} F\left( {u,v} \right)\exp \left[ { - i2\pi \left( {{{ux} \over M} + {{vy} \over N}} \right)} \right] One of them, one of the formulas x = 0, 1,...,M − 1, y = 0, 1,...,N − 1

Definition 2

During image processing, it is common to select square data, i.e. M = N. The amplitude spectrum or Fourier spectrum of the image f (x, y) is: |F(u,v)|=R2(u,v)+I2(u,v) \left| {F\left( {u,v} \right)} \right| = \sqrt {{R^2}\left( {u,v} \right) + {I^2}\left( {u,v} \right)} The phase spectrum is: ϕ(u,v)=arctg[I(u,v)/R(u,v)] \phi \left( {u,v} \right) = arctg\left[ {I\left( {u,v} \right)/R\left( {u,v} \right)} \right] The energy spectrum is: E(u,v)=F(u,v)|2=R2(u,v)+I2(u,v) E\left( {u,v} \right) = F\left( {u,v} \right)\left| {^2} \right. = {R^2}\left( {u,v} \right) + {I^2}\left( {u,v} \right)

Proof

In the case of a fast Fourier transform (FFT), the advantage of separability is that the two-dimensional FT or the inverse FT is implemented using two continuous one-dimensional FTs. For an image f (x, y), the one-dimensional FT can be calculated for each column, and then the one-dimensional transform can be performed for each row:

The forward transformation is: F(u,v)=1NNx=0N1y=0N1f(x,y)exp[i2π(ux+vyN)]=1Nx=0N1f(x,y)exp[i2π(uxN)]×1Ny=0N1f(x,y)exp[i2π(vyN)] \matrix{ {F\left( {u,v} \right) = {1 \over {NN}}\sum\limits_{x = 0}^{N - 1} \sum\limits_{y = 0}^{N - 1} f\left( {x,y} \right)\exp \left[ { - i2\pi \left( {{{ux + vy} \over N}} \right)} \right] = } \hfill \cr {{1 \over N}\sum\limits_{x = 0}^{N - 1} f\left( {x,y} \right)\exp \left[ { - i2\pi \left( {{{ux} \over N}} \right)} \right] \times {1 \over N}\sum\limits_{y = 0}^{N - 1} f\left( {x,y} \right)\exp \left[ { - i2\pi \left( {{{vy} \over N}} \right)} \right]} \hfill \cr }

Theorem 1

The inverse transformation is: F(u,v)=1NNu=0N1v=0N1f(u,v)exp[i2π(ux+vyN)]=1Nu=0N1f(u,v)exp[i2π(uxN)]×1Nv=0N1f(u,v)exp[i2π(vyN)] \matrix{ {F\left( {u,v} \right) = {1 \over {NN}}\sum\limits_{u = 0}^{N - 1} \sum\limits_{v = 0}^{N - 1} f\left( {u,v} \right)\exp \left[ {i2\pi \left( {{{ux + vy} \over N}} \right)} \right] = } \hfill \cr {{1 \over N}\sum\limits_{u = 0}^{N - 1} f\left( {u,v} \right)\exp \left[ {i2\pi \left( {{{ux} \over N}} \right)} \right] \times {1 \over N}\sum\limits_{v = 0}^{N - 1} f\left( {u,v} \right)\exp \left[ {i2\pi \left( {{{vy} \over N}} \right)} \right]} \hfill \cr }

Proposition 2

Because of the separability of the two-dimensional FT, only the one-dimensional FFT is analysed, where the forward transform is [1]: F(u)=1Nx=0N1f(x)exp[i2πuxN] F\left( u \right) = {1 \over N}\sum\limits_{x = 0}^{N - 1} f\left( x \right)\exp \left[ {{{ - i2\pi ux} \over N}} \right] The inverse transformation is: f(x)=1Nu=0N1F(u)exp[i2πuxN] f\left( x \right) = {1 \over N}\sum\limits_{u = 0}^{N - 1} F\left( u \right)\exp \left[ {{{i2\pi ux} \over N}} \right]

Lemma 3

Since the running time of the computer will be affected by the number of multiplications, the one-dimensional discrete will undergo a FT from the spatial domain to the frequency domain according to the above formula, in which case all N of the N values of F (u) will undergo N operations, and the relationship between time and N2 is directly proportional [2, 3].

In the mid-1960s, Kuri Tuckey proposed an algorithm to reduce the operation to the order of Nlog 2N. In other words, N can be decomposed into the product of a large number of small integers. Therefore, when N is a power of 2 and P is an integer, the actual operation is the most efficient; moreover, the actual operation is also easier to implement. The actual operation is given by the FFT.

Corollary 4

Since both u and v have 0,1 . . ., N−1, N possible value ranges, so f (x, y) contains N2 frequency components, and when (x, y) obtains all possible values, that is, in the case of x = 0, 1,...,N − 1;y = 0,1,...,N −1, a basic image corresponding to the special value (u, v) can be obtained, as shown below: fu,v=1N2{exp[j2π(0u+0vN)]exp[j2π(0u+1vN)]...exp[j2π(0u+(N1)vN)]exp[j2π(1u+0vN)]exp[j2π(1u+1vN)]...exp[j2π(1u+(N1)vN)]exp[j2π((N1)u+0vN)]exp[j2π((N1)u+1vN)]...exp[j2π((N1)u+(N1)vN)] {f_{u,v}} = {1 \over {{N^2}}}\left\{ {\matrix{ {\exp \left[ {j2\pi \left( {{{0u + 0v} \over N}} \right)} \right]\exp \left[ {j2\pi \left( {{{0u + 1v} \over N}} \right)} \right]...\exp \left[ {j2\pi \left( {{{0u + \left( {N - 1} \right)v} \over N}} \right)} \right]} \hfill \cr {ex\mathop p\limits_{ \bullet \matrix{ {} \cr { \bullet \matrix{ {} \cr \bullet \cr } } \cr } } \left[ {j2\pi \left( {{{1u + 0v} \over N}} \right)} \right]ex\mathop {p\left[ {j2\pi \left( {{{1u + 1v} \over N}} \right)} \right]...}\limits_{ \bullet \matrix{ {} \cr { \bullet \matrix{ {} \cr \bullet \cr } } \cr } } ex\mathop {p\left[ {j2\pi \left( {{{1u + \left( {N - 1} \right)v} \over N}} \right)} \right]}\limits_{ \bullet \matrix{ {} \cr { \bullet \matrix{ {} \cr \bullet \cr } } \cr } } } \hfill \cr {\exp \left[ {j2\pi \left( {{{\left( {N - 1} \right)u + 0v} \over N}} \right)} \right]\exp \left[ {j2\pi \left( {{{\left( {N - 1} \right)u + 1v} \over N}} \right)} \right]...\exp \left[ {j2\pi \left( {{{\left( {N - 1} \right)u + \left( {N - 1} \right)v} \over N}} \right)} \right]} \hfill \cr } } \right.

Conjecture 5

It can be seen that the average grey value of an image can be calculated by using the value of the DFT at the origin position:

First, we discuss symmetries about M/2, N/2. Assuming that F (x, y) is an image with a size of M × N, then according to the periodic formula analysis of the DFT, we can get: F(u,v)=F(u+mM,v+nN)|F(u,v)|=|F(u+M,v+N)| \matrix{ {F\left( {u,v} \right) = F\left( {u + mM,v + nN} \right)} \hfill \cr {\left| {F\left( {u,v} \right)} \right| = \left| {F\left( {u + M,v + N} \right)} \right|} \hfill \cr } At the same time, combined with the DFT of the conjugate symmetry formula analysis: |F(u,v)|=|F(u,v)| \left| {F\left( {u,v} \right)} \right| = \left| {F\left( { - u, - v} \right)} \right| Then we can get: |F(u,v)|=|F(Mu,Nv)| \left| {F\left( {u,v} \right)} \right| = \left| {F\left( {M - u,N - v} \right)} \right|

Example 6

Then, under the condition of u=0, if n=0, then we can get: |F (0,0)| = |F (M,N)|

If v = 1, then we can get: |F (0,1)| = |F (M,N − 1)|

If v = 2, then we can get: |F (0,2)| = |F (M,N − 2)|

When v = N/2, we can get:|F (0,N/2)| = |F (M,N/2)|

Similarly, under the condition of v = 0, if u = 0, then we can get: |F(0,0)| = |F(M,N)|

If u = 1, then we can get: |F (1,0)| = |F (M − 1,N)|

If u = 2, then we can get: |F (2,0)| = |F (M − 2,N)|

When u = M/2, we can get: |F (M/2,0)| = |F (M/2,N)|

Note 7

Combined with the analysis of the above two situations, the results as shown in Figures 1 and 2 below can be obtained:

In Figures 1 and 2, Block A, Block D, and Block B, Block C represent symmetric results of coordinates (M/2, N/2). Thus it can be proved that the relationship between periodicity and conjugate symmetry conforms to the following formula: F(u,v)=F(u+mM,v+Nn)F(u,v)=F(u,v) F\left( {u,v} \right) = F\left( {u + mM,v + Nn} \right)F\left( {u,v} \right) = F\left( { - u, - v} \right) At the same time, we can get: F(u+mN,v+nN)=1NNx=0N1y=0N1f(x,y)exp[i2π((u+mN)x+(v+nN)yN)]=1NNx=0N1y=0N1f(x,y)exp[i2π(ux+vyN)]exp[i2π(mx+ny)] \matrix{ {F\left( {u + mN,v + nN} \right) = {1 \over {NN}}\sum\limits_{x = 0}^{N - 1} \sum\limits_{y = 0}^{N - 1} f\left( {x,y} \right) \bullet } \hfill \cr {\exp \left[ { - i2\pi \left( {{{\left( {u + mN} \right)x + \left( {v + nN} \right)y} \over N}} \right)} \right]} \hfill \cr { = {1 \over {NN}}\sum\limits_{x = 0}^{N - 1} \sum\limits_{y = 0}^{N - 1} f\left( {x,y} \right) \bullet } \hfill \cr {\exp \left[ { - i2\pi \left( {{{ux + vy} \over N}} \right)} \right] \bullet } \hfill \cr {\exp \left[ { - i2\pi \left( {mx + ny} \right)} \right]} \hfill \cr } Where, since exp[−i2π (mx + ny)] represents the unit value, we can get: f(x,y)(1)(x+y)F(uM/2,vN/2) f\left( {x,y} \right) \cdot {\left( { - 1} \right)^{\left( {x + y} \right)}} \Leftrightarrow F\left( {u - M/2,v - N/2} \right)

Fig. 1

Symmetry at u = 0

Fig. 2

Symmetry at v = 0

Fast algorithm of image Fourier transform

For digital images, the amount of data they have is very large, so it is a big project to compress them scientifically in a limited time. At this time, it is not realistic to directly use the DFT algorithm to implement image signal processing. It was not until the early 1960s, when the rapid algorithm of DFT appeared, that the change occurred.

FFT algorithm

Open Problem 8. Since the multiple multiplication times of the n-point DFT represent N, the n-point DFT can be divided into several DFTs that are too short, so that the multiplication times can be continuously decreased. Meanwhile, the rotation factor WMN has strong periodicity and symmetry, which can be specifically reflected as follows: WNm+N=ej2π(m+lN)=ejN2πm=WNm W_N^{m + N} = {e^{ - j2\pi \left( {m + lN} \right)}} = {e^{ - j_N^{2\pi }m}} = W_N^m WNm=WNNm W_N^{ - m} = W_N^{N - m} or [WNNm]*=WNm {\left[ {W_N^{N - m}} \right]^*} = W_N^m or WNm+N2=WNm W_N^{m + {N \over 2}} = - W_N^m

From the perspective of practical application, FFT algorithm is to always divide long sequence DFT into several short sequence DFT, and combine the periodicity and symmetry of the above rotation factor WMN for effective control, so as to reduce the calculation steps of DFT.

There are many common algorithms based on this algorithm, such as based on the time domain extraction of FFT algorithm, prime factor algorithm etc. Taking as the basis 2-FFT algorithm extracted according to the time domain as an example, this algorithm is analysed according to the order of odd and even numbers in the time domain. All the DFT operations of the sequence of N = 2m point can be decomposed M times, and finally can be decomposed into the combination of 2-point DFT operations, so as to reduce unnecessary operation steps [5,6,7].

Assuming that the length of the sequence x (n) is n and that n = 2m (m represents a natural number), then the decomposition steps are as follows:

The first step is to divide x (n) into two sub-sequences of n/2 points according to the odd and even of n. The specific formula is as follows: x1(r)=x(2r),r=0,1,...,N21andx2(r)=x(2r+1),r=0,1,...,N21 {x_1}\left( r \right) = x\left( {2r} \right),r = 0,1,...,{N \over 2} - 1and{x_2}\left( r \right) = x\left( {2r + 1} \right),r = 0,1,...,{N \over 2} - 1 So the DFT of x (n) can be viewed as X(k)=r=0N/21x1(r)WN2kr+WNkr=0N/21x2(r)WN2kr X\left( k \right) = \sum\limits_{r = 0}^{N/2 - 1} {x_1}\left( r \right)W_N^{2kr} + W_N^k\sum\limits_{r = 0}^{N/2 - 1} {x_2}\left( r \right)W_N^{2kr} Because of WN2kr=ej2πN2kr=WN/2kr W_N^{2kr} = {e^{ - j{{2\pi } \over N}2kr}} = W_{N/2}^{kr} therefore X(k)=r=0N/21x1(r)WN2kr+WNkr=0N/21x2(r)WN2kr=X1(k)+WNkX2(k),k=0,1,...,N1 X\left( k \right) = \sum\limits_{r = 0}^{N/2 - 1} {x_1}\left( r \right)W_N^{2kr} + W_N^k\sum\limits_{r = 0}^{N/2 - 1} {x_2}\left( r \right)W_N^{2kr} = {X_1}\left( k \right) + W_N^k{X_2}\left( k \right),k = 0,1,...,N - 1 Where X1 (k) and X2 (k) respectively represent the N/2 point DFT of X1 (r) and X2 (r); and since the periods of X1 (k) and X2 (k) are both N/2 and meet this condition, X (k) can also be expressed as: X(k)=X1(k)+WNkX2(k)k=0,1,...,N/21X(k+N/4)=X1(k)WNkX2(k),k=0,1,...,N/21 \matrix{ {X\left( k \right) = {X_1}\left( k \right) + W_N^k{X_2}\left( k \right)k = 0,1,...,N/2 - 1} \hfill \cr {X\left( {k + N/4} \right) = {X_1}\left( k \right) - W_N^k{X_2}\left( k \right),k = 0,1,...,N/2 - 1} \hfill \cr } At this point, the DFT of N points can be divided into two DFTs of N/2 points and calculated according to the above formula.

The second step is the same as the above decomposition step. Let X1 (R) be divided into two N/4 subsequences according to the order of odd and even, which are: x3(l)=x1(2l),l=0,1,...,N41 {x_3}\left( l \right) = {x_1}\left( {2l} \right),l = 0,1,...,{N \over 4} - 1 x4(l)=x1(2l),l=0,1,...,N41 {x_4}\left( l \right) = {x_1}\left( {2l} \right),l = 0,1,...,{N \over 4} - 1 Then combining with the first result analysis, we can get: X1(k)=X3(k)+WN/2kX4(k),k=0,1,...,N/41X1(k+N/4)=X3(k)WN/2kX4(k),k=0,1,...,N/41 \matrix{ {{X_1}\left( k \right) = {X_3}\left( k \right) + W_{N/2}^k{X_4}\left( k \right),k = 0,1,...,N/4 - 1} \hfill \cr {{X_1}\left( {k + N/4} \right) = {X_3}\left( k \right) - W_{N/2}^k{X_4}\left( k \right),k = 0,1,...,N/4 - 1} \hfill \cr } Meanwhile, the following calculation can be made:

After the above two-step decomposition, the N/2 DFT can be divided into two N/4 DFTs.

Improved algorithm

The improved algorithm is to integrate the WFTA algorithm and the base 2-FFT algorithm together, and promote the former to replace part of the base 2-FFT algorithm. The specific steps are as follows: First, since the decomposition process of the base 2-FFT algorithm includes log 2N steps, the partition according to log 2n-4 steps of the base 2-FFT algorithm includes N/16 DFTs of 16 lengths. Second, since in the basis 2-FFT algorithm, DFTs obtained by all iterations are independent between each group, WFTA algorithm can be used to analyse DFTs with length of 16. Since the process of calculation and the algorithm idea are inverse to each other, the WFTA algorithm can be combined to complete the calculation first, then the calculation combination can be carried out according to the basis 2-FFT algorithm and finally the DFT of length N can be obtained. This operation procedure is not only simple and effective but also can fully demonstrate the advantages of WFTA algorithm in multiplication calculation. The specific flow chart is shown in Figure 3, and the butterfly diagram at N = 32 is shown in Figure 4.

Fig. 3

Flow chart of the improved algorithm

Fig. 4

Improved butterfly graph of N = 32

Research and analysis of inverse DFT of image based on MATLAB

MATLAB is a powerful engineering design and system simulation software system proposed by Math Works Company. It not only has strong data calculation and analysis ability but also can solve complex problems in a short time. Therefore, in order to make better use of inverse FT image design and interactive technology to complete the operation, this paper chooses MATLAB software to carry out image analysis, and then to clarify the problems related to image compression. Nowadays, image files that can be processed based on MATLAB include JPEG, TIFF and BMP formats.

The actual programming steps are as follows: First, init1 installs the image driver software into the system and lets the screen adapter adjust to the graphic form, which is also called the initialisation of the graphic. Second, the make-original-data 1 number-setting programme to obtain the relevant two-dimensional array, and then implement the FT. Third, DO-2D-DFT 1 implements the two-dimensional DFT, and uses the drawing software to present the calculation results to the screen. Fourth, DO-2D-IDFT 1 implements the inverse two-dimensional DFT, and uses the drawing software to present the calculation results to the screen. Fifth, in the subroutine of filer 1, the appropriate spatial spectrum can be selected for filtering, filtering the unimportant spectral lines, saving the effective spectral lines and then displaying the important parts and removing the secondary factors, so as to complete the spatial spectrum processing [8].

After the above operations, the spatial spectrum filtering purpose has been basically completed, and the function of Fourier change also involves the following points: First, preservation. Combined with the image analysis after filtering, it can be seen that the Fourier forward transform can divide the image into a group of orthogonal normalised images that continue to decline, and the original data can still be completely recovered by increasing the compression ratio of the image without excessive distortion. When encoding an image in another, more compact way, the FT and inverse transform are important to ensure that data is not lost. Second, filtering. After the completion of the FT, assuming that the transformation domain is scientifically selected before the inverse transformation, then the filtering processing operation can be completed. Third, enhance. Can make an image is transform into size, direction and position are different weight, so before the inverse transformation to adjust some domain coefficient of amplitude, targeted to improve the component of interest, and do not need to ignore things, or is it design a transfer function according to actual demand, after get a transfer function, in the transform domain spectrum multiplied by the transfer function, Then the inverse FT is used to complete the operation. It should be noted that in this process, the effectiveness of the transfer function must be guaranteed. Fourth, recovery. When image degradation processing is carried out for the target, it should be restored to the ideal image without degradation. However, dogs may degenerate in every link during the imaging period, so it is necessary to recover part of the lost image according to the differences in application conditions. For example, when dealing with image stains, the correlation of information can be used in combination with Fourier convolution to complete the operation.

Result analysis

Combined with the process outlined above, FT and inverse transform are used to complete image design and interactive processing, and the final result can be obtained as shown in Figure 5 below:

Fig. 5

Implementing the result

For image processing, FT and inverse transform are widely used, including edge detection, image enhancement and compression etc. From the practical point of view, the core idea of this technology is to use FT and inverse transform to transform the spatial domain into the frequency domain, so that a variety of operations can be carried out for the frequency domain, and finally the expected image processing results can be achieved. In the image enhancement and removal process, if the image frequency spectrum is directly divided into high and low frequency components, then the high frequency can be represented as the abrupt region of the image, namely the edge information, while the low frequency component is represented as the gentle region of the image, namely the contour information. In the enhancement and desiccating process, different forms of transfer function H (u, v) are used to carry out convolution operation on the frequency function F (u, v), so as to get a new frequency function G (u, v). In the new frequency function, the saved frequency signal can be enhanced to clean up the excess frequency signal, that is, the noise in the image. The new frequency function G (u, v) can use inverse FT to obtain the updated frequency function G (u, v), which can also further enhance and erase the image. In this process, the transfer function H (u, v) is selected correctly and divided into high-pass, low-pass and band-stop filters according to the functional differences. But in many cases, the noise signals themselves merge with the edge information. However, in the edge detection, its principle is similar to the image enhancement, and the spectral image has high frequency component, which needs to be effectively processed. Only in this way can the edge detection requirements be met.

In feature extraction, image features are divided into shape, space and colour. Take colour as an example. As a global feature representing the surface features of the image, colour contains all the pixels inside the image region, but it can intuitively show the size, direction and other contents, and cannot obtain the local features in the image. The common extraction methods include colour set method, colour moment method and correlation graph method. In the image compression processing, the compression coding theory is used to re-encode and transmit the frequency space, which can further achieve the image compression effect. Combined with the analysis of the above research results, the coding in the frequency domain is simpler than that in the spatial domain because the image correlation continues to decline.

Conclusion

To sum up, the FT and inverse transform provide a new research idea for the current methodology of computer image processing, which can not only realise the image design quickly but also complete the interactive technology. The image in the spatial domain can be regarded as the superposition projection of sinusoidal curves that have no correlation with each other in most frequency domains, and the desired image information can be presented intuitively with the constant change of the actual amplitude value. In this process, both image design and interactive processing are to filter and rectify the frequency domain, so as to obtain valuable image information. In the new era, the innovative application of all interactive technologies will bring new changes to image design, and with the deepening of actual changes, it will certainly have a greater impact on social development in the future. Combined with the above analysis of the application of FT and inverse transform, it is found that while breaking through the limitations of traditional image design concepts, it also further optimises the computer thinking mode. This can not only further complete the image design and interaction design but also make the computer system run on this basis to meet the needs of practical development.

eISSN:
2444-8656
Język:
Angielski
Częstotliwość wydawania:
Volume Open
Dziedziny czasopisma:
Life Sciences, other, Mathematics, Applied Mathematics, General Mathematics, Physics