Published in compu.philica.com
Recently, we have discussed the use of GIMP Retinex, a filter of the GNU Image Manipulation Program, for enhancing images in several applications, ranging from those obtained by microscopes to the images coming from satellites. Retinex can also enhance foggy images: here we investigate the role of GIMP filter in their thresholding for binarization. Keywords: GIMP Retinex, Image processing, Thresholding, Binarization, Generalized entropies.
In some recent papers [1-3], we have proposed and discussed the use of the GIMP Retinex filter for enhancing images. Retinex methods, such as that used for the tool of the GNU Image Manipulation Program, had been developed to solve some experimental observations. These experiments are concerning the fact that it is easy to find discrepancies between an image we have recorded by a camera and the real scene we have observed. The reason is that humans are able to see details both in the shadows and in the nearby illuminated areas, whereas a photograph of the same scene is showing either the shadows as too dark or the bright areas as overexposed . In fact, some peculiar features of human vision concerning colours, brightness and contrast of a scene, are quite different from those of recording devices [5,6].
Several algorithms of image processing had been developed, inspired by the human vision biological mechanism to adapt itself to these conditions: these methods are known as Retinex models. The first algorithm was conceived by Edwin H. Land, an American scientist and inventor, best known as co-founder of Polaroid Corporation [7-11]. As explained in Ref.4, through the years, Land evolved several models, until his last one proposed in 1986. The term “retinex” was coined by Land himself, combining the words “retina” and “cortex”, to indicate the results of his researches, that human colour perception is involving all levels of vision processes, from the retina to the cerebral cortex.
Several Retinex approaches exist [6,12]: the single-scale Retinex (SSR), the multiscale Retinex (MSR), and, for colour images, the MultiScale Retinex with Colour Restoration (MSRCR). GIMP Retinex is a freely available tool of this last family, developed by Fabien Pelisson . The resulting image of this filter can be adjusted selecting different levels, scales and dynamics. In this tool, there are three “levels”: uniform, which tends to treat both low and high intensity areas fairly, low, that “flares up” the lower intensity areas on the image, and high that tends to “bury” the lower intensity areas in favour of a better rendering of the clearer areas of the image. The “scale” determines the depth of the Retinex scale. Minimum value is 16, a value providing gross, unrefined filtering. Maximum value is 250. Optimal and default value is 240. A “scale division” determines the number of iterations in the multiscale Retinex filter. The minimum required, and the recommended value is three. The “dynamic” slider allows adjusting colour saturation contamination around the new average colour (default value is 1,2).
In the Figure 1, an example of Retinex filtering of a foggy image is proposed: (a) is showing the original image, (b),(c) e (d) are giving the outputs after GIMP Retinex filtering (scale:240, scale division:3, dynamic:1,2). In (b) the level is uniform, in (c) low and in (d) high. We can see immediately the enhancement of the visibility of objects, which are present in the image. In (b) and (c) we have also a strong enhancement of colours.
Images, which are obtained when there are foggy weather conditions, have poor contrast and strong loss of colour characteristics. Several methods had been proposed to improve them (see [14-16] and references therein). However, to restore contrast and colours, GIMP Retinex can be a good answer, as shown by Figure 1, and in fact, some Retinex algorithms for foggy images had been proposed too [17-19]. Let us consider that an algorithm able of improving foggy images can be quite important, for instance, to process the images recorded by cameras on-board of cars, to find objects on the road and estimate their visibility distance . However, if we want an algorithm able of distinguish automatically an object from the background, such as an obstacle on the road, we need some segmentation of the image, able of partitioning it in areas containing the objects and in areas pertaining to the background.
The simplest approach to segmentation is that of changing an image into a binary one in black and white. The resulting binary image is useful if it is able of showing the objects as black and the background as white. A binary image can be produced by means of a bi-level thresholding, which is replacing each pixel (i,j) of it with a black pixel if pixel intensity I(i,j) is less than some fixed constant T (that is, I(i,j) < T), and with a white pixel if the intensity is greater than that constant. The result depends on the value of threshold T. To choose the best value of T, one of the most used approaches is that of maximizing the entropy of the image .
In the Figure 2, we can see an example of thresholding of a foggy image. The original image shows a suburban street. As told in its caption on Wikipedia (en.wikipedia.org/wiki/Fog), even a light fog is able reducing visibility, rendering the cyclist very hazy at about 200 m. A Retinex low level filtering, (with scale:240, scale division:3, dynamic:1,2), improves the visibility. This is quite clear when we apply a bi-level thresholding. With T=127, the original and the Retinex appear as in the middle panels of Figure 2. The cyclist is visible in the binary image of the Retinex image, not in the binary image of the original one. Using the original image, to see the cyclist we have to rise the threshold to the value of 193, wasting the visibility of the road. In the lower right panel we can see a thresholding, with T= 175, of the Retinex image. The result is less sensitive to the value of T. Another example of the role of Retinex filtering on the thresholding of foggy images is given in the Figure 3.
The two proposed examples, and several others we have tested, are showing that it could be interesting to investigate, in more detail and quantitatively, the role of GIMP Retinex filtering in determining the best threshold for an image segmentation. This could be relevant for those applications, which are devoted to the enhancement of foggy images. The combined use of a Retinex method and thresholding had already demonstrated to work well for optical character recognition systems and document analysis .
Figure 1 – Panel (a) is showing the original image (Courtesy: Ian Furst, Wikipedia, Tree in field during extreme cold with frozen fog). The other three images are giving the outputs after GIMP Retinex filtering (scale:240, scale division:3, dynamic:1,2). In (b) the level is uniform, in (c) low and in (d) high. Note the enhancement of the visibility of the objects, which are present in the image. In (b) and (c) we have also a strong enhancement of colors.
Figure 2 - The original image in the left-upper panel, (Courtesy: Ian W. Fleggen, Wikipedia, 20880313, Foggy Street), shows a suburban street. As told in the caption of Wikipedia, even a light fog is able reducing visibility, rendering the cyclist very hazy at about 200 m. A Retinex low level filtering, (with scale:240, scale division:3, dynamic:1,2), improves the visibility (right-upper panel). Let us apply a bi-level thresholding. With T=127, the original and the Retinex images appear as in the middle panels. The cyclist is visible in the Retinex image. Using the original image, to see the cyclist we have to rise the threshold to the value of 193, but in this case, we are wasting the visibility of the road. In the right-lower panel we can see a thresholding, with T= 175, of the Retinex image.
Figure 3 - Here another example of thresholding on a low quality image. On the right, we have the result of a Retinex low level filtering, (with scale:240, scale division:3, dynamic:1,2). Let us apply a bi-level thresholding, with T=127. Note the different result: car and road are visible in the binary image of Retinex image.
Amelia Carolina Sparavigna, Department of Applied Science and Technology, Politecnico di Torino, Torino, Italy
Information about this Article
This Article has not yet been peer-reviewed
This Article was published on 8th September, 2015 at 11:42:42 and has been viewed 2153 times.
This work is licensed under a Creative Commons Attribution 2.5 License.
The full citation for this Article is:|
Sparavigna, A. (2015). Retinex filtering and thresholding of foggy images. PHILICA.COM Article number 511.