Keywords

1 Introduction

Image enhancement means the technique of improving the visual appearance of an image so that resultant image is more accurate and comprehensive as compared to the original one, as well as, is appropriate for human and machine discernment. This process has application in various fields such as aerial/satellite imaging, bio-medical imaging, remote sensing. It is done to enhance the image’s quality and appearance.

Image enhancement techniques mainly belong to two domains: spatial domain and frequency domain [1,2,3]. In this paper, image enhancement is considered in spatial domain. Spatial domain methods operate at the individual pixel intensities of the image. Main advantage of this method is that they are conceptually simple, comprehensive and lacks complexity which makes them useful in real-time applications. There are two generally used techniques: One is histogram equalization, and other is linear contrast stretching (LCS). Both of them are used to improve images with low contrast. LCS can be accomplished using different techniques as max–min LCS, percentage LCS and piece-wise LCS [4, 5].

Frequency domain methods [2, 3] deal with analysis of mathematical functions with respect to frequency and manipulate transform coefficients such as Fourier Transform. These methods have big advantage like less computationally complex, robust and easy to observe and control frequency spectra of the image. The basic problem with these methods is that these methods cannot be easily automated and cannot enhance all parts of the image. In all these methods, there is subjectivity in judgment about how the image has improved. All these methods require the human interpreter is required to evaluate whether the image has improved for the required task.

This problem of subjectivity in judgment was finally removed by the introduction of genetic and various meta-heuristic algorithms [6,7,8,9]. In nature-inspired and meta-heuristic algorithms, image enhancement can be treated as an optimization problem which tends to generate the output image from given input image by using global or local transformation and also maximize the required fitness function. Transformation function used attempts to map the image in nonlinear fashion. Fitness function is an objective function which mathematically defines the quality of the image and hence makes enhancement procedure objective. Genetic algorithms started the optimization of image enhancement that overcomes the human judgment disadvantage of previous enhancement techniques [3, 10, 11].

Genetic algorithms (GA) were succeeded by particle swarm optimization (PSO) [9, 12]. Firefly [13] and differential evolution [14] algorithms are some other algorithms that have been implemented for image enhancement. Yang and Deb [11, 15] proposed other meta-heuristic algorithm as cuckoo search algorithm which is implemented for image enhancement. Results show that it outperforms many of the previous algorithms such as genetic algorithm and PSO [16]. Also cuckoo search can be implemented in domain of fingerprint contrast enhancement [17]. In this paper, an improvement over existing algorithm has been proposed for grayscale image enhancement that uses Gauss distribution [18]. Results obtained using proposed method come out to be better than original cuckoo search algorithm using criteria as: fitness and visual quality. The algorithm has been implemented using MATLAB software (R2010b) [19].

2 Cuckoo Search Algorithm

Cuckoo search algorithm (CS) is a meta-heuristic algorithm which was developed by Yin She Yang in 2009 [15]. This algorithm was based on reproductive behavior of cuckoo birds. Cuckoo never makes its own nest and depends on host nest for laying its eggs. Host bird takes care of the eggs taking them as their own eggs. If eggs are identified by host nest that they are not his eggs, then it either throws the alien eggs or discards the current nest and makes a fresh nest at some other place. Eggs in the nest represent candidate solutions, and best egg is the new solution. There are three assumptions of this algorithm as follows:

  1. 1.

    Eggs are laid by cuckoo, and these eggs are put in a randomly selected nest.

  2. 2.

    Only eggs satisfying the criterion function will be taken forward in the subsequent iteration.

  3. 3.

    Count of existing host nests is kept constant. Probability of detection of egg by host bird pd is taken as variable in the range [0, 1] [11]. Quality of eggs is determined by using a fitness function.

For generation of new solutions S (t + 1) for any cuckoo i, Levy flight distribution is used which is usual flight pattern of many flying animals and insects [15].

$$ {\text{S}}_{\text{i}}^{{{\text{t}} + 1}} = {\text{S}}_{\text{i}}^{\text{t}} {\text{ + s}} \odot {\text{Levy}}\, ( {\text{x)}} . $$
(1)

Here, s(s > 0) represents size of the step made by above-mentioned distribution. The symbol ʘ depicts entry-wise multiplication. Levy flights impart a random walk which is derived from Levy distribution as:

$$ {\text{Levy}} \sim {\text{z = t}}^{{ - {\text{l}}}} , \; ( 1 {\text{ < l}} \le 3 ). $$
(2)

that exhibits unbounded mean and variance. This random walk process is tracked by step length distribution governed by power law method. In case of nest discard, new nest is build using random walk and mixing at new location. Nests are discarded with probability pd.

Image enhancement takes a transformation function that maps each input pixel to new intensity output pixel that generates the enhanced image. According to the literature [6,7,8], automatic image transformation can be done using Eq. (3) that takes into consideration global as well as local properties of an image.

$$ {\text{o}}\,({\text{x,}}\,{\text{y}}) = \frac{{{\text{k}}\, *\,{\text{M}}}}{{{\text{s}}\,({\text{x, y}})\, + \,{\text{q}}}} [ {\text{i}}\, ( {\text{x,}}\,{\text{y)}}\, + \,{\text{r}}\, *\,{\text{m}}\, ( {\text{x, y)]}}\, + \,{\text{m}}\, ( {\text{x,}}\,{\text{y)}}^{\text{p}} . $$
(3)

