Image enhancement method based on fourier algorithm space phase angle extraction and application
Patent Information
- Application Number
- CN202310528118.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-11
- Publication Date
- 2026-09-29
- Estimated Expiration
- 2043-05-11
AI Technical Summary
[0039](1)该图像增强方法主要使用了傅里叶算法、理想低通滤波器、调制滤波器和空域相角提取算法,能够将任意数字图像处理成类似一阶微分/梯度运算后的效果,能够显著增强图像的边界信息,通过滤波参数的选择,还能针对性增强图像不同尺度的特征;
Smart Images

Figure CN116563158B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of two-dimensional digital image processing methods, specifically to an image enhancement method and its application based on spatial phase angle extraction using the Fourier algorithm. Background Technology
[0002] The Fourier transform is an orthogonal transform that decomposes a time-domain signal into a superposition of sinusoidal signals or cosine functions of different frequencies. It has been widely used in one-dimensional signal processing. The Fourier transform, combined with various types of filters, is a common method in digital image processing, giving rise to a wealth of image restoration and image enhancement algorithms.
[0003] After Fourier transform, a digital image that is a real number in the spatial domain becomes a two-dimensional complex matrix with an imaginary part. After performing various operations on the complex matrix in the frequency domain, the two-dimensional matrix obtained by the inverse Fourier transform back to the spatial domain is usually also a complex matrix. Most existing algorithms currently perform modulo operations or extract the real part of the two-dimensional matrix after the inverse Fourier transform, ignoring the phase angle or imaginary part, thus degenerating the two-dimensional complex matrix into a two-dimensional real matrix, facilitating image display.
[0004] In general theory, a real matrix remains a real matrix after undergoing both Fourier transform and inverse Fourier transform. Therefore, current conventional processing methods do not use phase angle operations, but usually use modulo or real part methods to directly degenerate the complex matrix after Fast Fourier Transform into a real matrix. Summary of the Invention
[0005] The technical problem this invention aims to solve is that current real-number matrices remain real-number matrices after undergoing Fourier transform and inverse Fourier transform. Conventional processing methods do not use phase angle extraction but instead typically use modulo or real part extraction to directly degenerate complex matrices after Fast Fourier Transform into real-number matrices. Images processed by this method often suffer from unclear boundary information. The purpose is to provide an image enhancement method and application based on spatial phase angle extraction using the Fourier algorithm. This method can process any digital image to achieve an effect similar to that after first-order differentiation / gradient operations, solving the problem of unclear boundary information in images obtained by current processing methods, which makes it difficult to apply to fields with high image information requirements, such as medical imaging, defect feature recognition, military applications, and human-computer interaction.
[0006] This invention is achieved through the following technical solution:
[0007] An image enhancement method based on spatial phase angle extraction using the Fourier algorithm includes:
[0008] Represent any two-dimensional digital image as a two-dimensional matrix;
[0009] The frequency domain form of the image is obtained using the two-dimensional discrete Fourier transform;
[0010] Filter the image in the frequency domain;
[0011] The filtered frequency domain image is then transformed back to the spatial domain using a two-dimensional inverse Fourier transform.
[0012] The image enhancement is completed by taking the phase angle in the spatial domain, adjusting the grayscale range, and outputting the image result.
[0013] This image enhancement method primarily utilizes the Fourier algorithm, an ideal low-pass filter, a modulation filter, and a spatial phase angle extraction algorithm. It can process any digital image to achieve an effect similar to that after first-order differentiation / gradient operations, significantly enhancing the image's boundary information. Furthermore, by selecting appropriate filter parameters, it can specifically enhance features at different scales. In actual testing with various filter parameters, the upper frequency limit of the low-pass filter showed a strong correlation with the extracted image feature scale; generally speaking, the lower the low-pass filter frequency, the larger the extracted image feature scale.
[0014] This image enhancement method is simple and fast to operate, and produces high-quality images. It can not only improve the dynamic range of images, but also be integrated with subsequent image recognition algorithms. It can be widely used in digital image-related technical fields such as medical imaging, defect feature recognition, military, and human-computer interaction. Therefore, this image enhancement method can make great contributions in many fields and has high practical value.
[0015] Furthermore, the filters used to filter images in the frequency domain include modulation filters or a combination of ideal low-pass filters and modulation filters; the ideal low-pass filter refers to a filter that does not process low-frequency components and sets high-frequency components to zero.
[0016] Furthermore, the width of the ideal low-pass filter is related to the size of the feature to be extracted or enhanced; specifically, the larger the size, the smaller the width of the ideal low-pass filter.
[0017] Furthermore, the ideal low-pass filter can have different widths in the two dimensions of the two-dimensional matrix; the ideal low-pass filter is symmetric about the zero point.
[0018] Furthermore, the types of modulation filters include Hann window, Hamming window, Blackman window, and Kaiser window.
[0019] The type of modulation filter can be selected based on the characteristics of the object of interest in the image.
[0020] Furthermore, the modulation filter is a Hann window function, which filters the image, as expressed by the formula:
[0021]
[0022]
[0023] Hann(u,v) = w(u) × w(v) T
[0024] in, To obtain the frequency domain form of an image using the two-dimensional discrete Fourier transform, it can be expressed by the following formula:
[0025]
[0026] Where w(u) is a one-dimensional Hann filter function, which generates a two-dimensional Hann window function Hann(u,v) through vector cross product;
[0027] Where fft2 represents the cutoff frequencies of the ideal low-pass filter and the modulation filter, respectively.
[0028] Furthermore, the phase angle in the spatial domain can be expressed by the formula:
[0029] I Enhanced =Arg[I filtered (m,n)]
[0030] Among them I filtered (m,n) refers to the filtered frequency domain image. Two-dimensional inverse Fourier transform back to the spatial domain yields I. filtered (m,n) can be expressed by the formula:
[0031]
[0032] Among them, ifft2 is the two-dimensional discrete fast inverse Fourier algorithm.
[0033] The phase angle extraction used needs to be highly accurate because the processed phase angle values are close to the residuals, which are generally small. Practical tests show that the phase angle extraction functions built into Python and Matlab can meet the requirements.
[0034] Furthermore, adjusting the grayscale means adjusting the grayscale range of the phase angle image to the range of the image display, such as 0-255; the grayscale histogram presents a symmetrical or Gaussian distribution.
[0035] The above-mentioned image enhancement method based on the spatial phase angle extraction of the Fourier algorithm has applications in digital image-related fields. Specifically, these include medical imaging, defect feature recognition, military applications, and human-computer interaction.
[0036] A computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the above-described method steps.
[0037] The aforementioned computer-readable storage media include, but are not limited to, disk storage, CD-ROM, optical storage, ROM / RAM, magnetic disk, optical disk, etc.
[0038] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0039] (1) This image enhancement method mainly uses Fourier algorithm, ideal low-pass filter, modulation filter and spatial phase angle extraction algorithm. It can process any digital image into an effect similar to the first-order differential / gradient operation, which can significantly enhance the boundary information of the image. By selecting the filtering parameters, it can also specifically enhance the features of the image at different scales.
[0040] (2) The image enhancement method is simple and fast to operate and has high image quality. It can not only improve the dynamic range of the image and facilitate the direct interpretation of the image, but also connect with subsequent image recognition algorithms. It can be widely used in the field of digital image-related technologies such as medical imaging, defect feature recognition, military and human-computer interaction. Attached Figure Description
[0041] To more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention and should not be considered as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort. In the drawings:
[0042] Figure 1 This is a flowchart of an image enhancement method based on spatial phase angle extraction using the Fourier algorithm, as described in this invention.
[0043] Figure 2 These are comparison images of a landscape photograph before and after processing in Embodiment 1 of the present invention, where (a) is the image before processing; and (b) is the image after processing.
[0044] Figure 3 These are comparison images of a landscape photograph before and after processing in Embodiment 2 of the present invention, where (a) is the image before processing; and (b) is the image after processing.
[0045] Figure 4 These are comparison images of the landscape photos before and after processing in Embodiment 3 of the present invention, where (a) is the image before processing; and (b) is the image after processing.
[0046] Figure 5These are comparison images of chicken wings before and after X-ray projection imaging processing in Example 4 of this invention, where (a) is the image before processing and (b) is the image after processing.
[0047] Figure 6 This is a comparison diagram of Example 5 of the present invention before and after processing, where (a) is the diagram before processing; and (b) is the diagram after processing.
[0048] Figure 7 The above are comparison images of Example 6 of the present invention before and after processing, where (a) is the image before processing; and (b) is the image after processing.
[0049] Figure 8 The above are comparison images of Example 7 of the present invention before and after processing, where (a) is the image before processing; and (b) is the image after processing.
[0050] Figure 9 These are comparison images of the remote sensing image before and after processing in Embodiment 8 of the present invention, where (a) is the image before processing and (b) is the image after processing. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0052] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0053] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0054] Example 1
[0055] Reference Figure 1 and Figure 2 This embodiment provides an image enhancement method based on the spatial phase angle extraction of the Fourier algorithm, which processes a landscape photograph, specifically as follows:
[0056] Step 1: Represent the image as a two-dimensional matrix, i.e., I(m,n);
[0057] Step 2: Use the two-dimensional discrete Fourier transform to obtain the frequency domain form of image I(m,n). Expressed as a formula:
[0058]
[0059] Step 3: Perform two filtering operations on the image in the frequency domain: ideal low-pass filtering (one-dimensional composite low-pass filter) and low-pass window function filtering (Hann window function), expressed by the formula:
[0060]
[0061] in,
[0062]
[0063] Hann(u,v) = w(u) × w(v) T ;
[0064] Among them, f u f v Let f be the cutoff frequency of the low-pass filter, and w(u) be a one-dimensional Hann filter function. A two-dimensional Hann window function, Hann(u,v), is generated through vector cross product. The filter cutoff frequency, window function type, and window function width all need to be adjusted according to image features and application requirements. The cutoff frequency f of the low-pass filter is... u f v The width of the Hann window function, and all three values are taken to be the same. In this embodiment, the cutoff frequency f of the low-pass filter is... u f v The width of the Hann window function is set to 1 times the highest frequency in that dimension (equivalent to no low-pass filtering).
[0065] Step 4: Filter the frequency domain image Two-dimensional inverse Fourier transform back to the spatial domain yields I. filtered (m,n) can be expressed by the formula:
[0066]
[0067] Step 5: For I filtered By taking the phase angle (m,n) and adjusting the grayscale range, image enhancement can be achieved, which can be expressed by the formula:
[0068] I Enhanced =Arg[I filtered (m,n)];
[0069] The specific methods for adjusting the grayscale range are scaling, stretching, or transformation. When the grayscale histogram presents a symmetrical, Gaussian-like distribution, the image quality is better.
[0070] Example 2
[0071] Reference Figure 1 and Figure 3 This embodiment provides an image enhancement method based on spatial phase angle extraction using the Fourier algorithm. The method processes a landscape photograph, identical to the one in Embodiment 1, but differs in the processing method used in this embodiment in that the cutoff frequency f of the low-pass filter is... u f v The width of the Hann window function is set to half the highest frequency of that dimension.
[0072] Example 3
[0073] Reference Figure 1 and Figure 4 This embodiment provides an image enhancement method based on spatial phase angle extraction using the Fourier algorithm. The method processes a landscape photograph, identical to the one in Embodiment 1, but differs in the processing method used in this embodiment in that the cutoff frequency f of the low-pass filter is... u f v The width of the Hann window function is set to 1 / 4 of the highest frequency in that dimension.
[0074] from Figures 2 to 4 The image display results show that this image enhancement method can process digital images to achieve an effect similar to that after first-order differentiation / gradient operations, significantly enhancing the boundary information of the image. By selecting the filtering parameters, it can also specifically enhance features at different scales. Moreover, this image enhancement method is simple and fast to operate, producing high-quality images. It not only facilitates direct image interpretation but also allows for integration with subsequent image recognition algorithms. Furthermore, from the processing methods and processed images obtained in Examples 1 to 3, it is evident that the upper frequency limit of the low-pass filter is strongly correlated with the extracted image feature scale. Generally speaking, the lower the low-pass filter frequency, the larger the extracted image feature scale.
[0075] Example 4
[0076] Reference Figure 1 and Figure 5 This embodiment provides an image enhancement method based on the spatial phase angle extraction of the Fourier algorithm, which processes an X-ray DR image of a chicken wing, specifically as follows:
[0077] Step 1: Represent the image as a two-dimensional matrix, i.e., I(m,n);
[0078] Step 2: Use the two-dimensional discrete Fourier transform to obtain the frequency domain form of image I(m,n). Expressed as a formula:
[0079]
[0080] Step 3: Perform two filtering operations on the image in the frequency domain: ideal low-pass filtering (one-dimensional composite low-pass filter) and low-pass window function filtering (Hann window function), expressed by the formula:
[0081]
[0082] in,
[0083]
[0084] Hann(u,v) = w(u) × w(v) T ;
[0085] Among them, f u f v Let w(u) be the cutoff frequency of the low-pass filter, and w(u) be the one-dimensional Hann filter function. A two-dimensional Hann window function, Hann(u,v), is generated through vector cross product. The filter cutoff frequency, window function type, and window function width all need to be adjusted according to image features and application requirements. The cutoff frequency of the low-pass filter is taken as the highest frequency of the shorter side.
[0086] Step 4: Filter the frequency domain image Two-dimensional inverse Fourier transform back to the spatial domain yields I. filtered (m,n) can be expressed by the formula:
[0087]
[0088] Step 5: For I filtered By taking the phase angle (m,n) and adjusting the grayscale range, image enhancement can be achieved, which can be expressed by the formula:
[0089] I Enhanced =Arg[I filtered (m,n)];
[0090] The specific methods for adjusting the grayscale range are scaling, stretching, or transformation. When the grayscale histogram presents a symmetrical, Gaussian-like distribution, the image quality is better.
[0091] Example 5
[0092] Reference Figure 1 and Figure 6 This embodiment provides an image enhancement method based on the spatial phase angle extraction of the Fourier algorithm. It processes a photo of chicken wings, the same as the photo in Embodiment 4, but differs in the processing method of step 3. Step 3 in this embodiment is as follows:
[0093] The image is filtered twice in the frequency domain: an ideal low-pass filter (one-dimensional composite low-pass filter) and a low-pass window function filter (Hanning window function), which can be expressed by the following formula:
[0094]
[0095] in,
[0096]
[0097] Hanning(u,v) = w(u) × w(v) T ;
[0098] Among them, f u f v Let w(u) be the cutoff frequency of the low-pass filter, and w(u) be the one-dimensional Hanning filter function. A two-dimensional Hanning window function, Hanning(u,v), is generated through vector cross product. The filter cutoff frequency, window function type, and window function width all need to be adjusted according to image features and application requirements. The cutoff frequency of the low-pass filter is the highest frequency of the shorter side.
[0099] Example 6
[0100] Reference Figure 1 and Figure 7 This embodiment provides an image enhancement method based on the spatial phase angle extraction of the Fourier algorithm. It processes a photo of chicken wings, the same as the photo in Embodiment 4, but differs in the processing method of step 3. Step 3 in this embodiment is as follows:
[0101] The image is filtered twice in the frequency domain: an ideal low-pass filter (one-dimensional composite low-pass filter) and a low-pass window function filter (Blackman window function), which can be expressed by the following formula:
[0102]
[0103] in,
[0104]
[0105] Blackman(u,v) = w(u) × w(v) T ;
[0106] Among them, f u f vLet w(u) be the cutoff frequency of the low-pass filter, and w(u) be the one-dimensional Blackman filter function. A two-dimensional Blackman window function, Blackman(u,v), is generated through vector cross product. The filter cutoff frequency, window function type, and window function width all need to be adjusted according to image features and application requirements. The cutoff frequency of the low-pass filter is the highest frequency of the shorter side.
[0107] Example 7
[0108] Reference Figure 1 and Figure 8 This embodiment provides an image enhancement method based on the spatial phase angle extraction of the Fourier algorithm. It processes a photo of chicken wings, which is the same as the photo in embodiment 4. The difference between the processing method in embodiment 4 and the processing method in step 3 is that the flat response / equivalent does not have a window function in step 3 of this embodiment.
[0109] from Figures 5 to 8 The image display results show that this image enhancement method can process digital images to achieve an effect similar to that after first-order differentiation / gradient operations, significantly enhancing the boundary information of the image. By selecting the filtering parameters, it can also specifically enhance features at different scales. Moreover, this image enhancement method is simple and fast to operate, producing high-quality images. It not only facilitates direct image interpretation but also allows for seamless integration with subsequent image recognition algorithms. Furthermore, the processing methods and processed images from Examples 4 to 7 demonstrate that the Hann window function, the Hanning window function, and the Blackman window function all achieve excellent enhancement results.
[0110] Example 8
[0111] Reference Figure 1 and Figure 9 This embodiment provides an image enhancement method based on the spatial phase angle extraction of the Fourier algorithm, which processes images from remote sensing test data, specifically as follows:
[0112] Step 1: Represent the image as a two-dimensional matrix, i.e., I(m,n);
[0113] Step 2: Use the two-dimensional discrete Fourier transform to obtain the frequency domain form of image I(m,n). Expressed as a formula:
[0114]
[0115] Step 3: Perform two filtering operations on the image in the frequency domain: ideal low-pass filtering (one-dimensional composite low-pass filter) and low-pass window function filtering (Hann window function), expressed by the formula:
[0116]
[0117] in,
[0118]
[0119] Hann(u,v) = w(u) × w(v) T ;
[0120] Among them, f u f v Let w(u) be the cutoff frequency of the low-pass filter, and w(u) be the one-dimensional Hann filter function. A two-dimensional Hann window function, Hann(u,v), is generated through vector cross product. The filter cutoff frequency, window function type, and window function width all need to be adjusted according to image features and application requirements. The cutoff frequency of the low-pass filter is taken as the highest frequency of the shorter side.
[0121] Step 4: Filter the frequency domain image Two-dimensional inverse Fourier transform back to the spatial domain yields I. filtered (m,n) can be expressed by the formula:
[0122]
[0123] Step 5: For I filtered By taking the phase angle (m,n) and adjusting the grayscale range, image enhancement can be achieved, which can be expressed by the formula:
[0124] I Enhanced =Arg[I filtered (m,n)];
[0125] The specific methods for adjusting the grayscale range are scaling, stretching, or transformation. When the grayscale histogram presents a symmetrical, Gaussian-like distribution, the image quality is better.
[0126] from Figure 9 As can be seen from the displayed structure, this image enhancement method can still achieve a good enhancement effect on images that are originally derived from remote sensing test data.
[0127] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. An image enhancement method based on spatial phase angle extraction using the Fourier algorithm, characterized in that, include: Represent any two-dimensional digital image as a two-dimensional matrix; The frequency domain form of the image is obtained using the two-dimensional discrete Fourier transform; The image is filtered in the frequency domain; the filters used include modulation filters or a combination of ideal low-pass filters and modulation filters; the ideal low-pass filter is a filter that does not process low-frequency components and sets high-frequency components to zero. The filtered frequency domain image is then transformed back to the spatial domain using a two-dimensional inverse Fourier transform. The image enhancement is completed by taking the phase angle in the spatial domain, adjusting the grayscale range, and outputting the image result.
2. The image enhancement method based on spatial phase angle extraction using the Fourier algorithm according to claim 1, characterized in that, The width of the ideal low-pass filter is related to the size of the feature to be extracted or enhanced; specifically, the larger the size, the smaller the width of the ideal low-pass filter.
3. The image enhancement method based on spatial phase angle extraction using the Fourier algorithm according to claim 1, characterized in that, The ideal low-pass filter has different widths in two dimensions of the two-dimensional matrix; the ideal low-pass filter is symmetric about the zero point.
4. The image enhancement method based on spatial phase angle extraction using the Fourier algorithm according to claim 1, characterized in that, The types of modulation filters include Hann window, Hamming window, Blackman window, and Kaiser window.
5. The image enhancement method based on spatial phase angle extraction using the Fourier algorithm according to claim 4, characterized in that, The modulation filter is a Hann window function, used to filter the image, as expressed by the formula: ; ; ; in, To obtain the frequency domain form of an image using the two-dimensional discrete Fourier transform, it can be expressed by the following formula: ; in, The one-dimensional Hann filter function is used to generate a two-dimensional Hann window function through vector cross product. ; in, It is a two-dimensional discrete fast Fourier transform algorithm; in, , These are the cutoff frequencies of the ideal low-pass filter and the modulation filter, respectively. Where m and n represent two-dimensional discrete coordinates in the spatial domain; in, This is a discrete function representation of the image in the frequency domain.
6. The image enhancement method based on spatial phase angle extraction using the Fourier algorithm according to claim 1, characterized in that, The phase angle in the spatial domain can be expressed by the formula: ; in Refers to the filtered frequency domain image Two-dimensional inverse Fourier transform back to the spatial domain yields: This can be expressed as a formula: ; Among them, Two-dimensional discrete fast inverse Fourier algorithm.
7. The image enhancement method based on spatial phase angle extraction using the Fourier algorithm according to claim 1, characterized in that, Adjusting the grayscale means adjusting the grayscale range of the phase angle image to match the range of the image display; the grayscale histogram presents a symmetrical or Gaussian-like distribution.
8. The image enhancement method according to any one of claims 1 to 7, characterized in that, The method includes applications in the field of digital image processing.
9. A computer-readable storage medium, characterized in that, The system contains a computer program that, when executed by a processor, causes the processor to perform the enhanced method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Method for enhancing images based on multi-scale edge detection in wavelet reconstruction
CN101661616A
Image reinforcement method based on frequency domain
CN102592263A