1 Introduction

The IR images are useful for a lot of applications such as military and civilian applications, especially health-care, battlefield surveillance, and traffic control applications. Fuzzy IR image enhancement has been considered to achieve contrast improvement and clear edge details in IR images. This technique enhances and optimizes the IR images for haze removal. An average filtering process is utilized for the estimation of coarse transmission rate. Then, it is possible to obtain the fuzzy-free image through a self-adaptive process based on the statistics of the original IR image. This strategy enables background suppression [12, 13, 25].

Several methods have been presented for IR image enhancement. One of such methods is the bilateral filter. Inspired by the bilateral filter, two adjacent images were utilized to compute kernel functions to recognize the details of the raw image. The researchers resolved a new kernel function to change the joint-bilateral filter and to decrease the gradient reversal artifacts reasoned by the non-linear filtering. This kernel depends on an adaptive coefficient to realize the details of images. The enhanced details are combined with the original IR images in a fine tuning process [1,2,3, 5, 9, 10, 14, 16,17,18, 21, 22].

Night vision systems have been widely applied in several fields such as military, law enforcement, hunting, wild-life observation, surveillance, security, navigation, hidden-object detection and entertainment. Night vision equipments have evolved from bulky optical instruments in light-weight goggles through the advancement of image intensification technology. Night vision technology that allows one to see in the dark is one of the most fascinating technologies in use today. The various low-light problems are the basic reasons for increasing the accidents at night [4, 6,7,8, 11, 15, 19, 20, 23, 24]. So, there is a bad need to develop image enhancement algorithms for night vision IR images. 

The proposed approaches in this paper are based on gamma correction with HM and CLAHE. Section 2 gives an explanation of the histogram equalization. Section 3 presents the gamma correction. Section 4 presents the first proposed approach. Section 5 presents the second proposed approach. Section 6 gives the performance evaluation metrics. Section 7 gives the simulation results. Finally , section 8 gives the conclusion.

2 Motivation and related works

This paper gains its motivation and importance from the research topic and nature of images that are used [3, 5, 12,13,14, 17, 21, 25]. The proposal is based on a hybrid approach of gamma correction with CLAHE and HM that can be used for a very wide range of applications [1, 2, 9, 10, 15,16,17,18, 22]. Compared to the most relevant work [1, 2, 4, 6,7,8,9,10,11, 15, 16, 18,19,20, 22,23,24], the proposed work is evaluated from the entropy, average gradient, sobel edge magnitude, contrast improvement factor and computation time perspectives. The proposed work can be classified into two approaches. The first is based on HM and the second depends on CLAHE. It is clear that the obtained results in this paper are better than those of the previous work as shown in the Tables 1 and 2 for two cases.

Table 1 Results of the first experiment with the two proposed approaches
Table 2 Results of  the second experiment with the two proposed approaches

3 Histogram equalization method

Histogram is indicated as the graphical distribution of pixels over the intensity. We can do modifications of histogram to correct the contrast of under-exposed and over-exposed images. The histogram equalization is a way to improve images. It is utilized to make the output gray levels uniformly distributed from the minimum to the maximum levels. This method provides global contrast enhancement of a lot of images. Through this adaptation, the intensities can be better distributed on the histogram [13].

This method permits for regions of lower local contrast to attain a higher contrast without affecting the global contrast. The histogram equalization is achieved by spreading out the ordinary intensity values. This way is useful for images with backgrounds and objects which are either bright or dark. This algorithm can be viewed as a way in which the histogram is modified by spreading the gray levels. This can be approximated by the probability of occurrence of gray level rk in an image as follows [3, 5, 14, 17, 21, 25].

$$ {p}_k\left({r}_k\right)=\frac{n_k}{n}\kern1em $$
(1)
$$ {\displaystyle \begin{array}{l}{s}_k=T\left({r}_k\right)=\sum \limits_{j=0}^k{p}_r\left({r}_j\right)\\ {}\kern1em \end{array}} $$
(2)

where rk and sk refer to the gray levels of the input and output (processed) images, respectively, k = 0,1,…,L-1. .

4 Gamma correction technique

The Gamma correction is the name of a nonlinear operation used to encode and decode luminance values in video or still image systems. Gamma correction is defined by the following relation [2, 9, 10, 15, 16, 18, 22]:

