An Automatic Method for Eliminating Digital Image Shadows Indoors and Outdoors without Human Attendance

By detecting the outline of light sources and foreground objects in image processing, using the principle of projected linear invariance to locate the shadow area and adjust the brightness, the problem of shadow elimination under unattended conditions is solved, and the automatic removal of shadow areas and image quality improvement is achieved.

CN115034996BActive Publication Date: 2025-07-25SICHUAN AEROSPACE ZHONGTIAN POWER EQUIP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210745684.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-28
Publication Date
2025-07-25
Estimated Expiration
2042-06-28

AI Technical Summary

Technical Problem

The prior art is difficult to effectively eliminate the problems of darker images, low contrast and poor visual effects caused by strong light sources in outdoor environments, especially the difficulty of image processing increases under unattended conditions.

Method used

An unattended indoor and outdoor digital image shadow automatic elimination method is adopted. By detecting the outline of light sources and foreground objects, the shadowed area is positioned using the principle of projected linear invariance, and the brightness of the shadowed area is enhanced by calculating the proportional amplification coefficient to make it consistent with the surrounding area.

Benefits of technology

It achieves rapid and accurate removal of shadow areas, improves the visual effect and processing efficiency of the image, and ensures consistency of image brightness and contrast.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115034996B_ABST
    Figure CN115034996B_ABST
Patent Text Reader

Abstract

The present invention discloses an automatic method for eliminating indoor and outdoor digital image shadows for unattended use, which relates to the field of image technology and includes the following steps: input the original picture; detect the light source in the image space and determine the light source contour and center point; detect the foreground object in the image space and determine the foreground object contour and center point; traverse each point of the foreground object in the image space to form a complete shadow area; enhance the brightness of the shadow area; output the picture after shadow elimination; by using the principle of invariance of projection lines, on the image plane, the light source, the foreground contour, and the shadow contour still form a straight line; by using this characteristic, the shadow area can be accurately and quickly located; for the shadow area image, by calculating the proportional amplification coefficient, the pixel mean value of the shadow area is enhanced so that the pixel mean value of the shadow area is consistent with the pixel mean value of the area outside the shadow, thereby realizing automatic shadow elimination.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and specifically provides an automatic method for eliminating digital image shadows indoors and outdoors without human supervision. Background Art

[0002] A shadow is a natural phenomenon that occurs when light is partially or completely blocked, and the brightness of the shadow area is lower than that of other areas. This low-brightness characteristic will reduce the accuracy and effectiveness of certain computer vision tasks. For example, when there is a strong light source (such as the sun) in the outdoor environment, the photos taken by a camera system may produce obvious shadows, resulting in a darker image in the shadow part, lower contrast, and poor visual effects. Therefore, it is necessary to eliminate the shadows in the image, restore the illumination of the shadow area, and improve the visual effect of the image, so as to ensure more accurate and effective implementation. However, due to the changes in light and texture in the scene and the influence of other environmental factors, the task of eliminating image shadows in complex scenes remains a very challenging problem.

[0003] Eliminating the shadow of an image means restoring the illumination of the shadow area on the basis of ensuring the original tone and texture structure of the shadow area, so that the brightness, color, texture, etc. of the restored shadow area are consistent with the surrounding environment. When performing digital image processing, when there is a strong light source (such as the sun) in the outdoor environment, the photos taken by a camera system may produce obvious shadows, resulting in a darker image in the shadow part, lower contrast, and poor visual effects, increasing the difficulty of image processing.

[0004] Traditional shadow elimination algorithms mainly include fixed background subtraction and regional brightness detection. Fixed background subtraction, that is, an algorithm that locates the shadow area by comparing a shadow-free background picture with the current picture, has the problem of being difficult to construct a shadow-free background picture. For the regional brightness detection method, when using this algorithm to locate the shadow area, there are serious problems such as darker-colored objects being easily misjudged as shadow areas. Summary of the Invention

[0005] The purpose of the present invention is to solve the technical problem that the photos taken by a camera system may produce obvious shadows, resulting in a darker image in the shadow part, lower contrast, and poor visual effects, increasing the difficulty of image processing. The present invention provides an automatic method for eliminating digital image shadows indoors and outdoors without human supervision.

[0006] The present invention specifically adopts the following technical solutions to achieve the above purpose:

[0007] An automatic method for eliminating digital image shadows indoors and outdoors without human supervision includes the following steps:

[0008] Input the original picture;

[0009] Detect the light source in the image space, and determine the light source contour and the center point;

[0010] Detect the foreground object in the image space, and determine the foreground object contour and the center point;

[0011] Traverse each point of the foreground object in the image space to form a complete shadow area;

[0012] Enhance the brightness of the shadow area;

[0013] Output the image after shadow elimination.

