# Document Image Shadow Removal Based on Illumination Correction Method
## 1 Introduction  
With the widespread use of smartphones and tablets, mobile devices have become the preferred tools for scanning and saving digital documents. They offer great convenience, allowing users to capture document images anytime, anywhere, and swiftly convert them into digital formats for storage and transmission. However, shadows often appear when using a mobile device to photograph documents due to unfavorable lighting conditions or angle issues, affecting document clarity and readability [1, 2]. In particular, when dealing with text-intensive files, the presence of shadows can disrupt information interpretation and subsequent processing, such as applications of optical character recognition (OCR), potentially leading to inaccurate or erroneous information extraction [3, 4, 5]. Some document images with shadows are shown in Figure 1. Therefore, shadow removal from document images is crucial, as this not only enhances the overall quality and appearance of documents but also contributes to more efficient data processing and management. The current research on shadow removal has achieved some good results in natural scenes. However, these methods often lack flexibility and adaptability when dealing with shadows in document images, so there are obvious limitations in terms of robustness and generalization. Shadows in document images not only interfere with textual clarity and the overall visual appearance of the image but can also negatively affect subsequent processing processes such as OCR [6; 7; 8]. For example, shadows can lead to mistaken character recognition or missing text information, which can affect document processing accuracy and efficiency. Therefore, effectively removing shadows in document images and providing clear and accurate images for subsequent processing have become key issues in the field of image processing. At present, there is a lack of shadow removal methods, specifically for document images [9; 10; 11]. Most directly learn each pixel value after shadow removal, which ignores the optical principle of shadow formation, and the resulting performances are not satisfactory. Shadow formation is an optical phenomenon, and its physics involves the straight-line propagation of light [12]. Normally, light travels in a straight line. When light encounters an opaque object, part of the light is blocked because it cannot penetrate this object, resulting in the formation of an area behind the object that is not directly illuminated by the light, i.e., the shadow. Shadow shapes and sizes depend on several factors: the size and shape of the light source, the relative position of the light source to the object, and the distance between the object and the projection plane. Based on imaging physics, as shown in Equation (1), a shadow-free image consists of two parts: direct light, where the light source shines directly on the object and ambient light, which is the light that diffusely reflects on the object. \[I_{(x,y)}^{shadow-free}=L_{(x,y)}^{d}R_{(x,y)}+L_{(x,y)}^{a}R_{(x,y)} \tag{1}\]  
where superscript \(shadow-free\) and subscript \((x,y)\) denote the shadow-free image and pixel coordinator, respectively. Scalar \(I\), \(L^{d}\), \(L^{a}\), and \(R\) denote pixel value, direct illuminance, ambient illuminance, and reflectance, respectively. Because the occluder blocks direct light, the shadow area is only illuminated by ambient light. Moreover, the occluder may also block some ambient light, so it multiplies by an attenuation factor, as shown in Equation (2)  
\[I_{(x,y)}^{shadow}=a_{(x,y)}L_{(x,y)}^{a}R_{(x,y)} \tag{2}\]  
where superscript \(shadow\) denotes the shadow image, scalar \(a\) denotes attenuation factor. Figure 1: Examples of document images with shadows. According to the physical principle of shadow formation, shadow removal is a regular process, and it is much simpler for us to learn the correction law of light in the network than the pixel value of the shadow-free image.