1 Introduction

Transformers are integral part of modern power system whose role is to transfer the energy between two electrical networks working at different voltage levels. Because of continuous operation of the power transfer equipment, the winding along with other internal parts are heated up and thus increases the temperature of the transformer [1, 2]. Generally, all power transformers uses mineral oil refined from the crude petroleum as a cooling agent. Transformer oil provides insulation as well as cooling of internal parts of power transformers [3, 4]. The changes in the properties of the transformer oil is largely due to ageing, internal or external stresses may cause interior faults inthe transformer. The performance of cooling is mainly depending on the chemical properties of the oil. Quality of the oil known by colour, viscosity, pour point and fire point properties of transformer oil [5].

An image is a two dimentional picture representing the individual or distinct features such as colour, shape, structure and texture etc. The suitable way of conveyingalong with transmitting any information is possible through picture or image [6]. If desired illumination levels exists either artiricially or naturally then a clear photo can be obtained or captured. Otherwise the photos must be enhanced to anticipated image through digital image preprocessing. Any image filtering techniques of image processing improves the image from undesirable brightness information to useful data that can be readily understandable by human beings as well as concentrate it for machine interactions [7, 8].

Any unwanted data added to image when transmitted through the digital media termed as noise. As a result, the image may get blurred due to improper illumination, dirty spots like dots, speckles and stains [9, 10]. There are many conventional linear and non-linear image filtering approaches are available to eliminate the brightness or darkness in the images [11,12,13]. In this paper, transformer oil images are considered for the analysis. The faults in the internal parts of the tranformer are determined through the quality of the oil. Image processing technique is a non-destructive method to diagnose faults occurred in the transformer insulating oil [14, 15].

The objective of this paper is to enhance the transformer oil images concurrently acquired through the digital camera at different temperatures. For further analysis to preprocess and restore the image, this paper apply mean, median, wiener and non-local means filtering techniques as image pre-processing methods to all the confined images of transformer oil. The numerical results of all these filters are validated through image quality evaluation metrics such as MSE and PSNR.

2 Experimental setup

Figure 1(a)–(o) illustrates the explorative view of the complete study. Figure 1(a)–(c) shows the components used for experimental set up i.e., a 300 ml beaker filled with fresh unused transformer oil, thermocouple and a 300 W heating element. An experiment conducted to test the transformer oil characteristic behaviour by heating the unused fresh transformer oil in a 300 ml beaker with the use of heating element of 300 W to attain temperatures of 30 °C, 60 °C, 90 °C and a maximum temperature of 120 °C. Desired temperatures are measured by immersing K type thermocouple connected to autoranging digital multimeter in the oil. The preferred values of temperatures are multiples of 30 °C and with a minimum temperature of 30 °C. Due to the beaker property in addition to other constraints, the maximum temperature is restricted to 120 °C. Figure 1(d), (g), (j), (m) shows heating of fresh transformer oil to the desired temperatures. The same experiment repeated on the transformer oil along with metal (nails used for the experiment) and also for transformer oil with copper bare conductor coil in addition with metal. Figure 1(e), (h), (k), (n) illustrates heating of fresh transformer oil along with metal nails and Fig. 1(f), (i), (l), (o) demonstrates heating of fresh transformer oil along with metal nails plus conductor coil to previously mentioned temperatures respectively.

Fig. 1
figure 1

(a) Fresh transformer oil in a 300 ml beaker, (b) thermocouple, (c) 300 W heating element rod, (d), (g), (j), (m) an experimental set up with heating of fresh transformer oil to the temperatures of 30 °C, 60 °C, 90 °C and 120 °C, (e), (h), (k), (n) an experimental set up with heating of fresh transformer oil along with metal nails to 30 °C, 60 °C, 90 °C and 120 °C, (f), (i), (l), (o) an experimental set up with heating of fresh transformer oil along with metal nails plus conductor coil to 30 °C, 60 °C, 90 °C and 120 °C

Photographs captured for each experiment using eight-megapixel digital camera. The acquired images are cropped and resized 200 × 200 pixels to get the sample of transformer oil images for the analysis. These raw images captured by camera may be of contrast and corrupted by noise due to variation in the temperature of transformer oil as well as human errors during image acquisition. Henceforth these images are processed through filters to eliminate contrast plus noise in the image.

3 Image preprocessing filtering techniques

Images acquired for different experiments from the digital camera are cropped, resized and transformed into gray image. The following preprocessing filtering methods are used to remove the noise and enhance the image for restoration.

3.1 Mean filter

An average filter called as mean filter [16] improves the pixel value in an image by the mean valuesof the gray scale in the neighbourhood. It is a simple, intutive and easy technique to implement for image enhancement by reducing the variations in the pixel intensities of the image. It often used for smoothing and blurring the image i.e., to reduce noise in images. Let Rxy represents neighborhood sub image window of size m × n, centered at point (x,y). For the gray level of pixel (x,y) in K, the filter replaces the gray level J(x, y) with the surrounding pixel account detail.

