Shadow removal method based on two-dimensional signed distance field
Through the shadow elimination method based on the two-dimensional symbol distance field, combined with fast Fourier transform and generative adversarial network technology, the problems of limited local information perception ability and boundary artifacts in shadow image processing in the prior art are solved, and high-quality shadow removal effect is achieved.
Patent Information
- Application Number
- CN202411904895.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-12-23
AI Technical Summary
The prior art has limited local information perception capabilities and boundary artifacts in shadow image processing, making it difficult to effectively remove shadows in complex lighting environments and uneven shadow boundaries.
The shadow elimination method based on the two-dimensional symbol distance field is used to calculate the distance between each pixel and the nearest shadow boundary through the 2D symbol distance field, and a soft weight mask and SDF image are generated. Combined with the fast Fourier transform module FFT, the information interaction module IIM, the global feature modulation module GFM and the boundary refinement module BRM, the shadow boundary and image characteristics are optimized, and the shadowless image is finally output.
It significantly improves the brightness recovery, boundary transition and smoothness of shadowed areas, making the removed image close to the real shadowless effect, and enhances the processing ability of complex shadow scenes.
Smart Images

Figure CN119379555B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to image processing technology, and in particular relates to a shadow elimination method based on a two-dimensional signed distance field. Background Art
[0002] Shadow removal is an important research topic in the field of image processing and computer vision. Since the light source in natural scenes is often partially or completely blocked, the appearance of shadows not only affects the visual quality of the image, but also causes serious interference to subsequent visual tasks (such as target detection, tracking, and image recognition). Therefore, studying how to restore shadow-free images from shadow images is of great significance to improving the performance of computer vision systems. In order to improve the quality of image shadow removal, researchers have made significant progress in shadow detection and removal technology in recent years. Based on the factors that affect the shadow removal effect, the relevant algorithms are divided into the following categories according to different processing methods.
[0003] Shadow removal based on traditional methods: These methods mainly rely on classical techniques of image processing and computer vision to identify and remove shadows through prior knowledge and empirical rules. The typical approach is to use information such as image photometric consistency, color correction, edge detection, gradient adjustment, etc. to infer the shadow area. Such methods work well in simple scenes and uniform lighting conditions, but their performance is limited in complex lighting environments and uneven shadow boundaries.
[0004] Shadow removal methods based on exposure fusion: This type of method aims to improve the color and lighting quality of shadow areas by combining multiple exposure images, that is, generating multiple images with different exposure levels to effectively compensate for brightness in shadow areas. However, there are still challenges, especially in the artifacts and boundary discontinuities that may be generated during the image fusion process.
[0005] Shadow removal methods based on style transfer: These methods regard the shadow removal task as an in-image style transfer problem, and improve the removal effect by maintaining the style consistency between the shadow area and the non-shadow area after removing the shadow. However, this method may cause the removed shadow area to be visually inharmonious with other parts of the image.
[0006] Shadow removal method based on image restoration: The shadow removal problem is regarded as a special image restoration task, and the shadow area is restored by fine-tuning the pre-trained image restoration model.
[0007] Shadow removal method based on diffusion model: In recent years, diffusion model has made significant progress in the field of image generation and restoration, and has become an important tool for solving complex image processing tasks; this method is usually divided into two main stages: forward diffusion stage and reverse denoising stage. Since the diffusion model requires multi-step processing, it consumes a lot of computing resources, especially when processing high-resolution images, the efficiency problem is particularly prominent.
[0008] In general, although the above existing technologies can eliminate shadows to a certain extent, they still have some limitations such as:
[0009] 1. Limited local information perception: Traditional CNN-based methods, due to the limitation of their receptive field, usually focus on capturing local texture and detail information, and have difficulty in fully perceiving the global illumination and overall structure of the image. This makes them unable to effectively remove shadows when dealing with scenes with large or complex illumination changes.
[0010] 2. Boundary artifact problem: Many methods rely on binary masks to distinguish shadow areas from non-shadow areas, and the boundaries of such masks are usually discontinuous. This will cause artifacts and unnatural transitions to appear in the boundary areas after shadow removal, resulting in inconsistency between the shadow area and the surrounding environment. Summary of the invention
[0011] Purpose of the invention: The purpose of the present invention is to solve the deficiencies in the prior art and provide a shadow removal method based on a two-dimensional signed distance field.
[0012] Technical solution: A shadow elimination method based on a two-dimensional signed distance field of the present invention inputs a shadow image to be processed into a shadow elimination network and performs the following processing:
[0013] Step 1: Calculate the distance from each pixel in the shadow image to the nearest shadow boundary through the 2D signed distance field, assign negative values to pixels in the shadow area and positive values to pixels in the non-shadow area, obtain a soft weight mask and an SDF image, and then extract the shadow area and non-shadow area in the original shadow image through the soft weight mask; Here, the spatial relationship between each point in the space and the target shape is effectively encoded as a scalar value, which provides a basis for subsequent image processing and calculation, and the soft weight mask can solve the shadow boundary artifact problem caused by the discontinuous gradient of the existing binary mask;
[0014] Step 2: Input the original shadow image and the SDF image together into the fast Fourier transform module FFT. The fast Fourier transform module FFT includes two parallel branches: a global frequency branch and a local space branch. The local space branch extracts the local spatial features of the original shadow image through spatial convolution operation. , obtain local detail information, including texture, gradient and local illumination changes, etc. At the same time, the global frequency branch extracts the global frequency characteristics of the original shadow image through the FFT spectrum transformation module , enhance the network's ability to perceive global structure and illumination changes;
[0015] Step 3: In the information interaction module IIM, the cross attention mechanism is first used to fuse the global frequency features obtained in step 2 and local spatial features , generate the corresponding attention weight map, and then use the adaptive fusion module AdaFU to dynamically fuse the two attention weight maps and output the fusion feature ; Then it is concatenated with the decoder’s feature map in the channel dimension;
[0016] Step 4: In the boundary refinement module BRM, the SDF image is first used as the query, and the global frequency feature and local spatial features Fusion obtains feature map , feature map As key-value pairs Key and Value, then calculate the SDF image and feature map The similarity between the two is used to obtain the attention weight, and the shadow boundary area is optimized by the attention weight. Then the optimization result is connected to the SDF image again, and a pixel-by-pixel depth-separable convolution DWConv operation is performed to output the feature map after boundary refinement. ; Then add the feature maps of the same dimension of its decoder;
[0017] Step 5: Extract the features of the non-shadow area obtained in step 1 through convolution operation and aggregate them to obtain the global feature vector ; Extract the features of the SDF image obtained in step 1 through convolution operation to obtain the SDF features ; For the feature map obtained in step 4 Perform instance normalization IN operation to obtain features ;
[0018] The global feature vector is modulated by the global feature modulation module GFM. ,feature and SDF features Modulation is performed and finally a shadow-free image is output , the features of FFT, SDF image and non-shadow area are captured and refined by modulation to remove shadows.
[0019] Furthermore, the shadow removal network is based on a generative adversarial network, and its generator includes a fast Fourier transform module FFT, an information interaction module IIM, a global feature modulation module GFM and a boundary refinement module BRM.
[0020] Furthermore, the beginning and ending parts of the FFT spectrum transform module use 1×1 convolution respectively, and between the two 1×1 convolutions, the real fast Fourier transform Real FFT, 1×1 convolution, 3×3 dilated convolution DCnv and inverse Fourier transform Inverse FFT are used in sequence, and the adaptive truncation mechanism AdaClip is used between the inverse Fourier transform Inverse FFT and the ending 1×1 convolution; the absolute position embedding module APE is also used after the real fast Fourier transform Real FFT;
[0021] The adaptive truncation mechanism AdaClip first normalizes the feature mean after inverse Fourier transformation, and then truncates according to the maximum and minimum values of the input feature. The specific formula is as follows:
[0022]
[0023] in, are input features, is the normalized feature;
[0024] The absolute position embedding module APE encodes the position information of each frequency component as an additional input feature.
[0025] In order to enhance the skip connection and upsampling stages, efficiently fuse global and local features, and thus improve the processing capability of complex shadow scenes, the information interaction module uses the cross attention mechanism to integrate local spatial features. As Query and global frequency features As Key and Value, generate the corresponding attention weight map to optimize the fusion effect of information; the expression is as follows:
[0026]
[0027] Then, the adaptive fusion module AdaFu is used to dynamically adjust the fusion weights to achieve the dynamic merging of local information and global information to obtain the fusion feature. , the expression is as follows:
[0028]
[0029] in, is a learnable gating matrix with a value range of (0, 1).
[0030] The information interaction module (IIM) can enhance the network's ability to perceive subtle changes in shadow and non-shadow areas, achieve more accurate and coherent shadow removal, and output fusion features. It is then fused with the feature map of the decoder to transmit the fused information.
[0031] In order to further improve the overall consistency of image texture and illumination after shadow removal, the global feature modulation module GFM uses pixel feature optimization PFR operation to optimize the global feature vector And SDF feature map The specific method is:
[0032] The global feature vector Transmitted to two multi-layer perceptrons MLP to generate two channel modulation parameters and , and then use and To modulate To generate modulation features ; then and After superposition, the pixel-level affine transformation parameters are learned through two convolutional layers: scaling factor and bias , and use the scaling factor and bias Normalized features Perform affine transformation to obtain the final output features , the expression is as follows:
[0033] .
[0034] Furthermore, in order to improve the quality of image generation and effectively enhance the robustness of shadow removal, in the process of training the shadow removal network based on the generative adversarial network, the difference between the shadow-free image predicted by the generator and the real image is optimized by the L1 loss function, and the binary cross entropy loss function is used to optimize the discriminator's ability to distinguish between the de-shadowed image and the real image. The specific contents are as follows:
[0035] The L1 loss between the de-shadowed image generated by the generator and the true shadow-free image is calculated to optimize the generator. The L1 loss function is defined as follows:
[0036]
[0037] in, represents the shadow-free image generated by the generator, represents a true shadow-free image;
[0038] The purpose of L1 loss is to improve the quality and realism of generated images by reducing the pixel difference between the generated images and the real images;
[0039] Since the goal of the discriminator is to identify artifacts and inconsistencies in the image by learning the difference between the generated image and the real image, the binary cross entropy loss is used here to optimize the discriminator to improve its ability to distinguish between the generated image and the real image. The binary cross entropy loss function is expressed as:
[0040]
[0041] Among them, D represents the output probability of the discriminator, which represents the probability that the input image is a real image; by maximizing the accuracy of the discriminator, the realism and consistency of the images generated by the generator are effectively improved.
[0042] Beneficial effects: The present invention has significant advantages in brightness restoration, boundary transition and smoothness of shadow areas, so that the image after removal is close to a real shadow-free effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a schematic diagram of the overall network structure of the present invention;
[0044] Figure 2 This is a schematic diagram of the Fast Fourier Transform module FFT in the present invention;
[0045] Figure 3 Schematic diagram of the information interaction module IIM in the present invention;
[0046] Figure 4 It is a schematic diagram of the boundary refinement module BRM in the present invention;
[0047] Figure 5 It is a schematic diagram of the global feature modulation module GFM in the present invention;
[0048] Figure 6 Schematic diagram of effect comparison in the embodiment DETAILED DESCRIPTION
[0049] The technical solution of the present invention is described in detail below, but the protection scope of the present invention is not limited to the embodiments.
[0050] like Figure 1 As shown, the shadow elimination method based on the two-dimensional signed distance field of the present invention constructs and trains a shadow elimination network based on a generative adversarial network, wherein the generator of the shadow elimination network includes a fast Fourier transform module FFT, an information interaction module IIM, a global feature modulation module GFM and a boundary refinement module BRM; the specific processing process after the shadow image to be processed is input into the shadow elimination network is as follows:
[0051] Step 1: Calculate the distance from each pixel in the shadow image to the nearest shadow boundary through the 2D signed distance field, assign negative values to pixels in the shadow area and positive values to pixels in the non-shadow area, obtain a soft weight mask and an SDF image, and then extract the shadow area and non-shadow area in the original shadow image through the soft weight mask; use the signed distance field SDF to replace the traditional binary mask as a soft weight mask; SDF can generate a more refined shadow boundary representation and effectively solve the boundary artifact problem;
[0052] Step 2: Figure 2 As shown in (a), the original shadow image and the SDF image are input into the fast Fourier transform module FFT together. The fast Fourier transform module FFT includes two parallel branches: a global frequency branch and a local space branch. The local space branch extracts the local spatial features of the original shadow image through a spatial convolution operation. At the same time, the global frequency branch extracts the global frequency features of the original shadow image through the FFT spectrum transformation module ; Here, spectral transformation is used to capture global information and focus on the structure and illumination changes of the overall image, which can make up for the shortcomings of existing CNN methods in perceiving global structure and illumination changes;
[0053] Step 3: In the information interaction module IIM, the cross attention mechanism is first used to fuse the global frequency features obtained in step 2 and local spatial features , generate the corresponding attention weight map, and then use the adaptive fusion module AdaFU to dynamically fuse the two attention weight maps and output the fusion feature ;
[0054] Step 4: In the boundary refinement module BRM, the SDF image is first used as the query, and the global frequency feature and local spatial features Fusion obtains feature map , feature map As key-value pairs Key and Value, then calculate the SDF image and feature map The similarity between the two is used to obtain the attention weight, and the shadow boundary area is optimized by the attention weight. Then the optimization result is connected to the SDF image again, and a pixel-by-pixel depth-separable convolution DWConv operation is performed to output the feature map after boundary refinement. (i indicates different scales); the shadow boundary area is optimized to reduce the jagged effect of the boundary, such as Figure 4 As shown;
[0055] Step 5: Extract the features of the non-shadow area obtained in step 1 through four consecutive 1×1 convolutional layers, and obtain the global feature vector by average pooling. ; Extract the features of the SDF image obtained in step 1 through three consecutive convolutional layers to obtain the SDF features ; For the feature map obtained in step 4 Perform instance normalization IN operation to obtain features ; The global feature vector is modulated by the global feature modulation module GFM ,feature and SDF features Modulation is performed and finally a shadow-free image is output .
[0056] This embodiment Figure 1 middle, , , They are the feature maps output by the decoder after three down-convolutions.
[0057] like Figure 2 As shown in (b), in order to capture and utilize the subtle changes and complexities in the shaded area, the beginning and end parts of the FFT spectrum transformation module of this embodiment use 1×1 convolution (to reduce and restore the number of channels), respectively. Between the two 1×1 convolutions, there are Real Fast Fourier Transform Real FFT, 1×1 convolution (to adjust the channel weights in the FFT frequency features), 3×3 dilated convolution DConv (to expand the receptive field to capture a wider range of relationships between frequency features) and Inverse Fourier Transform Inverse FFT (to extract global features). An adaptive truncation mechanism AdaClip is used between the Inverse Fourier Transform Inverse FFT and the ending 1×1 convolution; an absolute position embedding module APE is also used after the Real Fast Fourier Transform Real FFT.
[0058] The adaptive truncation mechanism AdaClip first normalizes the feature mean after the inverse Fourier transform, and then truncates according to the maximum and minimum values of the input feature. The specific formula is as follows:
[0059]
[0060] in, are input features, is the normalized feature.
[0061] The absolute position embedding module APE encodes the position information of each frequency component as an additional input feature, enabling the network to accurately learn and distinguish the specific positions of different frequency components in the original image, thereby better processing frequency domain information.
[0062] like Figure 3 As shown, the information interaction module of this embodiment uses the cross attention mechanism to integrate local spatial features As Query and global frequency features As Key and Value, generate the corresponding attention weight map to optimize the fusion effect of information; the expression is as follows:
[0063]
[0064] Then, the adaptive fusion module AdaFu is used to dynamically adjust the fusion weights to achieve the dynamic merging of local information and global information to obtain the fusion feature. , the expression is as follows:
[0065]
[0066] in, is a learnable gating matrix with a value range of (0, 1). It ensures that the fusion process is optimized to adapt to different conditions and data requirements, so that the network can effectively balance and integrate local and global features.
[0067] like Figure 5 As shown, in the global feature modulation module GFM of this embodiment, the pixel feature optimization PFR operation is used to optimize the global feature vector And SDF feature map The specific method is:
[0068] The global feature vector Transmitted to two multi-layer perceptrons MLP to generate two channel modulation parameters and , and then use and To modulate To generate modulation features ; then and After superposition, the pixel-level affine transformation parameters are learned through two convolutional layers: scaling factor and bias , and use the scaling factor and bias Normalized features Perform affine transformation to obtain the final output features , the expression is as follows:
[0069] .
[0070] This embodiment adopts the generative adversarial network (GAN) as a whole, and improves the effect of shadow removal through adversarial learning of the generator and the discriminator; the generator and the discriminator are optimized through adversarial training, and the generator continuously adjusts its parameters so that the generated image gradually approaches the visual effect of the real image; this generative adversarial network architecture enables our shadow removal method to more effectively handle complex lighting and scene changes, and achieve a more natural and realistic shadow removal effect. In the process of training the shadow removal network based on the generative adversarial network, the difference between the shadow-free image predicted by the generator and the real image is optimized by the L1 loss function, and the binary cross entropy loss function is used to optimize the discriminator's ability to distinguish between the de-shadowed image and the real image. The specific contents are as follows:
[0071] The L1 loss function is defined as follows:
[0072]
[0073] in, represents the shadow-free image generated by the generator, represents a true shadow-free image;
[0074] The binary cross entropy loss function is expressed as:
[0075]
[0076] Among them, D represents the output probability of the discriminator, which represents the probability that the input image is a real image.
[0077] In order to verify the technical solution of the present invention, this embodiment Figure 6 The figure shows the visual comparison results of different shadow removal methods on the ISTD and SRD datasets, covering the effects of various shadow removal techniques. The columns are the original input image (a), Fu et al. method (b), Zhu et al. method (c), BMNet (d), ShadowFormer (e), the technical solution of the present invention (f), and the real shadow-free image (g).
[0078] The following is a detailed analysis of the shadow removal effect of each method:
[0079] For the original input image (such as Figure 6 As shown in the a column of ), we can see that there are obvious shadow areas in the input image, especially in the cardboard box in the first row, the brick surface below, the cartoon character in the third row, and the blue ground sign in the last row. These shadows not only affect the brightness and contrast of the image, but also block the details.
[0080] For the prior art method of Fu et al. (such as Figure 6As shown in the b column of ), we can see that it has a certain effect in shadow removal, but there are still deficiencies in some details. Especially in the cardboard box in the first row and the brick wall in the fourth row, the shadow area appears to be somewhat residual and blurred, and the removal effect is relatively limited. In addition, although the shadow removal of the cartoon character in the third row improves the brightness, the transition at the shadow boundary does not seem natural enough.
[0081] For the prior art Zhu et al. method (such as Figure 6 As shown in the c column of ), it performs better in brightness and shadow removal, removing some shadows and making the image look clearer. However, there are still discontinuities and color differences in the shadow boundary processing of rows 2 and 4, resulting in the shadow removal effect not being smooth enough. In addition, the removal effect of the carton shadow in row 1 is limited, and there are sudden brightness changes in some areas.
[0082] For existing BMNet solutions (such as Figure 6 d in the figure): It performs well in shadow removal, especially for shadows on some simple backgrounds. For example, the shadow removal effect of the square brick surface in the second row and the cartoon character in the third row is ideal, and the brightness and texture are well restored. However, on the brick wall in the fourth row and the blue ground sign in the fifth row, there are still some uneven transitions on the shadow boundaries.
[0083] For existing ShadowFormer methods (such as Figure 6 As shown in the e column of ), it performs better than the previous methods in shadow removal, especially when dealing with more complex shadow scenes. It can be seen that after removing the shadows in the 2nd and 4th rows, the brightness of the brick surface is more uniform and the transition of the shadow boundary is more natural. However, in some areas with complex textures (such as the blue ground sign in the 5th row), there is still a small amount of brightness deviation.
[0084] The technical solution of the present invention (such as Figure 6 ) achieves the best performance in shadow removal. It can be clearly seen that the method in this paper completely removes the shadow on the carton in the first row, and the details are well preserved. After the shadow areas in the second and fourth rows are removed, the surface brightness is uniform, the transition of the shadow boundary is natural, and there is no obvious brightness mutation or artifact. In particular, the shadow removal effect of the blue ground mark area in the fifth row is extremely smooth, close to the real shadow-free image.
[0085] The true shadow-free image (such as Figure 6 As shown in the g column of Figure 1, the real shadow-free image shows the ideal shadow removal effect. The brightness of each area is uniform, the contrast is normal, and the boundary transition is smooth.
[0086] Then, the technical solution of the present invention was quantitatively analyzed on the ISTD data set and the SRD data set, and the results are shown in Table 1.
[0087] Table 1
[0088]
[0089] As can be seen from Table 1, on the ISTD dataset, the present invention achieves the highest PSNR (37.42) and the lowest RMSE (5.80) in the shadow area, indicating that the processing of the shadow area is more accurate. It also achieves excellent results in the SSIM (0.981) of the non-shadow area and the PSNR (31.65) of the whole image, which shows that the technical solution of the present invention can better balance the brightness consistency of the shadow area and the overall image.
[0090] As can be seen from Table 1, on the SRD dataset, the present invention also achieved leading performance in all indicators. The PSNR in the shadow area reached 38.49, and the SSIM also reached 0.989, indicating excellent performance in shadow removal and detail preservation. The RMSE of the entire image (4.30) shows the high quality of overall shadow removal.
[0091] In summary, the present invention has significant advantages in brightness restoration, boundary transition and smoothness of the shadow area, so that the image after removal is close to a real shadow-free effect.
Claims
1. A shadow removal method based on a two-dimensional signed distance field, characterized in that: The shadow image to be processed is input into the shadow removal network. The shadow removal network is based on the generative adversarial network, and its generator includes a fast Fourier transform module FFT, an information interaction module IIM, a global feature modulation module GFM and a boundary refinement module BRM. The shadow removal network performs the following processing: Step 1: Calculate the distance from each pixel in the shadow image to the nearest shadow boundary through the 2D signed distance field, assign negative values to pixels in the shadow area and positive values to pixels in the non-shadow area, obtain a soft weight mask and an SDF image, and then extract the shadow area and non-shadow area in the original shadow image through the soft weight mask; Step 2: Input the original shadow image and the SDF image together into the fast Fourier transform module FFT. The fast Fourier transform module FFT includes two parallel branches: a global frequency branch and a local space branch. The local space branch extracts the local spatial features of the original shadow image through spatial convolution operation. At the same time, the global frequency branch extracts the global frequency features of the original shadow image through the FFT spectrum transformation module ; Step 3: In the information interaction module IIM, the cross attention mechanism is first used to fuse the global frequency features obtained in step 2 and local spatial features , generate the corresponding attention weight map, and then use the adaptive fusion module AdaFU to dynamically fuse the two attention weight maps and output the fusion feature ; Step 4: In the boundary refinement module BRM, the SDF image is first used as the query Query, and the global frequency feature and local spatial features Fusion obtains feature map , feature map As key-value pairs Key and Value, then calculate the SDF image and feature map The similarity between the two is used to obtain the attention weight, and the shadow boundary area is optimized by the attention weight. Then the optimization result is connected to the SDF image again, and a pixel-by-pixel depth-separable convolution DWConv operation is performed to output the feature map after boundary refinement. ; Step 5: Extract the features of the non-shadow area obtained in step 1 through convolution operation and aggregate them to obtain the global feature vector ; Extract the features of the SDF image obtained in step 1 through convolution operation to obtain the SDF features ; For the feature map obtained in step 4 Perform instance normalization IN operation to obtain features ; The global feature vector is modulated by the global feature modulation module GFM. ,feature and SDF features Modulation is performed and finally a shadow-free image is output .
2. The shadow removal method based on two-dimensional signed distance field according to claim 1, characterized in that: The beginning and end parts of the FFT spectrum transform module use 1×1 convolution respectively, and between the two 1×1 convolutions are Real Fast Fourier Transform Real FFT, 1×1 convolution, 3×3 dilated convolution DCnv and Inverse Fourier Transform Inverse FFT in sequence, and an adaptive truncation mechanism AdaClip is used between the Inverse Fourier Transform Inverse FFT and the end of the 1×1 convolution; an absolute position embedding module APE is also used after the Real Fast Fourier Transform Real FFT; The adaptive truncation mechanism AdaClip first normalizes the feature mean after inverse Fourier transformation, and then truncates according to the maximum and minimum values of the input feature. The specific formula is as follows: ; in, are input features, is the normalized feature; The absolute position embedding module APE encodes the position information of each frequency component as an additional input feature.
3. The shadow removal method based on two-dimensional signed distance field according to claim 1, characterized in that: The information interaction module uses the cross attention mechanism to integrate local spatial features As Query and global frequency features As Key and Value, generate the corresponding attention weight map to optimize the fusion effect of information; the expression is as follows: ; Then, the adaptive fusion module AdaFu is used to dynamically adjust the fusion weights to achieve the dynamic merging of local information and global information to obtain the fusion feature. , the expression is as follows: ; in, is a learnable gating matrix with a value range of (0, 1).
4. The shadow removal method based on two-dimensional signed distance field according to claim 1, characterized in that: In the global feature modulation module GFM, the pixel feature optimization PFR operation is used to optimize the global feature vector And SDF feature map The specific method is: The global feature vector Transmitted to two multi-layer perceptrons MLP to generate two channel modulation parameters and , and then use and To modulate To generate modulation features ; then and After superposition, the pixel-level affine transformation parameters are learned through two convolutional layers: scaling factor and bias , and use the scaling factor and bias Normalized features Perform affine transformation to obtain the final output features , the expression is as follows: 。 5. The shadow removal method based on two-dimensional signed distance field according to claim 1 or 2, characterized in that: In the process of training the shadow removal network based on the generative adversarial network, the difference between the generator's predicted shadow-free image and the real image is optimized by the L1 loss function, and the discriminator's ability to distinguish between the de-shadowed image and the real image is optimized by the binary cross entropy loss function. The specific contents are as follows: The L1 loss function is defined as follows: ; in, represents the shadow-free image generated by the generator, represents a true shadow-free image; The binary cross entropy loss function is expressed as: ; Among them, D represents the output probability of the discriminator, which represents the probability that the input image is a real image.
Citation Information
Patent Citations
Natural image shadow elimination method
CN104599253A
Moving object shadow detection and elimination method based on multi-feature fusion
CN110288538A