The Application of Threshold Methods for Image Segmentation in Oasis Vegetation Extraction Yaowen Xie , Linlin Li *, Haoyu Wang , Xiaojiong Zhao Key Laboratory of West China’s Environmental System (Ministry of Education), Lanzhou University 730000 *Corresponding author:
[email protected] Abstract—In this study, three threshold algorithms for image segmentation were used to quickly and reliably determine the threshold of oasis vegetation of Jinta in the arid inland river of Northwest China. And then the extraction results were contrasted. This is a beneficial exploration of automatically extracting the boundary of the oasis. During the experiment, firstly, we obtained the greenness images after tasseled cap transformation of Landsat TM remote sensing images, and then we segmented them with thresholds that were obtained from the three methods: one is Otsu method, which is on basis of global binary image algorithm. In this method, we calculated the between-class variance and withinclass variance values of the whole images and took the gray values of the images as the optimal thresholds when the betweenclass variance reached maximum value. Another is iterative method based on the idea of approximation. The average of the mean gray value of the background and foreground is considered as the threshold. The third is edge detection based method on basis of local binary image algorithm. In this method, we firstly detected and tracked the image edges of the greenness images, and then computed the segmentation threshold by weighting the average pixels values of image edges. These algorithms and processes were carried out by programming in MATLAB. The results show that, the thresholds determined by Otsu and iterative method are a little higher, which results in loss of information within the oasis, while the edge-based detection threshold segmentation on basis of Robert operator is more suitable for the whole image, for it takes into account the internal regularity of the oasis. But on the whole, the outer boundary of oasis vegetation can extracted at full and the threshold can be determined automatically by these three methods, allowing it to be further applied in the extraction of remote sensing information. Keywords- Jinta oasis; tasseled cap; Ostu method; iterative method; edge detection; MATLAB;
I.
INTRODUCTION
In remote sensing for specific target information extraction, we would extract the target of interest from the original image and try to avoid the disturbances and effects of the background at the same time. It becomes crucial to obtain the threshold of the object and the background rationally and effectively after certain appropriate image enhancement, which determines whether the object is extracted successfully [1~3]. However, thresholds based on different segmentation algorithms would affect the precision of the results and the detail- levels of the characteristic information. The traditional methods, humancomputer interaction is considered to be an ideal method and Supported by China 973 program (2009CB421306)
widely used. But, it has a high requirement for the capability of judging the gray level to the operators. Otherwise, we should extract repeatedly, which will costs a plenty of time. Also, it is often influenced by subjective factors. Using experienced values is another traditional method, but it can’t be applied to all conditions. So, it is necessary to find a method that can not only determine the threshold automatically and rapidly but also the threshold varies with different images. It should be determined by analysis on the information of its own image [4]. There are many algorithms that can be used to segment the image into several parts of homogeneous objects. These algorithms can be summarized two types, one is on basis of global binary method and the other is based on the edge detection. Unfortunately, most of them are failed to integrate spectral information and spatial data and rarely used in classification of remote sensing images [5]. In this paper, three methods were used to extract the oasis vegetation of Jinta in the arid inland river of Northwest China supported by MATLAB software. This study has achieved automatic extraction of the threshold. In the end, the statistics of oasis area was made, which is of great significance of the next study on the evolution process of oasification and desertification. II.
STUDY AREA AND MATERIALS
A. Study Area Jinta oasis, part of the arid inland river of Northwest China, is located in northeast of Jiuquan and in the middle section of Hexi region. The extent is 98°39′ ~ 99°08′ E , 39°56′ ~ 40°17′N. The climate is temperate continental and the annual precipitation is 59.15mm; this oasis has been reclaimed by human over the years, giving an impetus to irrigation agriculture. It becomes one of the most important food production areas with abundant agricultural produce [6]. However, because of the increasing use of water in agriculture and the accumulation of deforestation and overgrazing, the tendency of desertification is getting worse and the inner structure of Jinta oasis has intensively changed. B. Materials The materials include one scene TM image of Landsat 5 acquired on July, 17th, 2009 that can cover the study area and administrative district boundary data.
III.
METHODS
Threshold-based segmentation method is simple and widely used in segmentation method. It takes the difference of gray value between the target objects and the background into account and then determines one or several thresholds of the image on basis of some certain principle functions to divide the image into one or several parts. Pixel gray value greater than the threshold is classified to one class of region, while, pixel gray value less than the threshold is classified to another class of region. It can not only compress a great amount of data, but also can greatly simplify the analysis and processing steps of the images [7]. Therefore, in many cases, threshold segmentation is quite necessary before image analysis, feature extraction and pattern recognition. It is particularly applicable to the situation that the objects and background have different gray levels. The advantages are simple operation and high efficiency. There are many threshold segmentation methods. According to the application area of the information, it can be divided into two classes, one is global threshold and the other is edge detection based method. Global threshold takes advantage of the information from the whole image and then determines the optimal threshold of the whole image, which can be a single value or a multithreshold. “P-tile” method, “2-mode” method, “Ostu” and “Iterative method” are commonly used. “P-tile” method determines the threshold by setting the ratio of the target and background equals the prior probability. “Ostu” method chooses the gray value that can make the between-class variance reach the maximum value as the optimal threshold. “Iterative method” takes the average of the mean value of each part as the threshold [8, 9].
G = −0.2728TM 2 − 0.2174TM 2 − 0.5508TM 2 + 0.7221TM 4 + 0.0733TM5 − 0.1648TM 7 (1)
The greenness image obtained will be used for the threshold determining in the following sections. It must be noted that the image should be convert to TIF format for MATLAB can’t read IMG format data directly. B. Ostu Method The principle of the algorithm is as follows [10]: •
Set the gray value scale of the image is “1-m”, the number of pixels valued “i” is “n”. So we get the total number of pixels for the whole image is m
N = ∑ ni
(2)
i =1
Then the probability of each pixel is pi = ni / N
•
•
(3)
Divide the gray value into two groups with the integer “K”. They can be written as
c
0
= {1, 2,...,k}
c
1
= {k+1,k+2,...m}
(4) (5)
The probability of each group can be generated as follows: k
ω0 = ∑ pi = ω(k ) i =1
The edge detection based method takes the contribution of the edge to object identification. It firstly extracts the edge by a variety of operators, such as “Sobel operator”, “Robert operator” and “Prewitt operator”. Edge weighting method takes the average value of the pixel on the edge as the initial threshold and then calculate the weight of each different pixels concerning to the average value.
ω1 =
m
∑p
i
(6)
= 1 − ω(k )
i = k +1
(7)
The average value of each group is
μ 0 = ∑ i =1 i ( pi / ω0 ) = μ(k ) / ω( k) k
μ1 = ∑ i = k +1 i ( pi / ω1 ) = [μ − μ( k )] / [1 − ω( k)]
(8)
m
IV.
CASE STUDY
Since we have introduced the threshold segmentation methods, the next is to test on several algorithms that are considered to be better by programming model in MATLAB and make comparisons with each. A. Tasseled Cap It is essential and beneficial to enhance the original image before determining the threshold, for it can increase the difference between the objects and its background. Tasseled cap transformation is an image enhancement method especially for vegetation extraction. It is a global vegetation index. The TM image is converted into soil brightness, vegetation greenness and moisture content through a linear transformation. This study acquired the greenness component only on basis of the conversion coefficient.
•
(9)
The average gray value of the whole image is m
μ = ∑ i ( pi ) i =1
(10)
That can also be computer as:
μ = ω0μ 0 + ω1μ1
(11)
At last we may determine the variance of the two groups from:
σ2 (k ) = ω0 (μ0 − μ) 2 + ω1 (μ1 − μ)2 = ω0ω1 (μ1 − μ0 ) 2
(12)
Change the value of “K” from “1” to “m” until the between-class variance reached maximum value. The value of “k” now is considered to be the best threshold.
We can call the function for determining threshold directly in MATLAB for its principle is just on basis of Ostu method [11, 12]. The commands are as follows:
V.
>> I=double (imread(‘imagename.tif’)); >> level=graythresh(I)*255; >> level
Obtain the maximum and minimum gray value of the image and denote them by “max” and “min” respectively. So the initial threshold is expressed as
T0 = (max + min) / 2
(13)
Then we extract the oasis vegetation by these thresholds and compare the test results (shown in Fig.1, Fig. 2and Fig. 3). It shows that these thresholds are relatively close, but the areas of oasis vegetation differ greatly. A slight change of the threshold will result in unexpected fierce changes, which confirms the importance of threshold determining in objects extraction;
•
Divide the image into foreground and background parts by the initial threshold and calculate the average value of each part, denote them by “Z1” and “Z2”;
Method
•
Figure out the new threshold
Tk +1 = ( Z1 + Z 2 ) / 2 •
RESULTS
On basis of the methods above, we finally get the thresholds. In order to validate the results of these methods, we also determine the threshold manually (Tables 1).
C. Iterative Method The principle of the algorithm is as follows [13]: •
This method is also carried out by programming in the MATLAB [17].
(14)
Continue on with the proceed until Tk+1= Tk ,and that represents the best threshold of the image
This method is carried out by programming in the MATLAB. D.
Egde Weighting Method The image threshold is supposed to exist in the transition region from the target object to the background. If the gray value in the edge area is obtained, it would become easy to find a suitable threshold according to these gray values. As the edge detective operators are built on, they have directions and are easily affected by noise or point features (such as outlier). Sometimes the result contains pseudo edges [14, 15]. The edge weighting method is put forward on this basis.
TABLE I.
COMPARISON OF SEGMENTATION METHODS
Threshold
Manual threshold 121
Ostu method 127
Iteration method 132.0102
Robert operator 120.1523
Area(km2)
690.56
583.27
503.92
712.59
The thresholds determined by Otsu and iterative method are a little higher, which results in loss of information within the oasis, while the edge-based detection threshold segmentation on basis of Robert operator is so close to the manual threshold. It is more suitable for the whole image; for it takes into account the internal regularity of the oasis. In the whole, all of these methods perform well in extracting the boundary of the oasis vegetation. So it achieves the expected goal.
The steps can be described as shown below [16]. •
Carry out edge detection by using different nondirectional operators.
•
Track the edge, then obtain the gray values of the edge, calculate the average value and marked with θ.
•
Calculate the normalization coefficient m
1 | θ i =0 i −θ|
s=∑
Figure 1. Manual method (15)
“ θi ” means different gray values on the edge; “m” represents the maximum value. •
Figure out the weighting coefficient of each pixel from:
wi = •
1 s | θi − θ |
(16)
Sum each different edge pixels that have been granted weight, then we get the optimal threshold.
Fig2. Ostu method Figure 2. Ostu method
much difference between the background and foreground, the algorithms and processing can be used repeatedly several times until getting optimal results. REFERENCES [1] [2] [3] Figure 3. Iteration method [4]
[5] [6]
[7]
[8] [9]
Figure 4. Robert operator
VI.
CONCLUSION
This study applied threshold method for image segmentation in information extraction of remote sensing images. These algorithms integrate spectral information of the ground objects, achieving determining the threshold automatically and rapidly and improving the human-computer interaction and experienced threshold. Also, it lays a good foundation for target identification, edge detection and extraction, and classification of remote sensing image. On account of abundant information, the remote sensing image is often large and image storage and processing are burdened. This study integrates the ability of numerical calculations and programming of MATLAB, which can ensure the accuracy and reliability of the program and enhance the speed of threshold determination. In addition, these algorithms are expected to extend to multi-threshold determination, thus realizing the extraction of a variety of objects at the same time. If there isn’t
[10]
[11] [12]
[13]
[14]
[15]
[16]
[17]
Abutaleb A S, “Automatic Thresholding of Gray - Level Picture Using Two - Dimensional Entropies,” Pattern Recognition, 1989, 47: 22- 32. Sahoo P K, Soltano S, Wong A KC, “A Survey of Thresholding Techniques,” IEEE Trans. on Image Processing, 1995, 41: 233 - 260. Hezhi Wang, Zhaogang Liu, “Appliation of Threshold Segmentation and Mathematical Morphology to Edge Detection of Remote Sensing Image in the Ulan Buh Desert,” Journal of Forest Engineering, 2009, 25(3): 912. Zhenqing Chen, Donh Yujian, Jiugang Li, Zhengjun Liu, MinyanDuan, “Study on the Method of Exctrating Land Use Chang Information Based on Remote Sensing,” Applications of Remote Sensing, 2009, 3. John R. Jensen, Introductory Didital Image Processing A Remote Perspective Third Edition[M]. China Machine Press, 2007. Anxin Lu, Xianzhang Chen, Jian Wang, Lihong Wang, Lizong Wu, “Monitoring the Ecology and Environment in the Middle Reaches of Heihe River Using Remote Sensing,” Journal of Glaciology And Geocryology, 2002, 24(1): 73-78. Qi Du, Jianyong Xiang, Shengchun Yuan, “Study on Threshold Segmentation for infrared image based on edge detection,” Infrared and Laser Engineering, 2004, 33(3): 288-291. Hanling Zhang, The Application of MATLAB on Image Processing[M], Qing Ha University Press, 2008. Qingying Zhang, Weihong Yue, Weijiang Xiao, Xia Jiang, “Study on Image Binarizing Process Based on Edge Features,” Journal Of Wuhan University Of Technology, 2005, 27(2): 55-64. Siqi Han, Lei Wang, “A Survey of Threshold Methold for Image Segmention,” Systems Engineering and Electronics, 2002, 24(6): 91102. Wanbo Yu, Image Processing Based on MATLAB[M], Qing Ha University Press, 2008. Shuang Li, “Study of Image Methods’ Selection and Algorithms Implementing for Image Segmentation,” Knowledge and Application of Computer Technology. Junzhe Lu, “The Research on the Binary Image Algorithm and Its Realization,” Sci/Tech Information Development & Economy, 2004,14(12): 266-267. Zhang Li, Yonghong Jia, Gang Cheng, “Edge Detection Algorithm for Remote Sensing Image Based on Mathematical Morphology,” Geospatial Information, 2006, 4(4): 52-54. Huang Yi, Yuren Du, “Reash of Image Segmentation Technique Based on Edge Information,” Mode Electronic Technology, 2005, 5(196): 116120. Bing Wu, Zhiyuan Qin, “New Approaches for the Automatic Selection of the Optimal Threshold in Image Binarization,” Journal of Institute of Surveying and Mapping, 2001, 18(4): 283-286. Kun Wang, Tianwei Liu, Fangfang Du, Lin Chang, “The Action of MATLAB in Edge Measuring for Image Manipulation,” Journal Of Shenyang Normal University(Natural Science), 2005, 23(2): 161-165.