Table of Contents Author Guidelines Submit a Manuscript
The Scientific World Journal
Volume 2013, Article ID 572393, 10 pages
Research Article

Sample Training Based Wildfire Segmentation by 2D Histogram -Division with Minimum Error

1School of Computer, Wuhan University, Wuhan, Hubei 430072, China
2Suzhou Institute of Wuhan University, Suzhou, Jiangsu 215123, China
3Department of Neurosurgery, University of Pittsburgh, Pittsburgh, PA 15213, USA

Received 15 March 2013; Accepted 3 June 2013

Academic Editors: I. Korpeoglu, E. Pauwels, and S. Verstockt

Copyright © 2013 Jianhui Zhao et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.


A novel wildfire segmentation algorithm is proposed with the help of sample training based 2D histogram -division and minimum error. Based on minimum error principle and 2D color histogram, the -division methods were presented recently, but application of prior knowledge on them has not been explored. For the specific problem of wildfire segmentation, we collect sample images with manually labeled fire pixels. Then we define the probability function of error division to evaluate -division segmentations, and the optimal angle is determined by sample training. Performances in different color channels are compared, and the suitable channel is selected. To further improve the accuracy, the combination approach is presented with both -division and other segmentation methods such as GMM. Our approach is tested on real images, and the experiments prove its efficiency for wildfire segmentation.

1. Introduction

Image segmentation is an important research topic in the fields of image processing and computer vision, and its purpose is dividing one image into several different areas, while each region has certain characteristics and disjoints with the others. As the traditional segmentation approach, threshold value based methods [1, 2] have been widely used and studied for many years, mainly due to the fact of easy programming together with relatively low computational complexity.

The core issue of threshold methods is to construct the evaluation function to achieve the optimal segmentation threshold value. -means clustering method [3] has two evaluation standards: the similarity among the elements in each subclass and the diversity among the elements in different subclasses. The main disadvantages of -means method are that without prior knowledge the ideal number cannot be determined before segmentation, and it is sensitive to noise and isolated targets, also sensitive to the initial clustering centers, thus is easy to obtain the local optimal solutions. Otsu method [4] is one adaptive thresholding approach. It divides the original image into two classes: object and background, according to the color histogram of image. The evaluation function is constructed based on the variance between two classes, and the best threshold value corresponds to the maximum variance. However, Otsu method ignores the spatial neighboring information of image and may fail when the size proportion of object and background is very small. Fuzzy -means (FCM) [5] is also a clustering method, which promotes the target function of -means with fuzzy mathematics [6]. Main advantage of FCM is using the degree of membership for classification, and thus it can conserve more information of the image and obtain better segmentation. The disadvantages of FCM are that the initial parameters are set arbitrarily, time and space complexities increase rapidly when number becomes larger, and successful convergence in limited time is a problem [7]. Maximum entropy principle is used to help estimate the unknown probability distribution with limited conditions, while the main idea is to select the probability distribution with the maximum entropy value [8]. This principle is employed for image segmentation assuming that the color value of each pixel in one image is a random event, and the normalized color histogram is taken as the probability distribution of pixels [9]. The minimum error thresholding is a kind of threshold image segmentation method based on Bayesian theory [10]. It assumes that the object and background obey the mixed normal distribution, and the classification is based on the minimum error principle. It can also be explained as the minimum relative entropy between actual distribution of color histogram and assumed mixed normal distribution [11]. Through quantitative comparison [12] of the typical threshold methods, it can be found that the minimum error thresholding derives good segmentations, even for the targets with very small sizes.

In threshold segmentation methods, color histogram is often used to describe the distribution of pixels. Since the information of spatial relationships among pixels is not considered in 1D histogram, it is very difficult to obtain satisfying segmentation results when the image has high complexity or significant noise. Therefore, 2D histogram has been employed using both color value of each pixel and its neighborhood averaged color [1315]. As shown in Figure 1, threshold divides the 2D histogram into 4 rectangular regions. Regions A and C represent the object and the background, respectively, while regions B and D represent edges, noise, and so on, where the probability distribution is assumed to be nearly zero. But in real images the assumption is hard to be satisfied, and thus the segmented results are less accurate. For this problem, the 2D linear division method with minimum error is introduced [16], and the line perpendicular with the main diagonal line of histogram is used as threshold for segmentation. The method can divide more pixels into object or background, but it only considers the particular case; that is, angle is 45 degrees. Then a widely suitable thresholding method is proposed based on 2D histogram -division and maximum deviation criterion [17], and in this method the segmented results and running time related with different values are analyzed. More recently, new threshold method is presented based on 2D histogram -division with minimum error [18], and the influence of various values on both segmentation and computational expense is discussed with experiments.