$${\text{J}}\left( {{\text{x}},{\text{y}}} \right) = { }\frac{1}{{\text{M*N}}}\mathop \sum \limits_{{u,v \in {\text{R}}_{{{\text{xy}}}} }} K\left( {u,v} \right).$$
(1)

3.2 Median filter

A nonlinear method used to remove noise from the images based on statistics called as median filtering technique [17]. It preserves useful information of the image and the original pixel gray value is switched to median of gray values of pixels in a particular neighbourhood. This filter cuts the noise in an image without blurring the edges of the image. The median is calculated by sorting all the pixel values of neighbourhood window into numerical order and replacing the pixel considered with the middle (median) pixel value. The numerical formula of median filtered image J(x,y) of the image K(u,v) is represented in Eq. (2)

$${\text{J}}\left( {{\text{x}},{\text{y}}} \right) = {}_{{{(}u,v{)} \in {\text{R}}_{{{\text{xy}}}} }}^{{{\text{median}}}} \left\{ {K\left( {u,v} \right)} \right\}.$$
(2)

3.3 Wiener filter

The wiener filter [18] method take out noise from each pixel in an image using statistical approach. It performs an optimal transaction between inverse filtering and noise smoothing. It is a best filter in the process of noise smoothing to reduce the overall MSE. It tries to build an image by imposing a MSE constraint between the estimated and the original image. Wiener filters uses frequency domain for the analysis and some times are unable to reconstruct frequency component which have been degraded by noise. The minimised error demonstrated by Eq. (3) and minimum wiener filter function in frequency domain represented by Eq. (4). Wiener filter instantaneously removes the additive noise and inverting of blurring of image.

$${\text{e}}^{2} = {\text{E}}\left\{ {{\text{J}}\left( {{\text{x}},{\text{y}}} \right){ }{-}\hat{J}\left( {{\text{x}},{\text{y}}} \right)} \right\}$$
(3)
$$\hat{J}\left( {u,v} \right) = \left[ {\frac{1}{{D\left( {u,v} \right)}}\frac{{\left| {D\left( {u,V} \right)} \right|^{2} }}{{\left| {D\left( {u,V} \right)} \right|^{2} + \frac{{P_{\eta } \left( {u,v} \right)}}{{P_{J} \left( {u,v} \right)}}}}} \right]K\left( {u,v} \right)$$
(4)

where D(\(u,v\)), degradation function; \({\left|D\left(u,V\right)\right|}^{2}\), D*(\(u,v\)) = D (\(u,v\)) D*(\(u,v\)); D*(u,v), complex conjugate of D (\(u,v\)); \({P}_{\eta }\left(u,v\right)\), power spectrum of the noise; \({P}_{J}\left(u,v\right)\), power spectrum of the undegraded image.

3.4 Non-local means (NLM) filter

This filter replaces the local comparison of patches by the nonlocal comparison of pixels. This filter does not make any conventions about the location of the best relevant pixels used to de-noise the existing pixel. The NLM filter [19] relates geometrical alignment in a complete neighbourhood as well as the gray values in a single point. In NLM the weight assigned to pixel does not depends on either spatial or intensity distances. The restored intensity \(v\)(i,j) of pixel \(\mathrm{X}\)a is the weighted average of all the pixel intensities u(\(\mathrm{X}\)a) in the image J.

$$NLv\left( {{\text{i}},{\text{j}}} \right) = \mathop \sum \limits_{{{\text{X}}_{{\text{b}}} \in J}} {\text{W}}\left( {{\text{X}}_{{\text{a}}} ,{\text{X}}_{{\text{b}}} } \right){\text{ u}}\left( {{\text{X}}_{{\text{a}}} } \right)$$
(5)

where \(\mathrm{W}\left({\mathrm{X}}_{\mathrm{a}},{\mathrm{X}}_{\mathrm{b}}\right)\) is weight average assigned to value \(\mathrm{u}({\mathrm{X}}_{\mathrm{a}})\) for restoring pixel \({\mathrm{X}}_{\mathrm{a}}\).

4 Image quality evaluation metrics

The assessment of preprocessing techniques for transformer oil captured images are appraised by pixel difference based quality metrics such as MSE and PSNR.

4.1 MSE (mean square error)

The mean square error is a predominant error sensitivity measurement tool to measure difference between the two signals. MSE defined as the square of differences in the pixel values between the corresponding pixels of the two images. In MSE, the error signal ei = ai − bi which is difference between two discrete image signals a and b of finite length N, where ai and bi are ith pixel intensities in a and b and N is the number of pixels in the images. MSE between these two signals is

$${\text{MSE}} = { }\frac{1}{{\text{N}}}\mathop \sum \limits_{{{\text{i}} = 1}}^{N} \left( {{\text{a}}_{{\text{i}}} - {\text{b}}_{{\text{i}}} } \right)^{2}$$
(6)

In this paper, transformer oil gray image is said to be I and it’s filtered image as J. MSE between the two images I and J is