[0014] Further, detecting the light source in the image space and determining the light source contour and the center point include the following steps:

[0015] First, perform a softmax algorithm operation on the entire domain of the original image I1 to highlight the larger light intensity values, and obtain the image I2;

[0016] Use the Otsu algorithm to perform a binarization operation on the image to obtain the image I3;

[0017] Find the connected domain with the largest area Centroid Obtain the light source contour L1 and the center point A.

[0018] Further, detecting the foreground object in the image space and determining the foreground object contour and the center point include the following steps:

[0019] Remove the light source contour L1 from the image I1 to form the image I4;

[0020] Use the Otsu algorithm to perform a binarization operation on the image to obtain the image I5;

[0021] Find the connected domain with the largest area Centroid Obtain the foreground object contour L2 and the center point B.

[0022] Further, traversing each point of the foreground object in the image space to form a complete shadow area includes the following steps:

[0023] Traverse each point B of the foreground object contour i , construct a straight line Taking the center point A as a reference, construct parallel lines Obtain the intersection point A with the light source contour i ;

[0024] At Search for the set of lowest brightness points {C on the extension line of i}, and select the element with the maximum gradient value from the set {C i} as c * ;

[0025] Traverse each point {B i} of the foreground object, and repeat the above steps for each point {B i} to form a complete shadow area {c *}.

[0026] Furthermore, enhancing the brightness of the shadow area includes the following steps:

[0027] Expand the shadow contour S of the shadow area outward by a distance d to obtain the outer shadow contour L;

[0028] Shrink the shadow contour S of the shadow area inward by a distance d to obtain the inner shadow contour I;

[0029] Statistically calculate the pixel mean U L on the outer shadow contour L as the mean of the illuminated area image;

[0030] Statistically calculate the pixel mean U I on the inner shadow contour I as the mean of the shadow area image;

[0031] Calculate the brightness amplification ratio r of the shadow area image according to the means U L and U I ;

[0032] Traverse each pixel in the shadow area, multiply its brightness value by r, and limit the pixel value range to 0-255.

[0033] The beneficial effects of the present invention are as follows:

[0034] A method for automatically eliminating indoor and outdoor digital image shadows for unattended use in the present invention utilizes the principle of the invariance of projection lines. On the image plane, the light source, the foreground contour, and the shadow contour still form a straight line. Using this characteristic, the shadow area can be accurately and quickly located; for the shadow area image, by calculating the proportional amplification factor, the pixel mean of the shadow area is enhanced, so that the pixel mean of the shadow area is consistent with the pixel mean of the area outside the shadow, thereby realizing automatic shadow elimination. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 is a schematic diagram of the method flow of the present invention;

[0036] Figure 2 is a schematic diagram of the principle of shadow formation of the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0037] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and illustrated herein can generally be arranged and designed in various different configurations.

[0038] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts belong to the scope of protection of the present invention.

[0039] The present invention utilizes the basic principle that a straight line is formed by the light source, the contour edge of the foreground object, and the shadow edge. When using a camera system to image a scene, according to the principle of invariance of the projected straight line, on the image plane, the light source, the contour of the foreground object, and the shadow contour still form a straight line. By determining the light source contour and the center point in the image space, and determining the contour and the center point of the foreground object in the image space, the shadow area can be quickly and accurately located. For the shadow area image, by calculating the proportional magnification factor, the pixel mean value of the shadow area is made consistent with the pixel mean value outside the shadow area, thereby realizing automatic shadow elimination. For example, as Figure 2 shown, A, B, and C are the center points of the light source, the foreground object, and the shadow area respectively. According to the principle of invariance of the straight line of perspective transformation, points A, B, and C should also form a straight line on the image. Assume that B1 and C1 are the same point of the foreground object and the shadow object. Similarly, points A1, B1, and C1 form a straight line. Since the light source is a parallel light, therefore, there is and a parallel relationship. According to the above relationship, the shadow area can be determined.

[0040] Embodiment 1

[0041] As Figure 1 shown, this embodiment provides an automatic shadow elimination method for indoor and outdoor digital images for unattended operation, including the following steps:

[0042] Input the original picture;

[0043] Detect the light source in the image space and determine the light source contour and the center point;

[0044] Specifically, detecting the light source in the image space and determining the light source contour and the center point include the following steps:

[0045] First, perform a softmax algorithm operation on the entire domain of the original picture I1 to highlight the larger light intensity values and obtain the image I2;

[0046] where X j is the element j of Figure I1, and X i is the element i of Figure I2;

[0047] Use the Otsu algorithm to perform binaryzation operation on the image to obtain image I3;

[0048] I3 = Otsu(I2);

[0049] Find the connected component with the largest area and the centroid to obtain the light source contour L1 and the center point A;