Figure 1: The 2D histogram with -division.

Until now, the aforementioned threshold methods are automatic and unsupervised. Thus the segmented results cannot be affected by the prior knowledge and cannot be effectively evaluated either. Therefore, in our paper the sample training method is employed for 2D histogram -division with minimum error. Outline of our approach is to determine the suitable for specific application with sample training and to combine 2D -division with other kinds of segment techniques, for example, color ranges based methods [19, 20] such as GMM. To test our new approach, the combined algorithm is checked through segmentation of wildfire regions from some real images.

2. 2D Histogram and Sample Training

2.1. 2D Histogram -Division with Minimum Error

The 2D histogram -division with minimum error is illustrated in Figure 1, and is the angle between horizontal axis and the normal of division line . When is set as 45 degrees, the weights between the pixel color and its neighboring average color are fixed at 1 : 1. When varies, the weights and the division line also change, and the corresponding segmentation results are generated.

Given an image with the size of , for any pixel , its color value is and the total color level is ; there is . The neighboring average color value of pixel is

where is the number of pixels in the neighborhood window area of pixel .

Let represent the number of pixels with the color value of together with the neighboring average color value , and probability of is computed as .

The division line in Figure 1 can be expressed by

where is the distance from the origin of coordinate to line , and .

Based on definition of 2D color histogram, there are , ; thus,

To segment image, let and ; line can be expressed with the modified formula:

Therefore, variable can be taken as the weighting parameter of color value and , while is the corresponding segmentation threshold value. For pixel , its corresponding binarized value in the segmented image is

Obviously, weighting variable is decided by angle of division line , and the segmentation result varies with different value of . When is more than 0.5, the color value of one pixel has heavier weight, and the boundary of segmented region is more accurate, while when is less than 0.5, the neighboring average color value of pixel has heavier weight; thus segmentation’s insensitivity to noise is enhanced. Therefore, segmented results can be adjusted for different applications through modifying variable or angle .

The division line separates one image into object area and background area , and the corresponding probabilities are computed as and .

Mean value vectors of object and background are

The global mean value vector is

Variance vectors of object and background are

Based on the previous probabilities and vectors, the evaluation function of 2D histogram thresholding with minimum error is defined as

When obtains its minimum value, there is the following corresponding optimal threshold value [1618]:

To illustrate the effects of angle on the segmented results, one image with wildfire is used. Taking the V channel of HSV color space as input for 2D histogram -division with minimum error, the segmentations with different angle are shown in Figure 2.

Figure 2: Fire segmentation with different angles : (a) input image; (b–f) results with .

From the results of Figure 2, effects of angle on the segmentation can be found. When is small, most noises are deleted but some fire pixels are also discarded. When is large, most fire pixels are detected while some noises are falsely taken as flame too. Therefore, determining the optimal value of angle is very important.

2.2. Sample Training Based Determination

The 2D histogram -division with minimum error is an unsupervised threshold method, thus the application of prior knowledge helps to obtain better results. For the specific problem of fire segmentation, the optimal angle can be determined through sample learning. As shown in Figure 3, typical images with wildfire are collected, and the fire regions are marked manually, which are used to evaluate and train the segmentation method.

Figure 3: Sample images and manually marked fires.

For any sample image (Figure 3(a)), we mark the background area with pure black color (value 0) and leave the object area unchanged, and the manual template image is thus generated (Figure 3(b)). For the same sample image, 2D histogram division method with angle and minimum error is used for segmentation and the segmented image is produced. For one pixel with coordinates , there are 4 possible cases as follows:(1)if , the pixel has been correctly identified as the object point;(2)if , the pixel has been correctly identified as the background point;(3)if and , the pixel has been wrongly identified as the object point;(4)if and , the pixel has been wrongly identified as the background point.