$${\text{MSE}}\left( {{\text{I}},{\text{J}}} \right) = { }\frac{1}{{\text{M*N}}}\mathop \sum \limits_{{{\text{c}} = 1}}^{M} \mathop \sum \limits_{{{\text{d}} = 1}}^{N} \left( {{\text{ I}}\left( {{\text{c}},{\text{d}}} \right) - {\text{J}}\left( {{\text{c}},{\text{d}}} \right)} \right)^{2}$$
(7)

where M * N denotes size of an image, I(c, d) and J(c, d) indicates pixel intensities of original and reconstructed image.

4.2 PSNR (peak signal to noise ratio)

The signal-to-noise ratio (SNR) is the ratio of the signal power to the noise power in a captured image signal. SNR stated as

$${\text{SNR}} = = 10\log_{10} \left( {\frac{{{\text{P}}_{{\text{s}}} }}{{{\text{P}}_{{\text{n}}} }}{ }} \right)^{2} = 10\log_{10} \left( {\frac{{{\text{A}}_{{{\text{signal}}}} }}{{{\text{A}}_{{{\text{noise}}}} }}{ }} \right)^{2}$$
(8)

where Ps, Pn, Asignal and Anoise are signal power, noise power, signal amplitude and noise amplitude respectively. For PSNR, the numerator of Eq. (8) is the square of the peak value that the signal and the denominator equals the MSE (noise variance). The peak error between original and filtered image is measured in terms of PSNR. In image processing the MSE is often expressed as PSNR measure. PSNR of original image I and reconstructed image J is

$${\text{PSNR}}\left( {{\text{I}},{\text{J}}} \right) = 10\log_{10} {\text{R}}^{2} /{\text{MSE}}\left( {{\text{I}},{\text{J}}} \right)$$
(9)

where R ismaximum allowable pixel value. For example, if image has 8 bits for a pixel, then R = 28 − 1 = 255. If PSNR approaches infinity then MSE approaches zero, illustrates that higher value of PSNR results in excellent image quality and vice-versa. In other words, small value of PSNR indicates there is huge numerical difference between the images.

5 Results and discussions

In the experiments, a two dimensional transformer oil images of unused, with metal nail and with metal nail plus conductor coil at 30 °C, 60 °C, 90 °C and 120 °C are considered, and processsed through mean, median, wiener and NLM filters to remove noise. Figure 3(a)–(l) shows the test as well as denoised images. Figure 3(a), (d), (g), (j) are the experimental and filtered images of fresh transformer oil. Similarly Fig. 3(b), (e), (h), (k) are the test as well as enhanced transformer oil images with metal nails and Fig. 3(c), (f), (i), (l) are experimental and denoised transformer oil images with metal nails and conductor coil immersed in it. This paper evalualtes the quality between experimentally acquired image with denoised filtered image through MSE and PSNR, since they can illustrate gray value error contained in the entire image and mathematically tractable. Figure 2 illustrates image quality metric MSE and PSNR curves for all the images considered for the study. It is confirmed from Fig. 3(a)–(l), non-local means filtered images produce best resulted image in comparison with other filtered images. Tables 1 and 2 represents comparison of different preprocessing filtering methods for transformer oil images using MSE & PSNR performance evaluation metrics. Small value of MSE improves image quality and reduces the error. Similarly large values of PSNR demonstrates there are less numerical difference between the pixel intensities between two images. From Fig. 2 and Table 1, MSE for mean filter ranges around 5, for median and wiener filters it ranges near to 0.1 and for NLM filter it ranges approximately near micro values. Similarly from Fig. 2 and Table 2, PSNR for mean filter around 41, for median and wiener filters it ranges between 50 and 60 and for NLM this value is above 95. From the values of MSE and PSNR it can be decided that the NLM filter has better noise removal and get smooth image response compared to mean, median and wiener filters.

Fig. 2
figure 2

MSE and PSNR curves for mean, median, wiener and non-local means filtered transformer oil N, WM, WMC images at 30 °C, 60 °C, 90 °C and 120 °C

Fig. 3
figure 3

Transformer oil original, gray, mean, median, wiener and non-local means filtered images at mentioned temperatures without any additional component, with metal nails and with conductor coil in addition to metal

Table 1 Comparison of different preprocessing filtering methods for transformer oil image using Mean Square Error (MSE) performance metrics
Table 2 Comparison of different preprocessing filtering methods for transformer oil image using peak signal to nois ratio (PSNR) performance metrics

6 Conclusion

The set of experiments performed to acquire the images of transformer oil at 30 °C, 60 °C, 90 °C and 120 °C. Image quality assessment is noteworthy in noise removal of transformer oil images captured from camera at real time desired temperatures. In this paper, the experimental real time transformer oil images are enhanced or preprocessed through mean, median, wiener and NLM filters. The performance of each filter authenticated using MSE and PSNR. Experimental study results reveal that low values of MSE (micro values) and high value of PSNR (above 95) for NLM filter compared to mean, median and wiener filters. Consequently this paper concludes NLM filtering method performance is optimal for transformer oil images compared to other classical filtering methods.