• Nem Talált Eredményt

The Effect of the Diffusion Coefficient Hysteresis on the Smoothing Properties of the Heat

1.3 PDE-B ASED I MAGE S MOOTHING

1.3.1 The Effect of the Diffusion Coefficient Hysteresis on the Smoothing Properties of the Heat

This sub-section concerns the filtering effects provided by the nonlinear heat equation.

The diffusion coefficient is considered to be a hysteresis function of the pixel intensity varied in time. The hysteresis is approximated by the Preisach hysteresis model [57]

with Gaussian distribution. With this diffusion coefficient function hot or cold regions can be outlined in the thermal image. The smoothing effect can be influenced by the shape of the hysteresis curve. After filtering, regions with a higher diffusion coefficient can be significantly more blurred than regions with a lower diffusion coefficient. The cold regions of the thermal image can be preserved with a hysteresis curve that increases with increasing intensity, while with a decreasing curve the hot regions can be outlined. If the intensity of an image pixel is changed, the corresponding diffusion coefficient follows the hysteresis major or minor loops. The recursive form of the Preisach-operator in (4) is simplified by neglecting the cycle number ν for the diffusion

( ) ( ) (

I I

)

, i,j P, i j m weighting function and b is an appropriate multiplier introduced to normalize the diffusion coefficient function to c

( )

I

[ ]

0,1 . The sign on the right-hand side depends on the direction of the intensity change.

1.1.1.1 Quantifying the Image Quality

For the sake of comparison of raw and smoothed images, I tried to find a measure by which the image quality can be quantified. Assuming that the aim of smoothing is to transfer the grey scale image to a binary image, i.e. the thermal image has to be classified into some hot and cold regions. This so called image binarization is one of the main techniques for image segmentations [60]. Image binarization converts a gray scale image to a black and white image. Binary images can be used as the input for several morphology algorithms. Binarization is not easy even when the image quality is very good. The grey level intensity of an image pixel can be defined as both cold (for example black) and hot (for example white) to certain degrees of the two attributes respectively. There is even more uncertainty when the image quality is not so good or possesses some noise represented as fuzziness, therefore the linear index of fuzziness could be employed for qualifying images [128]. The index of fuzziness reflects an image quality as a quantitative measure. The degree of fuzziness expresses the average amount of ambiguity in making a decision whether a pixel belongs to a predefined set or not. This measure γl has the following properties: γl(I)=0 if Iij =0or 1, 1γl(I)= if index is zero in the case of black and white images. If the entire image is on the mean grey level, the index is at the maximum value. A large value indicates that the pixel-based segmentation has to be rejected.

The other important technique for comparing images is the peak signal-to-reconstructed image measure, which is called PSNR. PSNR in decibels (dB) is computed by using:

(

R RMSE

)

log

PSNR=20 10 , (23)

where R is the maximum fluctuation in the input image data type and RMSE is the Root Mean Squared Error between the compared images. The higher the value of PSNR, the more similar the compared images are.

1.1.1.2 Filtering Results

Thermal images, especially with low temperature differences could be very noisy, as can be seen in Fig. 16a, where an IR image of a corrosion crack is plotted. The background and the relevant areas are equally smoothed with Gaussian isotropic diffusion, and fuzziness increases, see Fig. 16b. The image smoothed with a PM-type edge preserving filter is shown in Fig. 16c and the corresponding diffusion coefficient field is in Fig. 16d. The coarse level iteration parameterized according to cmaxΔt h2 <1 has to be fulfilled. The diffusion coefficient for Gaussian smoothing is cG =1 and time steps are k =3 in most examples, and only exceptions are given directly. In this study the PM diffusion coefficient function was used in the form c

( )

I =exp

( (

I K

)

2

)

with a constant value of K =0.1 for normalized range of pixel intensities I

[ ]

0,1 .

65

l=0.

γ

b)

62

l =0.

γ

a)

62 .

=0 γl

c)

26

l=0.

γ

d)

Fig. 16. Top: images with index of fuzziness, bottom: their histograms, a) the original image, b) result of the Gaussian low-pass filter c) result of the PM filter and d) the corresponding diffusion coefficient field