Based on comparison between image and image , we can obtain the total number of pixels, the number of object pixels, the number of background pixels, the number of pixels that are wrongly identified as object, and the number of pixels that are wrongly identified as background. Then the segmented result can be evaluated by the probability of error division as follows:

where and are probabilities of object and background, respectively, is probability that background is wrongly identified as object, is probability that object is falsely identified as background, and the probabilities can be computed by aforementioned numbers of different kinds of pixels.

Obviously the probability of error division is a function of angle , and the minimum function value is related with the optimal angle .

With a group of wildfire images having total 1767705 pixels and manually marked fire regions having 114320 pixels, relationship between value and angle , varying in the range of with the changing step of , is shown in Figure 4.

Figure 4: Relationship between and angle .

The optimal angle corresponds with the minimum value of . Since distribution of discrete sampled points in Figure 4 approximates the shape of one unimodal function, the method of bisection search is used to find the minimum value of . For the example shown in Figure 4, the optimal angle is found as and the related minimum error probability of evaluation function is 0.0093.

3. Application on Wildfire Segmentation

3.1. Selection of Color Channel

The 2D histogram -division with minimum error can deal with gray image or any channel of color image. To analyze its performance on different color channels, both RGB and HSV color models are used for testing, and all color channels together with gray images of three color fire images are processed.

The segmented results are shown in Figure 5; (a) shows input images, (b) shows results of R channel, (c) shows results of G channel, (d) shows results of B channel, (e) shows results of H channel, (f) shows results of S channel, (g) shows results of V channel, and (h) shows results of gray images which are converted from the input color images.

Figure 5: Results on color channels and gray images—the 1st row: input images; the 2nd row to 8th row: segmentations of R, G, B, H, S, V channels and gray images.

For wildfire images, the regions of interest are fire and smoke; thus the evaluation of color channels is based on whether there are successful segmentations of the regions from images. For G channel or B channel, the fire or the smoke regions cannot be identified correctly. R channel can obtain fire regions more accurately, but there are still some fire pixels wrongly classified as nonfire objects, while the segmented smoke regions are less accurate. H channel has worse results, since hue differences among real fire, smoke and background are not very obvious; for example, hue of dark fire and smoke is similar with background. S channel derives most fire regions but can also take some saturated pixels of background as fire. V channel has the ability to identify smoke and fire areas as high luminance objects at the same time. Comparatively, segmentations from gray images lose some fire regions.

It can be found that no channel successfully segments fire or smoke region separately, but V channel has the best performance to obtain both fire and smoke areas simultaneously. Therefore, V channel is selected for 2D histogram -division with minimum error. Of course, to obtain the individual objects of fire or smoke, segmented results need further process, for example, the popularly employed color range based segmentation methods.

3.2. Combination with Other Segmentation Methods

There are other kinds of methods for fire segmentation from images; among them the Gaussian mixture model (GMM) for sample distribution is an efficient one. In our previous work [20], 530,000 pixels manually segmented from the fire regions of 23 sample images are collected in RGB color space (shown in Figure 6), and then the 3D shape of fire sample pixels is represented by GMM. Parameters of GMM are trained with expectation maximization, and then the fire probability distribution in 3D color space is computed. Based on the calculated fire probability of one pixel under processing, we can decide whether it belongs to flame area or not.

Figure 6: Sample pixels used for GMM training.

GMM parameters and models are represented as

where the weighting value, kernel center, and covariance matrix of one single Gaussian model are , , and , respectively, while illustrates how close of point to the Gaussian mixture model. The suitable number of Gaussian models in GMM can be manually assigned or computed automatically.

However, performance of GMM is affected by the amount of sample pixels and the number of Gaussian models. If the Gaussian models or the sample pixels are not enough, GMM cannot precisely describe the object range in color space. In this case, application of GMM on the input image easily brings errors, for example, wrongly taking some nonfire objects as fires. As shown in Figure 7, figures of the 1st column are input images, while figures of the 2nd column are the segmented results. Having the similar color as fire, some nonfire pixels, such as smoke, wall, or words, are mistakenly detected as flame.

Figure 7: Segmented results from GMM with errors.

Therefore, combination of the 2D histogram -division with minimum error and other division methods such as GMM can further improve the segmentation. There are 2 possible ways for combination: 2D -division first and then GMM segmentation; GMM segmentation first and then 2D -division.