where i(x, y) is the gray value of (x, y)th pixel of the original image. o(x, y) is the intensity value of (x, y)th pixel of the output image. m(x, y) and s(x, y) are the mean and standard deviation of (x, y)th pixel over an n x n neighborhood, respectively. Global mean of the image is taken to be as M. p, q, r, k are the constraints to control the variation in the output image.

To eliminate the need of human interpreter to judge the output image, fitness function is defined. A fine image should have edges with sharp intensities, good number of pixels on the edges (edgels) and entropy measure [6].

$$ {\text{F}}\,({\text{I}}_{\text{e}} )\, = \,{ \log }\, ( {\text{log}}\, ( {\text{E}}\,({\text{I}}_{\text{e}} )\,*\,\frac{{{\text{edgels}}\,({\text{I}}_{\text{e}} )\,*\,{\text{H}}\, ( {\text{I}}_{\text{e}} )}}{{{\text{P}}\, *\,{\text{Q}}}}. $$
(4)

In above equation, Ie is the enhanced image. E (Ie) is the sum of P × Q pixel intensities of the edge image, and edgels (Ie) is the number of edge pixels. Here, Sobel edge detector is used to find out edge image of output image. H (Ie) is the entropy value of the enhanced image.

3 Proposed Method

Levy flight distribution provides random walk for large steps using Eq. (2) which has infinite mean and variance. Hence, cuckoo search algorithm will always give the optimum solution. But random walk governs the entire search; hence, fast convergence cannot be guaranteed. Also Levy flight distribution does not exhibit ergodicity property. Hence, improvement to the method is made in order to improve convergence rate and precision. Following Gauss distribution equation can be used to determine new solution as [18]

$$ \upsigma_{\text{s}} =\upsigma_{0} \,*\,{\text{e}}^{{ - {\text{mu*g}}}} . $$
(5)

where σ0 and mu are constant and g is current generation. Equation (5) instead of (2) is used for producing new solution S (t + 1) for cuckoo i. A Gauss distribution is used [18].

$$ {\text{S}}_{\text{i}}^{{{\text{t}} + 1}} \, = \,{\text{S}}_{\text{i}}^{\text{t}} \, + \,{\text{s}}\odot\upsigma_{\text{s}} . $$
(6)

where s (s > 0) represents step size. Its value is subjected to the type and extent of the problem. Figure 1 represents the flowchart of proposed method.

Fig. 1
figure 1

Flowchart of proposed algorithm for image enhancement

Proposed algorithm works as follows:

  1. 1.

    First total population of nests is initialized, and then each nest using these four constraints p, q, r, k of transformation function is initialized that needs to be optimized.

  2. 2.

    Each nest corresponds to an enhanced image generated using Eq. (3) and satisfies the fitness function.

  3. 3.

    Only eggs (set of parameters) satisfying the fitness/objective function will be taken to the subsequent iteration.

  4. 4.

    New nests are created at new position using Gauss distribution as defined by Eqs. (5) and (6)

  5. 5.

    Fitness of all nests is calculated using fitness function defined in Eq. (4), and best nest and best fitness is recorded as best nest and Fbest.

  6. 6.

    Bad nests are discard by probability of discard pd, and new nests are build at new location using Eq. (5).

  7. 7.

    Fitness of new nests is computed and compared with Fbest, and fitness with maximum value is retained as best value.

  8. 8.

    Termination criterion for the algorithm is set as maximum number of iterations.

  9. 9.

    And finally, enhanced image is obtained using best set of parameters which correspond to the best solution.

  10. 10.

    Post-processing and visualization is preformed to obtain the final enhanced image.

4 Results and Discussion

The proposed method was implemented on some images using MATLAB [19]. The main idea of the proposed method is to improve image’s visual quality of the image in accordance with edgels and entropy which constitutes the fitness function. Number of nests = 25, discard probability pd is 0.25, maximum number of iterations = 50. Window size is 3. Increased number of edgels put more emphasis on the edges in the image, and good measure of entropy leads to the uniform histogram distribution corresponding to the image. Results obtained from the proposed method are judged against original algorithm. Original grayscale images and corresponding enhanced images using original and proposed method are shown in Figs. 2, 3 and 4. Table 1 shows the summary of results obtained using original and proposed algorithm.

Fig. 2
figure 2

a Circuit.jpg (original image) b image enhanced using CS c image enhanced using improved CS

Fig. 3
figure 3

a Building.jpg (original image) b image enhanced using CS c image enhanced using improved CS

Fig. 4
figure 4

a Forest.jpg (original image) b image enhanced using CS c image enhanced using improved CS

Table 1 Parameterized comparison of original and proposed algorithm

5 Conclusion and Future Work

In this paper, an improvement of original cuckoo search algorithm is proposed that use gauss distribution to find new solution and optimize the required parameters. Core purpose of this paper is to facilitate automatic grayscale image enhancement using meta-heuristic approach that eliminates requirement of human interpreter to assess the quality of the image. Results have proved that proposed method is better than the previous algorithm.

Work presented in this paper finds large applications in various spheres of computing and processing. The algorithm can be realized in other areas of digital image processing such as segmentation, feature selection or morphology. Same algorithm can be employed on color images as well to obtain better results than already existing algorithms for color image processing.