Removing Shadows from Images of Documents
In this work, we automatically detect and remove distracting shadows from photographs of documents and other text-based items. Documents typically have a constant colored background; based on this observation, we propose a technique to estimate background and text color in local image blocks. We match these local background color estimates to a global reference to generate a shadow map. Correcting the image with this shadow map produces the final unshadowed output. We demonstrate that our algorithm is robust and produces high-quality results, qualitatively and quantitatively, in both controlled and real-world settings containing large regions of significant shadow.
KeywordsDocument Image Background Color Shadow Region Binarization Method Ground Truth Image
This work was supported in part by NSF awards IIS-1321168 and RI-1619376 and by a gift from Adobe. We thank Daniel Oliveira for providing code to run comparisons. The images in Figs. 3, 5 and 6 were used through the Creative Commons 2.0 License without modification. The title and photographers from Flickr (unless otherwise noted) in order of appearance are: Open Textbook Summit 2014 by BCcampus_News, Army in the Shadows, Army in the Light by Cuzco84, That Please by Kimli, Medieval text in the Christ Church Archive by -JvL-, Untitled by Jacek.NL, Cartmel Priory by Rosscophoto, Transfer Damaged Textbook by Enokson, Untitled by Colin Manuel, find by PHIL, Declaration of Independence photo by taliesin at Morguefile.com (Morguefile License), and Momofuku - Menu w/ Shadow puppets by Lawrence. Please see supplementary materials for links to the images and license.
- 2.Gong, H., Cosker, D.: Interactive shadow removal and ground truth for variable scene categories. In: Proceedings of the British Machine Vision Conference. BMVA Press (2014)Google Scholar
- 8.Zhou, T., Krahenbuhl, P., Efros, A.A.: Learning data-driven reflectance priors for intrinsic image decomposition, pp. 3469–3477 (2015)Google Scholar
- 9.Sunkavalli, K., Matusik, W., Pfister, H., Rusinkiewicz, S.: Factored time-lapse video. ACM Trans. Graph. 26 (2007). Proceedings of the SIGGRAPHGoogle Scholar
- 10.Abrams, A., Hawley, C., Pless, R.: Heiometric stereo: shape from sun position. In: European Conference on Computer Vision (ECCV) (2012)Google Scholar
- 12.Zhang, L., Yip, A.M., Tan, C.L.: Removing shading distortions in camera-based document images using inpainting and surface fitting with radial basis functions. In: 9th International Conference on Document Analysis and Recognition, ICDAR 2007, 23–26 September, Curitiba, Paraná, Brazil, pp. 984–988 (2007)Google Scholar
- 14.Acrobat, A.: Enhance document photos captured using a mobile camera (2016). https://helpx.adobe.com/acrobat/using/enhance-camera-images.html
- 15.Otsu, N.: A threshold selection method from gray-level histograms. Automatica 11, 23–27 (1975)Google Scholar
- 18.Pilu, M., Pollard, S.: A light-weight text image processing method for handheld embedded cameras (2002)Google Scholar
- 19.Shi, Z., Govindaraju, V.: Historical document image enhancement using background light intensity normalization. In: 2004 Proceedings of the 17th International Conference on Pattern Recognition, ICPR 2004, vol. 1, pp. 473–476. IEEE (2004)Google Scholar
- 21.Wagdy, M., Faye, I., Rohaya, D.: Fast and efficient document image clean up and binarization based on retinex theory. In: 2013 IEEE 9th International Colloquium on Signal Processing and its Applications (CSPA), pp. 58–62. IEEE (2013)Google Scholar
- 23.Pratikakis, I., Gatos, B., Ntirogiannis, K.: ICDAR 2013 document image binarization contest (DIBCO 2013). In: 2013 12th International Conference on Document Analysis and Recognition (ICDAR), pp. 1471–1476. IEEE (2013)Google Scholar