For , GMM deals with the already segmented fire and smoke areas from 2D -division; thus the pixels of other objects have no chance to be mistakenly chosen as flame. For , 2D -division method further divides the segmented result from GMM, which makes it possible to differentiate fire pixels and nonfire similar pixels again in images of the 2nd column of Figure 7.

Taking combination as example, the basic steps of our algorithm using both 2D histogram -division with minimum error and GMM are the following.

Step 1. Determine the optimal angle based on sample training for wildfire detection.

Step 2. Segment the input image using 2D histogram -division with minimum error.

Step 3. Obtain wildfire regions with GMM processing from the segmented results of Step 2.

4. Results and Discussion

More real pictures with various wildfires are used for experiments, and the results are displayed in Figure 8. The 1st column shows input images; the 2nd column shows manually marked fire pixels used for comparison; the 3rd column shows segmented results from the 2D histogram -division (, untrained angle) with minimum error; the 4th column shows segmented results using only GMM; the 5th column shows final results of the combined algorithm, that is, first 2D histogram -division (, the trained optimal angle) with minimum error and then GMM.

Figure 8: Experimental results of wildfire segmentation from images.

From the experimental results, it can be found that the segmentation using only GMM still has the problem of wrongly taking non-fire pixels as fires. With the help of 2D histogram -division with minimum error and the sample trained optimal angle , most of the non-fire pixels are filtered; that is, our combined algorithm finally obtains better results of wildfire regions.

The computational expense for segmentation is also tested with a computer of Intel Core2 Duo CPU 2.93 GHz, 2 GB RAM. For the combined algorithm running on 10 pictures of Figure 8 with already trained angle and GMM parameters, their computational costs are listed in Table 1, where the unit of time is the second.

Table 1: Computing cost of the combined algorithm.

It can be found that the computational expense of our combined algorithm is not high, making it possible to be used in real applications with fire recognition. Having the ability of processing more than 1 frame per second, the method can work for video based approaches.

5. Conclusion

Based on 2D color histogram and the minimum error principle, -division methods have been studied in recent years. The segmented results are affected by angle , but its relationship with prior knowledge of certain problems still needs further study. Taking fire as a typical example, the sample training based 2D histogram -division with minimum error is implemented, and its application for segmentation is explored and analyzed.

Segmentation from angle is evaluated by the defined probability function of error division. Through collected samples and training, the optimal angle is found. Color channels are compared and the suitable one is chosen.

Then a new combined approach with 2D -division and GMM method is proposed to derive more accurate segmenting results. Compared with using only GMM, the combined method helps filter more errors. Our method has low computing cost and can be used for video based approaches with the help of temporal information.

The proposed techniques are verified with some real images, and the computing expenses are also tested. The combined algorithm obtains satisfying results, which has proved the ability of sample training base 2D histogram -division with minimum error. In the future, the presented methods will be further verified with the other kinds of segmentation techniques and will be tried for the other kinds of applications besides fire detection.