By selecting the diffusion coefficient function in the form of hysteresis that can be seen in Fig. 17, the region of the corrosion could be preserved while intensity variations of the other areas can be attenuated. Depending on the sample prehistory, the initial diffusivities can be fitted into the main increasing or decreasing curves. The hysteresis characteristic of the function prevents the adaptation of the diffusion coefficient when the direction of the intensity changing is opposite to the direction of the main hysteresis curves.

After using the same time steps as the linear filtering, the background has been smoothed without blurring the relevant area. Supposing initial diffusivities on the increasing main hysteresis curve, image in Fig. 18a is the result of the smoothing process and Fig. 18b shows the corresponding diffusion coefficient distribution. If the initial diffusivities

result of the filtering with diffusion coefficient field shown in Fig. 18d. The background is well smoothed but the dark region is preserved due to the low diffusion coefficient.

The index of fuzziness has the lowest value when it is calculated from the diffusion coefficient field. This image is close to a binary image.

0 0.2 0.4 0.6 0.8 1

0 0.5 1

Intensity

Diffusion coefficient

main heating curve main cooling curve

Fig. 17. The hysteretic diffusion coefficient function with Gaussian weighting function, σ1 =σ2 =0.1

Analysing the histograms of the linear and the nonlinear smoothed images, main differences appear in high and low intensity regions. The histogram of the image in Fig. 16b shows that the convolution with Gaussian kernel equally suppresses the oscillations in the whole domain. The magnitudes of the histogram over the highest intensities are better dampened with the nonlinear filter, i.e. fewer pixels have high intensity after hysteretic diffusion, but the magnitudes of lower intensities are preserved.

62

l =0.

γ γl =0.20 γl =0.63 γl=0.10

Fig. 18. Smoothed image by hysteretic diffusion with fuzziness indexes and histograms, a) starting from the increasing curve, b) the corresponding diffusion coefficient field, c) starting from the decreasing

curve, d) the corresponding diffusion coefficient field

The threshold, for example, with a clustering algorithm [60] produces binary images.

The clustered original image is not useful, see Fig. 19a. The Gaussian smoothed image overestimates the corroded area that can be seen in Fig. 19b. The thresholded hysteretic

smoothed images can be seen in Fig. 19c and Fig. 19d. The nonlinear diffusion highlights the relevant intensity regions while degrading the other areas with intensive smoothing. In the background area, the diffusion coefficient is high so the high spatial frequency oscillations are dampened with both methods. Over the crack, the values of diffusion coefficient are low. In this domain, intensities after the hysteretic diffusion remain closer to the original image.

Fig. 19. Thresholded images: a) original; b) Gaussian smoothed, c) initial diffusivities are on the increasing curve and d) on the decreasing curve

The values of PSNR between the original and smoothed images are shown in the Table I. The PSNR measure quantifies the difference between the original image and the smoothed one. Results of the hysteresis diffusions are more similar to the result of the PM filter than to the result of a low-pass filter. The intensive diffusion reduced the values of PSNR between the original and the smoothed images.

The nonlinear diffusion filter improved the visual quality of the image. It can be seen that the hysteretic diffusion and the low-pass filter are similar in effectiveness to each other in the non-interested (background) region. Background region is better homogenised with these filters than with the PM filter. On the contrary, the region of crack is better retained and enhanced with the intensity dependent nonlinear diffusion and with the PM filter, due to the low values of diffusion coefficient. The intensity dependent nonlinear diffusion combines the advantageous characteristics of homogeneous and edge preserving diffusions.

Table I.

PSNR in dB between the original and smoothed images

Hyst-up Hyst-down Gauss PM Original

Hyst-up 38.3 32.6 34.4 23.9

Hyst-down 31.8 33.8 24.9

Gauss 29.3 22.8

PM 25.3

The next example is an IR image of a heat sink inside a PC. The original image, the histogram and the index of fuzziness are shown in Fig. 20a. The Gaussian smoothed

