Image shadow elimination method and device
By combining traditional image processing technology and deep learning algorithms to identify and remove shadow areas in the image, the problem of inefficient shadow removal in the existing technology is solved, and a more accurate and faster shadow removal effect is achieved, adapting to complex and changeable image environments, and improving the clarity and visual effects of the image.
Patent Information
- Application Number
- CN202411660437.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-04-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art has low shadow removal efficiency in image processing, and it is difficult to adapt to complex and changeable image environments. Machine learning-based methods face the problems of insufficient training data and poor generalization capabilities of models.
Through image preprocessing, shadow detection, shadow removal and feedback optimization steps, combined with traditional image processing technology and deep learning algorithms, shadow areas in the image are identified and eliminated, and multi-scale feature extraction, machine learning, and deep learning technologies are used to improve the generalization ability and processing robustness of the model.
It realizes more accurate shadow recognition and culling, improves processing speed and accuracy, adapts to complex and changeable image environments, enhances the robustness and adaptability of image processing, restores real image content, and improves the clarity and visual effects of the image.
Smart Images

Figure CN119809966A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an image shadow removal method and device. Background Art
[0002] In the field of image processing and analysis, the presence of shadows often has an adverse effect on the subsequent processing of images, such as affecting target detection, image segmentation, feature extraction, etc. Traditional shadow removal methods mostly rely on complex algorithms or manual intervention, which not only have low processing efficiency, but also have difficulty adapting to complex and changing image environments. In recent years, with the rapid development of technologies such as deep learning and computer vision, shadow removal methods based on machine learning have gradually become a research hotspot. However, these methods still face challenges such as insufficient training data and poor model generalization ability. In this regard, we propose an image shadow removal method and device to solve the above problems. Summary of the invention
[0003] In view of the deficiencies of the prior art, the present invention provides an image shadow removal method and device, which solves the problems raised in the background technology.
[0004] To achieve the above objectives, the present invention is implemented through the following technical solutions: an image shadow removal method, specifically comprising the following steps:
[0005] S1, an image preprocessing step, comprising converting an input color image into a grayscale image and performing noise suppression on the grayscale image;
[0006] S2, a shadow detection step, comprising extracting feature information related to the shadow from the preprocessed grayscale image, and identifying the shadow in the image using a machine learning algorithm or a deep learning model to generate a binary image of the shadow area;
[0007] S3, shadow removal step, according to the binary image of the shadow area, using image restoration technology or brightness adjustment strategy to remove the shadow area, so as to restore the real image content under the shadow or make the shadow area consistent with the non-shadow area;
[0008] S4, feedback and optimization step, evaluating the image after removing the shadows, and optimizing and adjusting the shadow detection and removal model according to the evaluation results.
[0009] Preferably, the noise suppression process in the image preprocessing step adopts median filtering, Gaussian filtering or other effective filtering algorithms.
[0010] Preferably, the feature extraction in the shadow detection step adopts a multi-scale feature extraction method combined with local binary pattern and directional gradient histogram feature descriptors.
[0011] Preferably, the machine learning algorithm in the shadow detection step includes a support vector machine and a random forest, and the deep learning model includes a convolutional neural network model.
[0012] Preferably, the image restoration technology in the shadow removal step adopts methods such as image restoration based on texture synthesis and image super-resolution reconstruction based on deep learning.
[0013] Preferably, the effect evaluation in the feedback and optimization step adopts a method of comparing the original image and the image after the shadow is removed, and the evaluation indicators include the completeness, accuracy, naturalness and processing speed of the shadow removal.
[0014] The present invention also discloses an image shadow removal device, comprising an image preprocessing module, a shadow detection module, a shadow removal module, and a feedback and optimization module. The image preprocessing module is used to convert an input color image into a grayscale image and perform noise suppression on the grayscale image. The shadow detection module is used to extract feature information related to the shadow from the preprocessed grayscale image, and use a machine learning algorithm or a deep learning model to identify the shadow in the image to generate a binary image of the shadow area. The shadow removal module is used to remove the shadow area according to the binary image of the shadow area using an image restoration technology or a brightness adjustment strategy. The feedback and optimization module is used to evaluate the image after the shadow is removed, and optimize and adjust the shadow detection and removal model according to the evaluation result. The output end of the image preprocessing module is electrically connected to the input end of the shadow detection module, the output end of the shadow detection module is electrically connected to the input end of the shadow removal module, and the output end of the shadow removal module is electrically connected to the input end of the feedback and optimization module.
[0015] Preferably, the image preprocessing module includes a grayscale conversion unit and a noise suppression unit, the grayscale conversion unit uses a weighted average method to convert a color image into a grayscale image, and the noise suppression unit uses a median filter, a Gaussian filter or other effective filtering algorithms to perform noise suppression on the grayscale image.
[0016] Preferably, the shadow detection module includes a feature extraction unit and a shadow recognition unit, the feature extraction unit adopts a multi-scale feature extraction method to extract the color, texture and brightness features of the image, and the shadow recognition unit uses a trained machine learning algorithm or deep learning model to classify and recognize the features.
[0017] Preferably, the shadow removal module includes a shadow area segmentation unit and a shadow removal unit, the shadow area segmentation unit divides the image into a shadow area and a non-shadow area according to a binary map of the shadow area, the shadow removal unit uses image restoration technology or brightness adjustment strategy to remove the shadow area, and the feedback and optimization module includes an effect evaluation unit and a model optimization unit.
[0018] Beneficial Effects
[0019] The present invention provides an image shadow removal method and device. Compared with the prior art, the present invention has the following beneficial effects:
[0020] (1) By combining traditional image processing technology with deep learning algorithms, this patent can more accurately identify shadow areas in images and use efficient algorithms or models to remove them. This not only improves the accuracy of shadow removal, but also significantly speeds up the processing speed, making it possible to apply it to real-time processing or large-scale data sets.
[0021] (2) The shadow removal method of the present invention adopts multi-scale feature extraction and machine learning and deep learning technologies, so that the method can process images with various lighting conditions, scene types and image quality. Through continuous learning and optimization, the model can gradually improve its generalization ability, thereby adapting to more complex and changeable image environments and enhancing the robustness and adaptability of processing.
[0022] (3) By accurately removing shadows from images, the patented method can restore the real image content under the shadows and improve the clarity and visual effect of the image. At the same time, this has positive significance for subsequent applications such as image analysis, target detection, and image segmentation. It can significantly improve the accuracy and reliability of these applications and expand the application scope of image processing technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 is a system block diagram of the present invention;
[0024] Figure 2 It is a schematic diagram of an image preprocessing module of the present invention;
[0025] Figure 3 is a schematic diagram of a shadow detection module of the present invention;
[0026] Figure 4 It is a schematic diagram of a shadow removal module of the present invention;
[0027] Figure 5 It is a schematic diagram of the feedback and optimization module of the present invention.
[0028] In the figure: 01, image preprocessing module; 02, shadow detection module; 03, shadow removal module; 04, feedback and optimization module; 011, grayscale conversion unit; 012, noise suppression unit; 021, feature extraction unit; 022, shadow recognition unit; 031, shadow area segmentation unit; 032, shadow removal unit; 041, effect evaluation unit; 042, model optimization unit. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0030] The present invention provides three technical solutions, including the following embodiments:
[0031] Example 1
[0032] The image shadow removal method specifically includes the following steps:
[0033] S1. Image preprocessing step: collect and annotate a dataset containing shadow and shadow-free images. The dataset should cover images under various scenes and lighting conditions to ensure the generalization ability of the model. Construct a shadow detection model based on a convolutional neural network. The model input is a grayscale image, and the grayscale image is subjected to noise suppression. The output is a binary image of the shadow area. The cross entropy loss function is used as the training target, and the model parameters are optimized through the back propagation algorithm.
[0034] S2, a shadow detection step, comprising extracting feature information related to the shadow from the preprocessed grayscale image, and identifying the shadow in the image using a machine learning algorithm or a deep learning model to generate a binary image of the shadow area;
[0035] S3, shadow removal step, according to the binary image of the shadow area, the shadow area is removed by using image restoration technology or brightness adjustment strategy to restore the real image content under the shadow or make the shadow area consistent with the non-shadow area. For image restoration technology, a deep learning model can be used to generate texture and color information similar to the surrounding of the shadow area; for brightness adjustment strategy, the brightness value of the shadow area can be adjusted according to the brightness information of the non-shadow area;
[0036] S4, feedback and optimization step, evaluating the image after removing the shadows, and optimizing and adjusting the shadow detection and removal model according to the evaluation results.
[0037] The noise suppression process in the image preprocessing step adopts median filtering, Gaussian filtering or other effective filtering algorithms.
[0038] The feature extraction in the shadow detection step adopts a multi-scale feature extraction method combined with local binary pattern and oriented gradient histogram feature descriptors.
[0039] The machine learning algorithms in the shadow detection step include support vector machines and random forests, and the deep learning models include convolutional neural network models.
[0040] The image restoration technology in the shadow removal step adopts methods such as image restoration based on texture synthesis and image super-resolution reconstruction based on deep learning.
[0041] The effect evaluation in the feedback and optimization step is carried out by comparing the original image and the image after shadow removal. The evaluation indicators include the completeness, accuracy, naturalness and processing speed of shadow removal.
[0042] Example 2
[0043] Based on Example 1, see Figure 1 As shown, the present invention also discloses an image shadow removal device, including an image preprocessing module 01, a shadow detection module 02, a shadow removal module 03, and a feedback and optimization module 04. The image preprocessing module 01 is used to convert an input color image into a grayscale image and perform noise suppression on the grayscale image. The shadow detection module 02 is used to extract feature information related to the shadow from the preprocessed grayscale image, and use a machine learning algorithm or a deep learning model to identify the shadow in the image to generate a binary image of the shadow area. The shadow removal module 03 is used to remove the shadow area according to the binary image of the shadow area by using an image restoration technology or a brightness adjustment strategy. The feedback and optimization module 04 is used to evaluate the image after the shadow is removed, and optimize and adjust the shadow detection and removal model according to the evaluation result. The output end of the image preprocessing module 01 is electrically connected to the input end of the shadow detection module 02, the output end of the shadow detection module 02 is electrically connected to the input end of the shadow removal module 03, and the output end of the shadow removal module 03 is electrically connected to the input end of the feedback and optimization module 04.
[0044] Example 3
[0045] Based on Example 2, see Figure 2-Figure 5 As shown, the image preprocessing module 01 includes a grayscale conversion unit 011 and a noise suppression unit 012. The grayscale conversion unit 011 uses a weighted average method to convert a color image into a grayscale image, and the noise suppression unit 012 uses a median filter, a Gaussian filter or other effective filtering algorithms to perform noise suppression on the grayscale image.
[0046] The shadow detection module 02 includes a feature extraction unit 021 and a shadow recognition unit 022. The feature extraction unit 021 uses a multi-scale feature extraction method to extract the color, texture and brightness features of the image. The shadow recognition unit 022 uses a trained machine learning algorithm or a deep learning model to classify and recognize the features to obtain a binary image of the shadow area.
[0047] The shadow removal module 03 includes a shadow area segmentation unit 031 and a shadow removal unit 032. The shadow area segmentation unit 031 divides the image into a shadow area and a non-shadow area according to the binary map of the shadow area. The shadow removal unit 032 uses image restoration technology or brightness adjustment strategy to remove the shadow area. The feedback and optimization module 04 includes an effect evaluation unit 041 and a model optimization unit 042. The effect evaluation unit 041 evaluates the image after the shadow is removed, and the model optimization unit 042 optimizes and adjusts the shadow detection and removal model according to the evaluation result.
[0048] Meanwhile, the contents not described in detail in this specification belong to the prior art known to those skilled in the art.
[0049] The above embodiments of the invention are described in detail, but the contents are only preferred embodiments of the invention and cannot be considered to limit the scope of the invention. All equivalent changes and improvements made within the scope of the invention should still fall within the scope of the invention.
Claims
1. An image shadow removal method, characterized in that: The specific steps include: S1, an image preprocessing step, comprising converting an input color image into a grayscale image and performing noise suppression on the grayscale image; S2, a shadow detection step, comprising extracting feature information related to the shadow from the preprocessed grayscale image, and identifying the shadow in the image using a machine learning algorithm or a deep learning model to generate a binary image of the shadow area; S3, shadow removal step, according to the binary image of the shadow area, using image restoration technology or brightness adjustment strategy to remove the shadow area, so as to restore the real image content under the shadow or make the shadow area consistent with the non-shadow area; S4, feedback and optimization step, evaluating the image after removing the shadows, and optimizing and adjusting the shadow detection and removal model according to the evaluation results.
2. The image shadow removal method according to claim 1, characterized in that: The noise suppression process in the image preprocessing step adopts median filtering, Gaussian filtering or other effective filtering algorithms.
3. The image shadow removal method according to claim 1, characterized in that: The feature extraction in the shadow detection step adopts a multi-scale feature extraction method, combined with local binary pattern and directional gradient histogram feature descriptors.
4. The image shadow removal method according to claim 1, characterized in that: The machine learning algorithms in the shadow detection step include support vector machines and random forests, and the deep learning models include convolutional neural network models.
5. The image shadow removal method according to claim 1, characterized in that: The image restoration technology in the shadow removal step adopts methods such as image restoration based on texture synthesis and image super-resolution reconstruction based on deep learning.
6. The image shadow removal method according to claim 1, characterized in that: The effect evaluation in the feedback and optimization step adopts the method of comparing the original image and the image after the shadow is eliminated, and the evaluation indicators include the completeness, accuracy, naturalness and processing speed of the shadow elimination.
7. An image shadow removal device, characterized in that: The invention comprises an image preprocessing module (01), a shadow detection module (02), a shadow removal module (03), and a feedback and optimization module (04), wherein the image preprocessing module (01) is used to convert an input color image into a grayscale image and perform noise suppression on the grayscale image, the shadow detection module (02) is used to extract feature information related to the shadow from the preprocessed grayscale image, and use a machine learning algorithm or a deep learning model to identify the shadow in the image and generate a binary image of the shadow area, and the shadow removal module (03) is used to generate a binary image of the shadow area according to the binary image of the shadow area. The invention relates to a method for preparing a shadow detection image and a shadow removal model, wherein the image preprocessing module (01) is used to evaluate the image after the shadow is removed, and optimize the shadow detection and removal model according to the evaluation result. The output end of the image preprocessing module (01) is electrically connected to the input end of the shadow detection module (02), the output end of the shadow detection module (02) is electrically connected to the input end of the shadow removal module (03), and the output end of the shadow removal module (03) is electrically connected to the input end of the feedback and optimization module (04).
8. The image shadow removal method and device according to claim 7, characterized in that: The image preprocessing module (01) comprises a grayscale conversion unit (011) and a noise suppression unit (012). The grayscale conversion unit (011) converts a color image into a grayscale image using a weighted average method, and the noise suppression unit (012) performs noise suppression processing on the grayscale image using a median filter, a Gaussian filter or other effective filtering algorithms.
9. The image shadow removal device according to claim 7, characterized in that: The shadow detection module (02) comprises a feature extraction unit (021) and a shadow recognition unit (022), wherein the feature extraction unit (021) extracts color, texture and brightness features of an image using a multi-scale feature extraction method, and the shadow recognition unit (022) classifies and recognizes features using a trained machine learning algorithm or a deep learning model.
10. The image shadow removal device according to claim 7, characterized in that: The shadow removal module (03) comprises a shadow area segmentation unit (031) and a shadow removal unit (032). The shadow area segmentation unit (031) segments the image into a shadow area and a non-shadow area according to a binary image of the shadow area. The shadow removal unit (032) uses an image restoration technology or a brightness adjustment strategy to remove the shadow area. The feedback and optimization module (04) comprises an effect evaluation unit (041) and a model optimization unit (042).