This work was supported by National Basic Research Program of China (973 Program, no. 2011CB707904), Science and Technology Bureau of Suzhou of China (no. SH201115), Natural Science Fund of Hubei Province of China, Natural Science Fund of China (no. 61272276), and Science and Technology Bureau of Wuhan of China (no. 201150124001).


  1. G. Csurka and F. Perronnin, “An efficient approach to semantic segmentation,” International Journal of Computer Vision, vol. 95, no. 2, pp. 198–212, 2011. View at Publisher · View at Google Scholar · View at Scopus
  2. Y. Yang, S. Hallman, D. Ramanan, and C. C. Fowlkes, “Layered object models for image segmentation,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 34, no. 9, pp. 1731–1743, 2012. View at Google Scholar
  3. J. B. MacQueen, “Some methods for classification and analysis of multivariate observations,” in Proceedings of the 5th Symposium on Math, Statistics and Probability, pp. 281–297, Berkeley, Calif, USA, 1967.
  4. N. Otsu, “A threshold selection method from gray level histogram,” IEEE Transactions on Systems Man and Cybernetics, vol. 9, no. 1, pp. 62–66, 1979. View at Google Scholar · View at Scopus
  5. J. C. Bezdek, Pattern Recognition with Fuzzy Objective Function Algorithms, Plenum Press, New York, NY, USA, 1981.
  6. K.-S. Chuang, H.-L. Tzeng, S. Chen, J. Wu, and T.-J. Chen, “Fuzzy c-means clustering with spatial information for image segmentation,” Computerized Medical Imaging and Graphics, vol. 30, no. 1, pp. 9–15, 2006. View at Publisher · View at Google Scholar · View at Scopus
  7. M. Filippone, F. Camastra, F. Masulli, and S. Rovetta, “A survey of kernel and spectral methods for clustering,” Pattern Recognition, vol. 41, no. 1, pp. 176–190, 2008. View at Publisher · View at Google Scholar · View at Scopus
  8. E. T. Jaynes, “On the rationale of maximum entropy methods,” Proceedings of the IEEE, vol. 70, no. 9, pp. 939–952, 1982. View at Google Scholar · View at Scopus
  9. J. N. Kapur, P. K. Sahoo, and A. K. C. Wong, “A new method for gray-level picture thresholding using the entropy of the histogram,” Computer Vision, Graphics, & Image Processing, vol. 29, no. 3, pp. 273–285, 1985. View at Google Scholar · View at Scopus
  10. J. Kittler and J. Illingworth, “Minimum error thresholding,” Pattern Recognition, vol. 19, no. 1, pp. 41–47, 1986. View at Google Scholar · View at Scopus
  11. F. Morii, “A note on minimum error thresholding,” Pattern Recognition Letters, vol. 12, no. 6, pp. 349–351, 1991. View at Google Scholar · View at Scopus
  12. W. Liu and L. Wu, “Comparison of threshold selection for image segmentation,” Pattern Recognition and Artificial Intelligence, vol. 10, no. 3, pp. 271–277, 1997. View at Google Scholar
  13. D. Zhou and J. Zong, “Minimum error thresholding based on two dimensional histogram,” in Proceedings of the WRI World Congress on Computer Science and Information Engineering (CSIE '09), vol. 7, pp. 169–175, April 2009. View at Publisher · View at Google Scholar · View at Scopus
  14. L. Zheng, G. Li, and Y. Bao, “Improvement of grayscale image 2D maximum entropy threshold segmentation method,” in Proceedings of the International Conference on Logistics Systems and Intelligent Management (ICLSIM '10), vol. 1, pp. 324–328, January 2010. View at Publisher · View at Google Scholar · View at Scopus
  15. P. Sthitpattanapongsa and T. Srinark, “A two-stage Otsu's thresholding based method on a 2D histogram,” in Proceedings of the 7th IEEE International Conference on Intelligent Computer Communication and Processing (ICCP '11), pp. 345–348, August 2011. View at Publisher · View at Google Scholar · View at Scopus
  16. J.-L. Fan and B. Lei, “Two-dimensional linear-type minimum error threshold segmentation method,” Journal of Electronics and Information Technology, vol. 31, no. 8, pp. 1801–1806, 2009. View at Google Scholar · View at Scopus
  17. Y.-Q. Wu and J.-K. Zhang, “Image thresholding based on two-dimensional histogram θ-division and maximum between-cluster deviation criterion,” Acta Automatica Sinica, vol. 36, no. 5, pp. 634–643, 2010. View at Publisher · View at Google Scholar · View at Scopus
  18. Y. Q. Wu, X. J. Zhang, S. H. Wu, G. H. Zhang, S. W. Zhang, and S. F. Yu, “Image thresholding based on 2-D histogram θ-division and minimum error,” Journal of Shanghai Jiaotong University, vol. 46, no. 6, pp. 892–899, 2012. View at Google Scholar
  19. B. U. Töreyin, Y. Dedeoǧlu, U. Güdükbay, and A. E. Çetin, “Computer vision based method for real-time fire and flame detection,” Pattern Recognition Letters, vol. 27, no. 1, pp. 49–58, 2006. View at Publisher · View at Google Scholar · View at Scopus
  20. J. Zhao, Z. Zhang, S. Han, C. Qu, Z. Yuan, and D. Zhang, “SVM based forest fire detection using static and dynamic features,” Computer Science and Information Systems, vol. 8, no. 3, pp. 821–841, 2011. View at Google Scholar