Image processing method and device for removing background of microscopic image, and electronic equipment
By combining guided filtering and frequency-domain Gaussian filtering, the problems of artifacts and loss of high-frequency information in the background removal of fluorescence microscopy images are solved, thereby improving the fidelity and clarity of image details. This method is applicable to various rolling sphere background estimation methods.
Patent Information
- Application Number
- CN202511530921.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-24
- Publication Date
- 2026-03-03
AI Technical Summary
Existing methods for removing backgrounds from fluorescence microscopy images suffer from problems such as residual details in the background image, unstable image quality, and insufficient recovery of high-frequency information. In particular, artifacts are prone to appear at structural edges or in areas with strong brightness gradients, affecting the usability and visual quality of the image.
Guided filtering is used to optimize the background image and Gaussian filtering in the frequency domain is introduced to separate high and low frequency information in the image. The high frequency structure is restored by weighted edge-guided masking and combined with rolling ball algorithm for background image calculation and image fusion, thereby improving the background removal effect and visual quality.
It effectively suppresses abnormal structure interference in background estimation, improves the detail fidelity after background removal, restores the edge structure loss caused by background subtraction, enhances image clarity, and is compatible with various rolling ball background estimation schemes.
Smart Images

Figure CN121600274A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to an image processing method, apparatus and electronic device for background removal of microscopic images. Background Technology
[0002] In the field of fluorescence microscopy image processing, background removal is a crucial technique. Currently, the rolling sphere algorithm is commonly used to estimate and remove the fluorescence background. The original rolling sphere algorithm uses a fixed radius for global background fitting, suitable for images with uniform background intensity; while the improved adaptive radius rolling sphere algorithm determines the local radius based on image features, improving its adaptability to complex backgrounds. However, the existing technology still has the following drawbacks:
[0003] First, residual details exist in the background image. Especially at structural edges or in areas with strong brightness gradients, the background image may contain partial target outlines, textures, or intensity fluctuations, leading to artifacts in the image after background removal. These artifacts interfere with subsequent image analysis and reduce the image's usability.
[0004] Secondly, image quality is unstable after background removal. Directly subtracting the background image can easily result in weakened image details or reduced sharpness of target edges, leading to poor visual quality. This makes it difficult for the processed image to meet the needs of professional analysis in terms of detail representation and overall visual effect.
[0005] Finally, existing technologies lack mechanisms for high-frequency information recovery. Background removal often weakens useful high-frequency information (such as edges and textures) in an image, and current methods largely ignore this issue, failing to design post-processing to restore structural features. This results in significant deficiencies in the preservation and recovery of high-frequency information in the processed image, affecting image sharpness and structural integrity.
[0006] Application content
[0007] This application proposes an image background removal optimization method based on the rolling ball algorithm, aiming to solve the aforementioned problems in the prior art. Addressing the issue of poor background image quality in both the original rolling ball algorithm (fixed radius) and the improved rolling ball algorithm (adaptive radius), this method employs guided filtering to optimize the background image and introduces frequency-domain Gaussian filtering to separate high- and low-frequency information in the image. It then uses edge-guided masking to weightedly recover the high-frequency structure, significantly improving the background removal effect and visual quality. The specific technical solution and features of this application are as follows:
[0008] This application proposes an image processing method, apparatus, and electronic device for background removal in microscopic images, comprising five parts: image preprocessing, background image calculation, guided filtering to optimize the background image, high-frequency detail enhancement, and image fusion and result output.
[0009] 1. Image preprocessing: Normalize or standardize the input image to ensure numerical stability and filter compatibility in subsequent processing.
[0010] 2. Background Image Calculation: The rolling ball background estimation algorithm is used to model the background of the input image. The rolling ball algorithm can be a fixed radius method or an adaptive radius method based on image gradients and structural features. The original background image obtained in this step can effectively describe the low-frequency background changes in the image.
[0011] 3. Guided Filtering Optimization of Background Image: Using the input image as the guide image, guided filtering is applied to the background image obtained in the second step to output a smooth background image. This filter preserves the main structure of the image while suppressing local edges and abnormal textures in the background image, thereby enhancing the accuracy of background modeling. The value Q(i) of the guided filter output image at pixel i is defined as:
[0012] Q(i) = a(i)G(i) + b(i)
[0013] Where a(i) and b(i) are local regression coefficients:
[0014]
[0015] b(i) = μ B -a(i)μ G
[0016] μ G and μ B , respectively, are the mean values of the guide graph G and the background graph B within the window; var(G) is the variance of the guide graph within the window; ∈ is the regularization term used to control the degree of smoothing.
[0017] 4. Enhanced high-frequency details:
[0018] S1. Frequency Domain High-Low Frequency Separation: Using a frequency domain Gaussian filter to separate the original image into low-frequency and high-frequency components helps to highlight the true structural information of the image for subsequent enhancement. Perform a Fast Fourier Transform on the input image to obtain the spectrum, then multiply by a Gaussian low-pass filter to obtain the low-frequency image.
[0019] L(u,v)=I(u,v)·H(u,v)
[0020] Where I(u,v) is the frequency domain representation of the image, and H(u,v) is a Gaussian low-pass filter with bandwidth parameter σ. Performing the inverse transform yields the low-frequency image:
[0021] I L =F -1 (L(u,v))
[0022] The high-frequency image is:
[0023] I H =II L
[0024] S2. Edge Guiding Map Construction: Perform Sobel gradient operation on the input image to obtain an edge intensity map. Normalize the image and use the original image as the guiding map for guided filtering to obtain an edge guiding map, which is used for adaptive weighting of high-frequency content. The Sobel gradient operation is as follows:
[0025]
[0026] The edge intensity map is as follows:
[0027]
[0028] The normalized edge map is used as a guide map for guided filtering, and the output edge guide map is used for subsequent high-frequency information fusion.
[0029] 5. Image Fusion and Output: Subtract the filtered background image obtained in step 3 from the input image to obtain the background-removed image. If the enhancement process in step 4 is enabled, the high-frequency components obtained in step 4 are further weighted and superimposed onto the background-removed image according to the edge guide map to enhance image details and structure perception. The final output is the background-removed image and the corresponding background image. The formula for calculating the background-removed image is:
[0030] I bg_removed =IB filtered
[0031] If high-frequency enhancement is enabled, the fused image will be:
[0032] I final =I bg_rempved +w·I H ·E
[0033] Where w is the fusion weight, and its value range is w∈[0,1]; E is the edge guidance graph.
[0034] The final output is:
[0035] (1) Remove the background image;
[0036] (2) Background image.
[0037] In summary, compared with the existing methods mentioned in the background art, the method of this application introduces multiple filtering and fusion strategies based on the existing rolling ball background estimation framework. The specific beneficial effects achieved by this application are as follows:
[0038] 1. Suppressing abnormal structure interference in background estimation: This method uses guided filtering to smooth the initial background image, which can effectively preserve the general structure of the image while suppressing noise and misembedding of details, improving the purity of background image estimation, and preventing the target structure from being classified as background.
[0039] 2. Improve the detail fidelity after background removal: High and low frequency separation of the image is achieved through frequency domain Gaussian filtering, and the high frequency components are fused and compensated by a weighted mask guided by edge features, which effectively restores the edge structure loss caused by background subtraction and enhances image clarity.
[0040] 3. Compatible with multiple rolling ball background estimation schemes: This application does not limit the generation method of the background image and can be adapted to various background estimation methods such as fixed radius rolling ball and adaptive radius rolling ball. It is only used as an enhancement module and does not require modification of the original background removal main frame, thus having good versatility. Attached Figure Description
[0041] Figure 1 This is a flowchart illustrating the overall process of the image background removal method described in this application.
[0042] Figure 2 This is a flowchart of the high-frequency detail enhancement module processing in this application. Detailed Implementation
[0043] The term "embodiment" used herein, as an example, is not necessarily to be construed as superior to or better than other embodiments. Performance testing in the embodiments of this application, unless otherwise specified, employs conventional testing methods in the art. It should be understood that the terminology used in this application is merely for describing particular implementations and is not intended to limit the scope of this disclosure.
[0044] Unless otherwise stated, the technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; other experimental methods and technical means not specifically mentioned herein refer to experimental methods and technical means commonly used by one of ordinary skill in the art.
[0045] To better illustrate the content of this application, numerous specific details are provided in the following detailed embodiments. Those skilled in the art should understand that this application can be implemented even without certain specific details. In the embodiments, some methods, means, instruments, and devices well-known to those skilled in the art are not described in detail in order to highlight the main points of this application.
[0046] The specific embodiments of this application are described below to enable those skilled in the art to understand this application. However, it should be understood that this application is not limited to the scope of the specific embodiments. For those skilled in the art, as long as the various changes are within the spirit and scope of this application as defined and determined by the appended claims, these changes are obvious. All applications that utilize the concept of this application are protected.
[0047] Example
[0048] Please see Figure 1 and Figure 2 The flowchart illustrates the image processing method, apparatus, and electronic device for background removal in microscopic images proposed in this application. Two embodiments are provided below, and the specific implementation details of the technical solution in actual production are as follows:
[0049] Example 1
[0050] 1. Image preprocessing: The input fluorescence microscopy image is normalized to adjust the pixel values to the range of [0, 65535] to ensure numerical stability in subsequent processing.
[0051] 2. Background Image Calculation: A fixed-radius rolling ball algorithm is used to model the background of the input image. The rolling ball radius is set to 15 pixels, and it rolls along the image scanning direction, recording the local minimum value of each pixel as the background value. This step yields the initial background image.
[0052] 3. Guided Filtering Optimization of Background Image: The original input image is used as the guide image, and guided filtering is applied to the initial background image. The filter window size is set to 9×9 pixels, and the regularization term ∈ = 0.01. The local regression coefficients a(i) and b(i) within each window are calculated, and the guided filtering formula is applied to obtain a smooth background image.
[0053] 4. Image Fusion and Output: Subtract the optimized background image from the original input image to obtain the background-removed image. Output the background-removed image and the original background image.
[0054] Example 2
[0055] 1. Image preprocessing: Standardize the input image to convert pixel values into a zero-mean, unit-variance distribution to improve filter compatibility.
[0056] 2. Background Image Calculation: The background image is calculated using an adaptive radius rolling ball algorithm based on image gradient and structural features. The rolling ball radius is adaptively adjusted according to the image gradient magnitude and local structural features.
[0057] 3. Optimize the background image by guided filtering: The background image is optimized using the same guided filtering steps as in Example 1.
[0058] 4. Enhanced high-frequency details:
[0059] S1. Frequency Domain High and Low Frequency Separation: Perform a Fast Fourier Transform on the input image to obtain the spectrum. Apply a Gaussian low-pass filter with a bandwidth of 1.177 to obtain the low-frequency image. Perform an Inverse Fourier Transform to obtain the low-frequency image, and calculate the high-frequency image as the difference between the original image and the low-frequency image.
[0060] S2. Edge Guiding Map Construction: Perform Sobel gradient operation on the input image to obtain the edge intensity map. Normalize the edge map and use the original image as the guiding map for guided filtering to obtain the edge guiding map.
[0061] 5. Image Fusion and Result Output: The background-removed image is fused with the enhanced high-frequency components. A fusion weight w = 0.5 is set, and the high-frequency components are weighted and superimposed onto the background-removed image according to the edge guide map to obtain the final processing result. The background-removed image and the background image are output.
[0062] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
[0063] The technical solutions and technical details disclosed in the embodiments of this application are merely illustrative of the application concept and do not constitute a limitation on the technical solutions of this application. Any conventional changes, substitutions or combinations made to the technical details disclosed in the embodiments of this application have the same application concept as this application and are within the protection scope of the claims of this application.
Claims
1. A method for removing background from microscopic images, characterized in that, Includes the following steps: S1. Preprocess the input image; S2. Calculate the background image using the rolling ball algorithm; S3. Optimize the background image using guided filtering; S4. Subtract the optimized background image from the input image to obtain the background-free image; S5, Output the background image and the background image.
2. The method according to claim 1, characterized in that, The preprocessing includes normalization or standardization to ensure numerical stability and filter compatibility in subsequent processing.
3. The method according to claim 1, characterized in that, The rolling ball algorithm is an adaptive radius rolling ball algorithm based on image gradient and structural features.
4. The method according to claim 1, characterized in that, The guided filtering uses the input image as a guide image to smooth the background image and suppress local edges and abnormal textures in the background image.
5. The method according to claim 1, characterized in that, It also includes high-frequency detail enhancement steps, specifically including: S1. Use a frequency domain Gaussian filter to separate the original image into low-frequency and high-frequency components; S2. Construct the edge guidance graph; S3. The high-frequency components are weighted and superimposed onto the background-removed image according to the edge guide map to enhance the image details and structural perception.
6. The method according to claim 5, characterized in that, The bandwidth of the frequency domain Gaussian filter is adjustable to control the frequency response.
7. The method according to claim 5, characterized in that, The edge guidance map is obtained by using Sobel gradient operation to obtain the edge intensity map, and then normalizing and guiding filtering are performed.
8. A microscopic image background removal device, characterized in that, include: (1) Preprocessing module, used to preprocess the input image; (2) Background calculation module, used to calculate the background image using the rolling ball algorithm; (3) Filtering optimization module, used to perform guided filtering optimization on the background image; (4) Image fusion module, used to subtract the optimized background image from the input image to obtain the background-free image; (5) Output module, used to output background image and background image.
9. The apparatus according to claim 8, characterized in that, It also includes a high-frequency enhancement module for performing high-frequency detail enhancement steps, including frequency domain high- and low-frequency separation, edge guide map construction, and image fusion.
10. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program that, when executed by the processor, implements the method as described in any one of claims 1 to 7.