[0050] where (x i , y i ) are the coordinates of each pixel point on the contour L1, and N is the number of pixel points on the light source contour;

[0051] Detect foreground objects in the image space and determine the foreground object contour and the center point;

[0052] Specifically, detecting foreground objects in the image space and determining the foreground object contour and the center point include the following steps:

[0053] Remove the light source contour L1 from image I1 to form image I4;

[0054] Use the Otsu algorithm to perform binaryzation operation on the image to obtain image I5;

[0055] I5 = Otsu(I4);

[0056] Find the connected component with the largest area and the centroid to obtain the foreground object contour L2 and the center point B.

[0057] where (x i , y i ) are the coordinates of each pixel point on the contour L2, and N is the number of pixel points on the foreground object contour;

[0058] Traverse each point of the foreground object in the image space to form a complete shadow area;

[0059] Specifically, traversing each point of the foreground object in the image space to form a complete shadow area includes the following steps:

[0060] Traverse each point B of the foreground object contour i and construct a straight line Taking the center point A as the reference, construct parallel lines Obtain the intersection point A with the light source contour i ;

[0061]

[0062] Search for the set of lowest brightness points {C } on the extension line of, and select the element with the maximum gradient value from the set {C i} as c i ; * ;

[0063] c * = Δg{c i}|max, where Δg is the gradient operator;

[0064] Traverse each point {B i} of the foreground object, and repeat the above steps for each point {B i} to form the complete shadow area {c *}.

[0065] Enhance the brightness of the shadow area;

[0066] Specifically, enhancing the brightness of the shadow area includes the following steps:

[0067] Expand the shadow contour S of the shadow area outward by a distance d to obtain the outer shadow contour L;

[0068] Shrink the shadow contour S of the shadow area inward by a distance d to obtain the inner shadow contour I;

[0069] Statistically calculate the pixel mean U L on the outer shadow contour L as the mean of the illuminated area image;

[0070]

[0071] Statistically calculate the pixel mean U I on the inner shadow contour I as the mean of the shadow area image;

[0072]

[0073] Calculate the brightness amplification ratio r of the shadow area image according to the means U L , U I ;

[0074]

[0075] Traverse each pixel in the shadow area, multiply its brightness value by r, and limit the pixel value range to 0 - 255;

[0076]

[0077] Output the image after shadow elimination.

Claims

1. An automatic method for eliminating digital image shadows indoors and outdoors without human presence, characterized in that, It includes the following steps: Input the original picture; Detect the light source in the image space, and determine the light source contour and center point; Detect the foreground object in the image space, and determine the foreground object contour and center point; Traverse each point of the foreground object in the image space to form a complete shadow area; Enhance the brightness of the shadow area; Output the picture after shadow elimination; Detecting the light source in the image space and determining the light source contour and center point includes the following steps: First, perform the softmax algorithm operation on the entire domain of the original picture I1 to highlight the larger light intensity values, and obtain the image I2; Use the Otsu algorithm to perform binaryzation operation on the image I2 to obtain the image I3; Find the connected region with the largest area and centroid to obtain the light source contour and the center point A; Detecting the foreground object in the image space and determining the foreground object contour and center point includes the following steps: Remove the light source contour from the image I1 , forming the image I4; Use the Otsu algorithm to perform binaryzation operation on the image I4 to obtain the image I5; Find the connected region with the largest area and centroid to obtain the contour of the foreground object and the center point B; Traversing each point of the foreground object in the image space to form a complete shadow area includes the following steps: Traverse each point of the foreground object contour , construct a straight line , taking the center point A as a reference, construct parallel lines , and obtain the intersection points with the light source contour ; Search for the set of lowest brightness points on the extension of and select the element with the maximum gradient value from the set as ; ; Traverse each point of the foreground object , for each point Repeat the above steps to form a complete shadow area .

2. The automatic shadow elimination method for indoor and outdoor digital images for unattended use according to claim 1, characterized in that, Enhancing the brightness of the shadow area includes the following steps: Expand the shadow contour S of the shadow area outward by a distance d to obtain the outer shadow contour L; Shrink the shadow contour S of the shadow area inward by a distance d to obtain the inner shadow contour I; Statistically calculate the average value of pixels on the outer contour L of the shadow as the average value of the illuminated area image; Statistically calculate the mean value of pixels on the inner-shrunk contour I of the shadow , which serves as the mean value of the shadow area image; According to the mean value , calculate the brightness amplification ratio r of the shaded area image; Traverse each pixel in the shadow area, multiply the brightness value of the pixel by r, and limit the pixel value range between 0 and 255.

Citation Information

Patent Citations

  • Method and apparatus for removing of shadows and shadings from texture images

    US20050212794A1

  • Cooperative vision-range sensors shade removal and illumination field correction

    US20150199579A1