image is plotted in Fig. 20b, the PM smoothed image is in Fig. 20c and the corresponding diffusion coefficient field is shown in Fig. 20d.

60

l =0.

γ 55

l =0.

γ

c)

58 .

=0

γl γl =0.4

d)

Fig. 20. a) IR image of a heat sink, the index of fuzziness and the histogram, b) result of the Gaussian filter c) result of the PM filter and d) the corresponding diffusion coefficient field

If the most heated regions have to be highlighted, the shape of the hysteresis curve has to be reversed so diffusion must be intensive at a low temperature region and gentle in the high temperature region, see Fig. 21.

0 0.2 0.4 0.6 0.8 1 0

0.5 1

Intensity

Diffusion coefficient

main heating curve main cooling curve

0.1

Fig. 21. Diffusion coefficient function decreases with intensity increase, Gaussian weighting function with σ1 =σ2 =0.2

Assuming initial diffusivities on the main heating curve, the smoothed image and the corresponding diffusion coefficient field are shown in Fig. 22. Details of the most heated regions are retained but other areas are blurred. Assuming initial diffusivities started from the main cooling curve, the result of the nonlinear filtering can be seen in Fig. 23. It can be seen that the high intensity values are dampened by the Gaussian and the PM filter, but the intensity dependent nonlinear filter does not reduce the sharpness of these regions. Histograms show the distribution differences in the highest and lowest intensity regions. Differences caused by the different initial conditions of the diffusion coefficient can be seen in the histograms as well.

59

l =0.

γ γl =0.44

a) b)

Fig. 22. Image with the fuzziness index and the histogram, a) smoothed image, diffusion coefficient started from the main cooling curve; b) the corresponding diffusion coefficient field

57

l =0.

γ γl =0.23

a) b)

Fig. 23. Image with the fuzziness index and the histogram, a) smoothed image, diffusion coefficient started from the main heating curve; b) the corresponding diffusion coefficient field

The applied diffusion coefficient function denotes the degree of the intensity belonging to a low temperature domain. Cutting the diffusion coefficient field for example at

1 0.

c= , the most heated region can be outlined, see Fig. 24.a and b. These images represent the ambiguity in defining a border to a fuzzy category ‘high temperature domain’. The line profiles at row index 38 are plotted in Fig. 25.

a) b)

Fig. 24. The original image with the regions of diffusion coefficient c 0.1, a) initial diffusivities are on the increasing curve and b) on the decreasing curve

The amplitude of the periodical intensity variation is smoothed with large values of the diffusion coefficient, but at a lower diffusion coefficient range only the high spatial frequency errors are dampened by the hysteretic diffusion coefficient. Not only the amplitude, but the magnitude of the intensity has been dampened by the Gaussian filter and PM filter. Gaussian filter has entirely dampened the highest pixel intensities.

0 10 20 30 40 50 60 70 0.4

0.5 0.6 0.7 0.8 0.9 1

Pixel

Intensity

Raw image Hysteresis PM Gaussian

Fig. 25. Line profiles at the row index 38

Table II.

PSNR in dB between the original and the smoothed images Hyst-up Hyst-down Gauss PM Original

Hyst-up 29.8 28.7 28.3 26.4

Hyst-down 23.6 29.9 33.8

Gauss 27.4 22.2

PM 27.1

It can be seen that very interesting smoothed images can be provided by hysteresis of the diffusion coefficient, the relevant high or low temperature regions can be highlighted while degrading the other temperature regions. In this section I have verified that enhancement of images could be achieved using the proposed diffusion algorithm [62], [64], [70]. The main difficulty is that the diffusion function can be selected only heuristically, there are no general rules to identify the hysteresis parameters. Therefore image smoothing using the presented form of the diffusion coefficient function is not recommended for common praxis. Based on the analysis above, in the next sub-section a simplified but nonlinear remained diffusion coefficient function is introduced. The hysteresis operator is replaced by a fuzzy decision system.

The demands of image enhancement could be defined by an expert. The characteristic function of the fuzzy rule based system corresponds to the diffusion function, i.e. the expert knowledge validates the diffusion function.