$$ v=c{f}^{\gamma } $$
(3)

where c is a constant, f is the original infrared night vision image, and v is the enhanced infrared image. The γ is a positive constant indicating the gamma value.

5 The first proposed approach

This approach depends on merging the gamma correction with the HM as a tool to enhance the IR images. Generally, visible images have better distributed histograms compared to infrared images, which have very band-limited histograms. If we think of modifying the histogram of the infrared image to be spread over the range of a visible image, the IR image would be enhanced visually. This process is well-known as HM. It can be carried out through modification of the picture statistics such as the mean and variance of the IR image based on their counterparts in the visual image.

The steps of the first proposed approach depend on merging gamma correction with the HM of the IR image to a visual image and are summarized as follows:

  1. 1.

    Pick the IR night vision image from the camera

  2. 2.

    Apply gamma correction on IR night vision image as indicated in Eq.(3)

  3. 3.

    Compute the mean of the resultant image g(m, n)

    $$ \hat{g}=\frac{1}{MN}\sum \limits_{m=1}^M\sum \limits_{n=1}^N\mathrm{g}\left(m,n\right) $$
    (4)

    where M and N are the dimensions of the IR image.

  1. 4.

    Compute the mean of the reference visual image f (k, l).

    $$ \hat{f}=\frac{1}{KL}\sum \limits_{k=1}^K\sum \limits_{l=1}^Lf\left(k,l\right) $$
    (5)

    where K and L are the dimensions of the reference image.

  1. 5.

    Estimate the standard deviation of the resultant image from gamma correction, σ1.

    $$ {\sigma}_1=\sqrt{\frac{1}{MN}\sum \limits_{m=1}^M\sum \limits_{n=1}^N{\left(g\left(m,n\right)-\hat{g}\right)}^2} $$
    (6)
  1. 6.

    Estimate the standard deviation of the reference image, σ2.

    $$ {\sigma}_2=\sqrt{\frac{1}{KL}\sum \limits_{k=1}^K\sum \limits_{l=1}^L{\left(\ f\left(k,l\right)-\hat{f}\ \right)}^2} $$
    (7)
  1. 7.

    Estimate the correction factor C by dividing the standard deviation of reference image by the standard deviation of the gamma-corrected IR image.

$$ C=\frac{\sigma_2}{\sigma_1} $$
(8)
  1. 8.

    Compute a modified mean fc

$$ {f}_c=\hat{f}-C\cdot \hat{g} $$
(9)
  1. 9.

    Estimate the histogram matched image FH

$$ {F}_H={f}_c+f\cdot C $$
(10)

6 The second proposed approach

The second proposed approach is concerned with enhancement of IR images based on merging gamma correction with the CLAHE. The conventional histogram equalization does not adapt to local contrast requirements. Minor contrast differences can be entirely missed, when the number of pixels falling in a particular gray range is relatively small. An adaptive technique to avert this drawback is block-based processing for histogram equalization.

The steps of the proposed approach can be summarized as follows:

  1. 1.

    Apply gamma correction on the IR night vision image with Eq.(3)

  2. 2.

    Divide the resultant image into overlapping blocks

  3. 3.

    Estimate the histogram and apply histogram equalization on each sub-image or block.

  4. 4.

    Apply a clip limit to overcome the noise problem and limit the amplification of noise by clipping the histogram at a value before computing cumulative distribution functions to get the IR enhanced image.

The CLAHE has two key factors: block size and clip limit. These factors are used to adapt the image quality. The clip limit β is obtained by following equation:

$$ \beta =\frac{MN}{L}\left(1+\frac{\alpha }{100}\left({S}_{max}-1\right)\right) $$
(11)

where α is a clip factor, M and N are the dimensions of the IR image, L is the maximum intensity level of the image, and Smax is the maximum of the new distribution after the histogram equalization.

7 Performance evaluation quality metrics

This section presents the quality metrics used for the valuation of the enhancement results after histogram equalization, histogram matching, and CLAHE. These metrics include entropy (E), spectral entropy (Ef), average gradient (AG), and Sobel edge magnitude (∇f) . These metrics are evaluated as follows [10, 22]:

$$ E=\sum \limits_{i=0}^{255}-{p}_i{\log}_2\left({p}_i\right) $$
(12)

where E is the entropy of the IR image, 255 is the maximum level for an 8-bit gray-scale image. The larger the number of levels in an image, the higher is the entropy. pi is the probability of occurrence of pixels having intensity ‘i’ in the image. Suppose that the number of pixels having intensity ‘i’ is ni and that the image contains n  pixels\( , \kern1em {p}_i=\raisebox{1ex}{${n}_i$}\!\left/ \!\raisebox{-1ex}{$n$}\right. \).

The spectral entropy is computed in the discrete cosine transform (DCT) domain on a block-by-block basis as described in Fig. 1. It is a function of the probability distribution of the local DCT coefficient values. This probability distribution function (PDF) is given by the following equation [11, 19, 24]:

$$ p\left(i,j\right)=\frac{c{\left(i,j\right)}^2}{\sum_i{\sum}_jc{\left(i,j\right)}^2} $$
(13)

where 1 ≤ i ≤ 8, 1 ≤ j ≤ 8, i, j ≠ 1, and c(i, j) represents the DCT coefficients.

Fig. 1
figure 1

Evaluation scheme of the proposed approaches based on spatial and spectral entropies

The local spectral entropy is defined as [11, 19, 24]:

$$ {E}_f=-\sum \limits_i\sum \limits_jp\left(i,j\right){\log}_2p\left(i,j\right) $$
(14)

where p(i, j) is the estimated PDF.

$$ AG=\frac{1}{mn}{\sum \limits}_{x=1}^m{\sum \limits}_{y=1}^n\sqrt{\frac{\left({\left(\frac{\partial f}{\partial x}\ \right)}^2+{\left(\frac{\partial f}{\partial y}\ \right)}^2\right)}{2}\kern0.50em } $$
(15)

where AG is the average gradient of the IR image, f(x, y) is the original IR image, m × n is the size of the IR image

$$ \nabla f=\sqrt{{f_x}^2+{f_y}^2\kern0.75em } $$
(16)

where ∇f is the Sobel edge magnitude, fx and fy are the horizontal and vertical derivative approximations, respectively (Fig. 2).

Fig. 2
figure 2

The masks used to obtain horizontal and vertical derivative approximations

8 Simulation results

This section presents several simulation experiments executed on four IR images. These results adopt a strategy of presenting the original IR images with their enhanced versions using the histogram equalization, the first proposed approach and the second proposed approach. The results of two cases are given in Figs. 3 and 4. The first proposed approach depends on a hybrid structure of gamma correction with HM that uses a reference visual image. The second proposed approach is concerned with enhancement of IR images based on merging gamma correction with the CLAHE. Simulation experiments show that the first proposed approach is better than the second proposed approach from the computation time perspective. On the other hand, the second proposed approach is better from the quality perspectives. Result analysis can be performed with the aid of Tables 1 and 2.

Fig. 3
figure 3

Results of the first experiment

Fig. 4
figure 4

Results of the second experiment

The strategy of quality evaluation based on spectral entropy depends on estimating the entropy of each block in the DCT domain. The distribution of entropy values is estimated and compared with the similar distribution for the original image. The spreading of the distribution is a good indicator for better spectral quality of the enhanced image. The obtained results are shown in Figs. 5 and 6.

Fig. 5
figure 5

Distribution of block spectral entropy for the second experiment (a) after the gamma correction  (b) after the HE (c) after the first proposed approach (d) after the HM (e) after the CLAHE (f) after the second proposed approach

Fig. 6
figure 6

Distribution of block spectral entropy for second experiment (a) after the gamma correction (b) after the HE (c) after the first proposed approach (d) after the HM (e) after the CLAHE (f) after the second proposed approach

9 Conclusion and future work

This paper presented two approaches for IR night vision image enhancement depending on gamma correction. The first approach is based on a hybrid structure of gamma correction with HM, and the second one is based on merging gamma correction with CLAHE. The HM is based on a reference visual image. Simulation results revealed that the first proposed approach gives superior results to those of the second one from the computation time perspective. On the other hand, the second one is better from the quality metrics perspectives. In the future work, we will consider deep learning models for object detection from IR images.