Complex image background extraction and texture enhancement method
By adaptively separating the background and texture of complex images through frequency domain analysis and a dual conditional masking mechanism, the problem of separating the background and texture in complex images is solved, achieving efficient and real-time background extraction and texture enhancement effects, which are suitable for industrial inspection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HARBIN INST OF TECH
- Filing Date
- 2026-04-02
- Publication Date
- 2026-06-19
AI Technical Summary
Existing technologies struggle to effectively separate complex and dense foreground textures from non-uniformly undulating backgrounds in complex images, making it difficult to detect real defects in the background area. Furthermore, deep learning models incur huge computational costs when processing ultra-high resolution industrial images, making it difficult to meet real-time and multi-scene generalization requirements.
A radial density adaptive optimization strategy based on frequency domain analysis and a dual conditional masking mechanism are adopted. Through Fourier transform, spectrum centering, feature enhancement, binarization processing and dual conditional masking, low-frequency background and high-frequency texture are adaptively separated to construct a clean and smooth background map and a high signal-to-noise ratio texture map.
It achieves effective separation of complex overlapping textures and non-uniform undulating backgrounds with low computing power consumption, outputting clear backgrounds and high signal-to-noise ratio texture maps to meet the real-time detection needs of industrial production lines.
Smart Images

Figure CN122244086A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for extracting backgrounds and enhancing textures in complex images, belonging to the field of computer vision and image processing. Background Technology
[0002] In fields such as computer vision and industrial nondestructive testing, there exists a class of images (e.g., composite materials, textiles) characterized by a high degree of overlap between complex, dense foreground textures and non-uniformly undulating backgrounds. A common technical challenge with these images lies in their severe bidirectional interference: dramatic low-frequency background undulations often obscure subtle texture details, while the densely overlapping textures create significant visual occlusion and high-frequency noise, greatly hindering the detection of real defects (such as bubbles, impurities, and cracks) within the background area. Current image separation techniques face significant bottlenecks in addressing this problem.
[0003] Traditional frequency domain or spatial domain filtering algorithms lack structure awareness and adaptive capabilities, and the one-size-fits-all processing can easily lead to texture breakage or background distortion. While the mainstream deep learning image segmentation models in recent years have end-to-end separation potential, they rely heavily on massive amounts of pixel-level finely labeled data, and the inference computing power overhead is huge when processing ultra-high resolution industrial images, making it difficult to meet the stringent requirements of industrial production lines for millisecond-level real-time performance and multi-scenario generalization. Summary of the Invention
[0004] To address the problems of background interference texture extraction and texture interference background detection, this invention provides a method for complex image background extraction and texture enhancement.
[0005] The present invention provides a method for complex image background extraction and texture enhancement, comprising:
[0006] The industrial digital X-ray image to be processed is acquired, and a two-dimensional fast Fourier transform and spectral centering are performed to obtain the original complex spectrum.
[0007] The obtained original complex spectrum is subjected to feature enhancement and binarization to obtain a binarized feature map;
[0008] Using the center of the original complex spectrum as the origin, the total number of pixels on each circle and the number of white points in the binarized feature map are counted outwards in radius. The ratio of the cumulative number of white points from the origin to the current radius to the cumulative total number of pixels is calculated. The maximum radius that makes the ratio reach the preset feature point ratio threshold is dynamically found and used as the low frequency cutoff radius.
[0009] Construct a dual conditional mask of the same size as the original complex spectrum: for any pixel in the spectrum, if its distance to the center is less than or equal to the low-frequency cutoff radius, or the gray value of the enhanced spectrum is less than the preset gray value retention limit, then the mask value is 1; otherwise, it is 0.
[0010] The original complex spectrum is multiplied by the dual conditional mask, and an inverse Fourier transform is performed to obtain a clean and smooth background image; the industrial digital ray image and the clean and smooth background image are then subjected to a difference operation to obtain a high signal-to-noise ratio texture image.
[0011] As a preferred method, the method of performing feature enhancement and binarization on the obtained original complex spectrum to obtain a binarized feature map includes:
[0012] The original complex spectrum is subjected to extremum suppression and linear stretching mapping. The linearly stretched spectrum is the gray value of the spectrum after feature enhancement.
[0013] The linearly stretched spectrum is binarized with a fixed threshold to obtain a binarized feature map.
[0014] As a preferred method, the original complex spectrum is subjected to extremum suppression and linear stretching mapping as follows:
[0015] Extracting the original complex spectrum The statistical characteristics are analyzed, sorted in ascending order, and the grayscale value at the 0.1% position is taken as the lowest value. The grayscale value at the 99.9% position is taken as the highest value. ;
[0016] Perform linear stretching to map it to :
[0017]
[0018] in, This represents the stretched spectral grayscale value.
[0019] As a preferred method, the method for binarizing the linearly stretched spectrum with a fixed threshold is as follows:
[0020] Assuming a fixed threshold of 91, if the grayscale value of the amplitude spectrum after stretching... Binarized feature map Otherwise .
[0021] As a preferred option, the preset feature point percentage threshold is 19.19%.
[0022] As a preferred option, the preset grayscale retention limit is 20 grayscale levels.
[0023] Preferably, the method for performing a difference operation between the industrial digital ray image and the clean, smooth background image to obtain a high signal-to-noise ratio texture image is as follows:
[0024]
[0025] in, For high signal-to-noise ratio texture images, For a clean and smooth background image, For industrial digital X-ray images.
[0026] The beneficial effects of this invention are that, by introducing a radial density adaptive optimization strategy based on frequency domain analysis and a dual conditional masking mechanism, it effectively balances the accuracy and processing efficiency of image decoupling, achieving efficient separation of complex overlapping textures and non-uniform undulating backgrounds with relatively low computational power consumption. To verify the practical effectiveness of the method, an application test was conducted using a complex scenario of "industrial tire X-ray images" as a typical case. The results show that the method can stably extract smooth background images and enhanced texture images, demonstrating practical potential to meet the real-time inspection needs of industrial production lines. Attached Figure Description
[0027] Figure 1 This is a flowchart illustrating the method described in this application;
[0028] Figure 2 The images show the results of logarithmic amplitude spectrum percentile stretching and binarization (threshold 91) feature extraction. (a) is the original logarithmic amplitude spectrum; (b) is the extracted image after percentage stretching and binarization.
[0029] Figure 3 This is a schematic diagram of dual-condition mask generation;
[0030] Figure 4 The original image is compared with the clean and smooth background image and high-frequency difference image of the decoupled output. Among them, (a) is the original image, (b) is the background image, and (c) is the difference image.
[0031] Figure 5 The results of texture extraction are compared between the original image and the decoupled high-frequency difference map. (a) shows the texture extraction result of the original image, and (b) shows the texture extraction result of the difference map. Detailed Implementation
[0032] 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. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0033] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other.
[0034] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, but this is not intended to limit the scope of the invention.
[0035] The complex image background extraction and texture enhancement method of this embodiment includes:
[0036] Step 1: Obtain the industrial digital X-ray image to be processed. This image has the dual characteristics of non-uniform undulating background and dense overlapping texture. Perform two-dimensional fast Fourier transform and spectral centering to obtain the original complex spectrum.
[0037] According to Fourier optics theory, the complex texture and background information of an image in the spatial domain are represented by the distribution of different frequency components in the frequency domain. Low-frequency components correspond to smooth backgrounds and slowly changing regions in the image, while high-frequency components correspond to texture details and edge information. By transforming the image from the spatial domain to the frequency domain through a two-dimensional Fourier transform, the coupling relationship between the background and texture can be decoupled into a separate distribution in the frequency domain.
[0038] The low-frequency components are then shifted to the center of the spectrum to obtain the original complex spectrum.
[0039] This step transforms the original industrial digital X-ray image to the frequency domain, obtaining the original complex spectrum, which fully preserves the amplitude and phase information of the spectrum.
[0040] Furthermore, the original complex spectrum can be further processed to calculate the logarithmic magnitude spectrum of each pixel:
[0041]
[0042] in, ( , ) and ( , ) represent the real and imaginary parts of the spectrum, respectively. ( , ) represents the logarithmic amplitude spectrum.
[0043] Logarithmic amplitude spectrum compresses spectral data with a large dynamic range to a grayscale range that is recognizable by the human eye, which facilitates subsequent feature extraction and statistical analysis.
[0044] Step 2: Perform feature enhancement and binarization on the obtained original complex spectrum or logarithmic amplitude spectrum to obtain a binarized feature map. Feature enhancement can be achieved by performing extremum suppression and linear stretching mapping on the obtained original complex spectrum or logarithmic amplitude spectrum. The linearly stretched spectrum is the grayscale value of the feature-enhanced spectrum. Specifically, extract the statistical characteristics of the original complex spectrum or logarithmic amplitude spectrum, sort them in ascending order, and take the value at the 0.1% position as the lowest value. Take the value at the 99.9% position as the highest value. Perform linear stretching to map it to... :
[0045]
[0046] in, and These are the gray values at the 0.1% and 99.9% positions after sorting the original complex spectrum or logarithmic amplitude spectrum, used for linear stretching; The stretched spectral grayscale values;
[0047] Binarization can be performed by applying a fixed threshold to the linearly stretched spectrum to obtain a binarized feature map. The fixed threshold is set to 91. The binarized feature map is based on a fixed threshold; if Binary graph Otherwise This step effectively extracts the highlight pixels that represent the frequencies of complex textures.
[0048] In the frequency domain, densely overlapping textures correspond to a series of high-frequency feature points, which appear as locally bright areas in the spectrum. However, the original complex spectrum contains a large number of redundant intermediate gray values, making direct binarization difficult to effectively separate the true texture feature points. By suppressing extrema (removing the lowest 0.1% and the highest 0.99%), interference from anomalous noise and extreme bright noise is eliminated. Then, linear stretching expands the effective gray range to the full gray space of 0-255, significantly amplifying the gray-level differences of the texture feature points. This step enhances and binarizes the bright areas representing texture features in the original complex spectrum or logarithmic amplitude spectrum, generating a binarized feature map. This feature map retains only the most representative texture frequencies, eliminating non-featured spectral regions, providing a clean statistical basis for subsequent radial density optimization.
[0049] Step 3: Taking the center of the original complex spectrum as the origin, count the total number of pixels on each circumference outwards radius by radius and the number of white points in the binarized feature map. Calculate the ratio of the cumulative number of white points to the cumulative total number of pixels from the origin to the current radius. Dynamically find the maximum radius that makes the ratio reach a preset feature point proportion threshold, and use this as the low-frequency cutoff radius; specifically,
[0050] With the spectrum center Using the origin as the reference point, calculate the Euclidean distance from each pixel to the center. Count the total number of pixels on each circle, radius by radius. With the number of white spots Then, the maximum radius that makes the ratio satisfy a specific threshold is found. :
[0051]
[0052] in, The coordinates of the spectrum center The Euclidean distance from the pixel to the center of the spectrum is rounded to the nearest integer. Distance The total number of pixels on the circumference. Distance in a binary graph The number of white dots on the circumference; The maximum cutoff radius when the ratio reaches the threshold of 19.19%.
[0053] In the frequency domain, low-frequency background components are typically concentrated near the center of the spectrum, while high-frequency texture components are distributed in the peripheral regions far from the center. The degree of background undulation and texture density varies across different images, and their frequency boundary points also exhibit dynamic changes. By statistically analyzing the density distribution of binarized feature points on the circumference of each radius, the inflection point where texture feature points transition from sparse to dense can be automatically identified. The radius corresponding to this inflection point is the optimal boundary between low-frequency background and high-frequency texture. The low-frequency cutoff radius adaptively defines the boundary between the low-frequency background region that should be retained and the texture region that needs to be preserved.
[0054] Step 4: Construct a dual conditional mask of the same size as the original complex spectrum: For any pixel in the spectrum, if its distance to the center is less than or equal to the low-frequency cutoff radius, or the gray value of the logarithmic amplitude spectrum after feature enhancement is less than the preset gray value retention limit, then the mask value is 1; otherwise, it is 0.
[0055] Specifically, this step introduces a dual conditional union of spatial and grayscale conditions. For coordinates in the spectrum... The distance is The pixel, its dual conditional mask value The judgment rules are as follows:
[0056] Condition 1 (Low-frequency protection): ;
[0057] Condition 2 (Background band protection in dark areas): ;
[0058] When any of the above conditions are met ,otherwise .
[0059] in, This represents the distance from the pixel to the center of the spectrum.
[0060] Traditional frequency domain filtering, based solely on frequency radius truncation, is prone to two problems: first, some texture features near the center are mistakenly filtered out; second, some background noise far from the center is mistakenly retained. This step innovatively introduces a union of two conditions: "spatial radius + upper limit of grayscale." Condition one retains low-frequency background regions; condition two retains dark frequency bands with lower amplitude spectrum grayscale values. Both types of regions correspond to background information in the frequency domain, but condition two can capture weak background components located in the high-frequency region that cannot be covered by the radius condition. This union design of the two conditions ensures that background information is completely preserved while effectively filtering out interference from dense textures.
[0061] Step 5: Combine the original complex spectrum with the dual conditional mask. Multiply the images and perform an inverse Fourier transform (IFFT) to obtain a clean and smooth background image. The industrial digital X-ray image With the clean and smooth background image Perform a difference operation to obtain a high signal-to-noise ratio texture image. :
[0062]
[0063] The constant 128 is used to shift the difference result to a suitable grayscale range.
[0064] Finally, a clean background image for detecting defects such as bubbles is output simultaneously, along with a high signal-to-noise ratio texture image for skeleton tracking.
[0065] This application discloses a method for complex image background extraction and texture enhancement, used to simultaneously separate low-frequency background and high-frequency texture in images with complex overlapping textures and undulating backgrounds. This method is applicable to whole-image processing of various complex images, and can also be used for local region processing, without the need for pre-defining the region of interest. First, the image undergoes a Fourier transform, and the spectrum is processed with logarithmic amplitude and dynamic thresholding. The cumulative density of spectral feature points along the radial direction is statistically analyzed to adaptively determine the boundary radius between the background and texture. Then, a mask is constructed based on spatial distance and spectral grayscale conditions to preserve low-frequency background and weak texture. Finally, a smooth background is reconstructed using the mask, and the enhanced texture image is obtained through difference. This method can simultaneously output a clean, smooth background image for material defect detection and a high signal-to-noise ratio texture image for internal skeleton extraction, achieving fast dual-path separation of background and texture. It is highly versatile and suitable for real-time operation on ordinary CPUs.
[0066] This application possesses strong bidirectional decoupling capabilities: traditional background filtering algorithms can only acquire high-pass features, while this application employs an innovative "spatial radius + grayscale upper limit" union dual mask mechanism (i.e., conditional masking). or This achieves decoupling between the material background and overlapping textures. It outputs both a high-resolution, clean background for detecting "bubbles and impurities" and a smooth, high-frequency difference map for extracting the "texture skeleton".
[0067] This application features high data adaptability (no need for hard-coded cutoff frequency): it abandons the traditional practice of manually setting a fixed cutoff frequency. It utilizes statistical analysis of the extreme values after percentile stretching and the radial cumulative white point percentage. This dynamic density optimization strategy allows the algorithm to automatically adjust the filtering radius according to the thickness and texture complexity of the image content, resulting in high robustness.
[0068] This application features high processing power and low computational cost: Based on Fast Fourier Transform (FFT) and spatial integration statistics in a single traversal, the algorithm's time complexity is O(n log n). (in (Total number of pixels after zero-padding), space complexity is O(n). Actual testing shows that, under mainstream consumer-grade processors (taking the Intel Core i7-13650HX as an example), this method can quickly process local regions of interest and efficiently handle ultra-high resolution global images. Specific test data shows that for... For local images of this size, single-frame core decoupling takes only about 7.4 milliseconds; for and For ultra-large resolution global images, the core processing time per frame is only about 142 milliseconds and 450 milliseconds, respectively. These test data fully verify the strong adaptability and extremely high execution efficiency of the proposed method on multi-scale images, which can effectively meet the real-time detection needs of large-scale, high-cycle industrial production lines.
[0069] While the invention has been described herein with reference to specific embodiments, it should be understood that these embodiments are merely examples of the principles and applications of the invention. Therefore, it should be understood that many modifications can be made to the exemplary embodiments, and other arrangements can be designed without departing from the spirit and scope of the invention as defined by the appended claims. It should be understood that different dependent claims and features described herein can be combined in ways different from those described in the original claims. It is also understood that features described in conjunction with individual embodiments can be used in other described embodiments.
Claims
1. A method for extracting backgrounds and enhancing textures in complex images, characterized in that, include: The industrial digital X-ray image to be processed is acquired, and a two-dimensional fast Fourier transform and spectral centering are performed to obtain the original complex spectrum. The obtained original complex spectrum is subjected to feature enhancement and binarization to obtain a binarized feature map; Using the center of the original complex spectrum as the origin, the total number of pixels on each circle and the number of white points in the binarized feature map are counted outwards in radius. The ratio of the cumulative number of white points from the origin to the current radius to the cumulative total number of pixels is calculated. The maximum radius that makes the ratio reach the preset feature point ratio threshold is dynamically found and used as the low frequency cutoff radius. Construct a dual conditional mask of the same size as the original complex spectrum: for any pixel in the spectrum, if its distance to the center is less than or equal to the low-frequency cutoff radius, or the gray value of the enhanced spectrum is less than the preset gray value retention limit, then the mask value is 1; otherwise, it is 0. The original complex spectrum is multiplied by the dual conditional mask, and an inverse Fourier transform is performed to obtain a clean and smooth background image; the industrial digital ray image and the clean and smooth background image are then subjected to a difference operation to obtain a high signal-to-noise ratio texture image.
2. The method for complex image background extraction and texture enhancement according to claim 1, characterized in that, Methods for performing feature enhancement and binarization on the obtained original complex spectrum to obtain a binarized feature map include: The original complex spectrum is subjected to extremum suppression and linear stretching mapping. The linearly stretched spectrum is the gray value of the spectrum after feature enhancement. The linearly stretched spectrum is binarized with a fixed threshold to obtain a binarized feature map.
3. The method for complex image background extraction and texture enhancement according to claim 2, characterized in that, The method for performing extremum suppression and linear stretching mapping on the obtained original complex spectrum is as follows: Extracting the original complex spectrum The statistical characteristics are analyzed, sorted in ascending order, and the grayscale value at the 0.1% position is taken as the lowest value. The grayscale value at the 99.9% position is taken as the highest value. ; Perform linear stretching to map it to : in, This represents the stretched spectral grayscale value.
4. The method for complex image background extraction and texture enhancement according to claim 3, characterized in that, The method for binarizing the linearly stretched spectrum with a fixed threshold is as follows: Assuming a fixed threshold of 91, if the grayscale value of the amplitude spectrum after stretching... Binarized feature map Otherwise .
5. The method for complex image background extraction and texture enhancement according to claim 1, characterized in that, The preset feature point percentage threshold is 19.19%.
6. The method for complex image background extraction and texture enhancement according to claim 1, characterized in that, The preset grayscale retention limit is 20 grayscale levels.
7. The method for complex image background extraction and texture enhancement according to claim 1, characterized in that, The method for obtaining a high signal-to-noise ratio texture image by performing a difference operation between the industrial digital ray image and the clean, smooth background image is as follows: in, For high signal-to-noise ratio texture images, For a clean and smooth background image, For industrial digital X-ray images.
8. A computer-readable storage device storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the complex image background extraction and texture enhancement method as described in any one of claims 1 to 7.
9. A complex image background extraction and texture enhancement apparatus, comprising a storage device, a processor, and a computer program stored in the storage device and executable on the processor, characterized in that, The processor executes the computer program to implement the steps of the complex image background extraction and texture enhancement method as described in any one of claims 1 to 7.
10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the complex image background extraction and texture enhancement method as described in any one of claims 1 to 7.