Hyperspectral Image Segmentation using Homogeneous Area Limiting and Shortest Path Algorithm

Segmentation, as a preprocessing, plays an important role in hyperspectral images. In this paper, considering the similarity of neighboring pixels, using the size measure, the image spectrum is divided into several segments so that the existence of several sub areas in each segment is possible. Then, using the methods of area limiting and the shortest path to seed pixel, and considering the pixel spectra in all bands, the available areas in each section are separated. The area limiting method controls the amplitude changes of area pixels from seed pixel, and the shortest path method, considering the shortest path to seed, controls the size of area. The proposed method is implemented on AVIRIS images and in terms of the number of areas, the border between areas and the possibility of area interference show better results than other methods. Keywords—Segmentation; hyperspectral; shortest path; area limiting


INTRODUCTION
By development of remote sensing technology, sensors were established which have high spectral resolution ability and are known as hyperspectral sensors.Hyperspectral sensors are a special type of spectroscopy sensors that divide the desired bandwidth to hundreds of narrow neighboring bands in order to get more details about pixels.The segmentation of hyperspectral images is of special importance and will help us in the next steps as a pre-processing.The methods for segmentation that use just adjacent pixels comparison and the methods that convert the levels with brightness variations into small areas are not suitable ones.Several methods have been proposed to solve the problem.One way to solve the problem of the high numbers of areas is using an iterative algorithm for satellite images based on the seeds of areas that are larger than a threshold that act by specifying the number of top areas and integration of small areas [1].Another method prevents the creation of areas that are smaller than a certain size, and the measurement of area integration is defined using the definition of graph for uniform adjacent areas [2].In the above methods, the segmentation is very sensitive to the threshold value.In another study, using a combination of spectral and textural properties of the two first components, the principal component analysis of the segmentation operation is performed [3].The combination of two different characteristics is difficult and, on the other hand, the number of created areas is high, and a series of information are removed because of not using all bands.In another method, the classification operation is done by using band selection and the image is divided by using the level set method through specifying the boundary of areas [4].In this paper, the segmentation by using previously methods is described.Then segmentation by using the proposed method is studied, and finally the practical results are presented.

II. RELATED WORK
The image can be divided into its constituent parts by segmentation, so that the similar pixels are placed in one area.Among the pervious method, we can refer to level set and watershed.Watershed conversion is one of the powerful morphology tools that segment the images by identifying continuous borders between areas.This conversion operates based on the gray scale of pixels and is applicable by using the gradient of the image.In the gray scales of morphology, is a function of the gray level of image and is the structural element.Expansion is represented by and erosion is represented by [5].
So that According to this definition, the gradient is defined as follows: The difference between expansion and erosion specifies the edges [6].Among the other techniques of segmentation we can point to the level set method.It is defined as the move of closed curves depending on the target curve direction.According to Fig. 1, closed curve C is the target curve and its evolution is show by at the two times t and . .Inside the curve is less than zero, outside the curve is greater www.ijacsa.thesai.orgthan zero, and on the curve is zero. is considered as a twodimensional matrix of real numbers , where x and y represent the image pixel coordinates.The point zero is defined as zero level set.In the level set method, using the energy function of zero level set, the move of its boundaries are followed and its function, using a speed function and the normal function for level set curve, is expressed based on a partial derivative relationship.

| |
So and | | represent the gradient and its size [7], [8].This method is sensitive to the parameters and the start points of curves are very important.Furthermore, it does not work properly when the image contains smooth areas of increase or decrease in brightness.

III. PROPOSED SEGMENTATION METHOD
In this method, the image is divided by two-phase regional growing method.In the first step, an initial segmentation is performed by joining the neighboring pixels using similarity measure of the spectrum size.Since this step is very sensitive to the threshold value and then there is the probability of the existence of heterogeneous pixels in each region, in the second step the image segmented in the first step is re-segmented using the area limiting and shortest path methods.

A. Initial Segmentation of Image
Hyperspectral images are discrete multivariate functions with tens or hundreds of spectral bands, whose each pixel can be considered as a vector.If the hyperspectral image is represented by ، indicates the pixel x of the ith band.Based on this phase of segmentation, the two points x and y can belong to a region if the path between the two points x and y is considered as a chain of points , and all points and are neighbors and the similarity measure between neighboring pixels is smaller than [9].In this method, each pixel is compared with its neighboring pixels, and if it has more similarity to one of them, it is located in the area of that neighboring pixel otherwise it will be placed in a new area.Similarity measure used in this analysis is a similarity measure of the spectrum size and two pixels are similar if the value of this measure is less than the threshold.The neighborhood of each pixel and surrounding pixels is considered as octets.In statistical analysis and signal processing, distance metric is used as a sample separation measure.Euclidean distance is defined as one of the distance measures [10]: So L represents the number of bands, and the scale is between zero and one for a reasonable comparison.(8) Where, m and M are the lowest and highest value, repectivelly.
is a similarity measure that represents the correlation between two vectors and is defined as follows: M and σ are mean and standard deviation in pixels.For having values between zero and one, negative values are ignored.The size of spectrum similarity is a combination of correlation and distance criteria.
Basically, Euclidean distance is the measure of brightness difference between two vectors and correlation compares the shape of two spectrums [11].Using the size of spectrum similarity, a combination of similarity of spectrum shape and brightness have been studied and the lower value, the greater the similarity spectra.This segmentation method is very sensitive to the value of , that is, by varying the amount of , the border and the number of areas will change.Selecting is done by using the similarity measure of size spectrum to calculate the average distance of 16 classes of training samples from each other.Then the value of is calculated using the mean of three minimum values.Interval [mean+ mean/2 mean -mean/2] is considered to select the threshold.This stage of segmentation is not recognized as a complete stage, because the similarity of each pixel is just compared with its adjacent pixels, while the difference between each pixel with non-adjacent pixels in each area will be possible.In order to solve this problem in the second stage, a regional segmentation is done using the two area limiting and shortest path methods.The calculated value is 0. 55 [12], [13].

B. Area Limiting Method
Considering the defects mentioned for the first stage of segmentation, the proposed area limiting method is applied separately on each of the created areas from the first stage.Based on this method, if a hyperspectral image with initial segmentation including I sections, and each of its section is a set of points with the central pixel , some points of the first segmentation stage can be placed in a new section where the Euclidean distance of seed pixel from each section of the pixel i is less than the threshold value and is defined as follows: C www.ijacsa.thesai.org(11) The growth of new sector will continue to the extent that the condition smaller than be is true and segmenting with different seeds is repeated in the new area to the placement of all pixels of the i-th area from the first segmentation.In the first stage, one median vector is defined for each area of segmentation and its components are calculated using the total distance of each pixel P to the other available pixels in that area of initial segmentation [14].Then the minimum value of this vector is selected as the seed and is defined as: So is the total pixel of each area of the first stage segmentation.In the next stage, the seed distance from the area pixels is calculated and the distance of each pixel that is smaller than threshold value is introduced as new area pixels and the total distance of that pixel from the other pixels will be deleted from the median vector.The growth of the new sector will continue to the extent that the condition smaller than is true.Then among the remaining pixels in the median vector, a new seed pixel is selected by obtaining the median vector minimum, and the method of work will continue as before, so that all the pixels of the initial segmentation area are placed in a new area.Threshold selection is done in this way that the distance of each area of the first stage segmentation is calculated with 16 classes of training samples and 3 minimum values are selected out of 16 values and the average of these 3 values is calculated and represented by a. [ ] is used for the second stage segmentation , and studies show that threshold has better results for the areas that their pixel number is 1.5 times more than the average number of areas pixels and the threshold a has better results for smaller areas.Fig. 2 shows the block diagram of area limiting method.

C. Shortest Path Method
An alternative method for the second stage segmentation is the shortest path to the seed pixel.This method is also applied separately on each created area in the first stage.Based on this method, those pixels from the i-th sector can be placed in the new area whose shortest distance from the seed pixel is less than the threshold value , that is defined as Seed selection is done as area limiting method.The shortest path between seed and pixel is defined as the total distance of points that minimize the distance between them [15].Dijkstra algorithm is used to calculate the shortest path.Accordingly, the image is considered as a graph whose nodes are connected by edges and these nodes represent the image pixels.The amount of each edge between two nodes and is defined as Euclidean distance between them ( ) .In the beginning, to find the shortest path, the amount of the node related to the seed in each area of section is considered as zero and the amount of the other nodes are considered as infinitely, then, all groups are stored in one vector.By starting the path from the seed, its amount is added to eight adjacent neighbors if the edges are placed in the area, and its result is replaced with the amount of that node if it is less than the amount of the node attached to the edge.Then the seed value is removed from the vector and stored in a new vector.Among the other points of the first vector, its minimum is selected as the next start point.This method will continue to the extent that all of the components of the first vector are removed.Finally, all the values associated with each node in the new vector are equal to the shortest distance to the seed.In order to select the threshold for the seed, three classes with maximum likelihood measure [16] and for the other pixels one class with maximum likelihood measure are considered.Then the average of the shortest path for the pixels for which the specified class is one of the three classes considered for seed is calculated and displayed by b.Interval [ ] is used for the second stage segmentation.Studies showed that the threshold for the areas whose pixel number is 1.5 times more than the average number of area pixels and the threshold b for smaller areas have better results.Fig. 3 shows the block diagram of shortest path method.

Hyperspectral image
Segmentation of the first stage by comparing each pixel with its eight neighboring pixels using the SSV criterion Generate the median vector for each region, whose components are the sum of the distance between each pixel and the other pixels in the region.

Select the smallest value as seed
Euclidean distance per pixel with seed pixels per area The growth of new sector will continue to the extent that the condition smaller than T be is true Remove the pixels in the new area from the vector www.ijacsa.thesai.org

IV. PRACTICAL RESULT
The image used for implementing the methods of image segmentation is of an agricultural region, taken by the AVIRIS sensor.This image has 220 bands and 145×145 pixels in each band.Simulation of this article has been done using MATLAB software.According to the described description, the segmentation into the proposed method is done in two steps.Fig. 4 shows the first stage segmentation based on SSV similarity measure with the threshold value of 0.55.In Fig. 5 and 6, the segmentation image is shown using the proposed methods of area limiting and the shortest path.
In Fig. 7 and 8, the segmentation image is shown using previous watershed and levelset methods.To compare proposed and previous methods, the criteria for the number of producing regions, the integration of non-homogeneous regions, the homogeneous regions decomposition, the delineation of the boundary between regions, and the placement of all pixels in the respective regions are used.The area number of segmented image is shown using the watershed and levelset and area limiting and shortest path methods in Fig. 9.The horizontal axis represents the previous and proposed methods, and the horizontal axis expresses the number of segments in relation to them.
Considering diagram, the watershed method has the highest area number and the level set method has the lowest area number.To compare the mentioned segmentation methods and evaluate their results, the image of thematic map is used in Fig. 10.Thematic map is a map showing the subject area and a specific theme associated with a particular geographic area.

Hyperspectral image
Segmentation of the first stage by comparing each pixel with its eight neighboring pixels using the SSV criterion Generate the median vector for each region, whose components are the sum of the distance between each pixel and the other pixels in the region.
Select the smallest value as seed Specify the minimum path to seed using the dijkestra algorithm for each pixel in the area The growth of new sector will continue to the extent that the condition smaller than H be is true Remove the pixels in the new area from the vector www.ijacsa.thesai.orgTo make it easier to compare the segmentation methods with each other, a rectangular shape box is determined in the same area of each image.
By comparing the image of each segmentation method with the subject map, it is specified that the number of watershed areas is high so that each homogeneous area is divided into several sub-areas and the created borders are not appropriate boundaries, but due to being small, the possibility of interference is low.
In segmentation using previous level set method, the number of areas is not high due to the integration of heterogeneous adjacent areas.In the figure, we can clearly see the integration of heterogeneous areas compared to the subject map.In this way, some parts are not segmented.In the both of proposed methods, homogeneous pixels are placed in one area and create better area numbers and borders than the other mentioned methods.But in these methods there is the possibility of merging very similar adjacent regions.Area limiting method shows the image details better and shortest path method creates smoother areas.

Conclusion
According to the described description, the segmentation into the proposed method is done in two steps.Segmentation using the area limiting and shortest path to seed pixel methods improve the first stage segmentation that works on local information by taking advantage of spatial information.If segmentation is performed correctly, homogeneous pixels are placed in one area and area interference does not occur.In watershed method, the boundaries of each homogeneous areas is divided into several sub-areas and this causes an increase in the number of areas, but because the areas are small, the possibility of area interference occurrence is lower.The lowness of the area means that segmentation is not true so that in the level set method, the area number is lower than other methods, but several non-homogeneous areas are combined with each other.This method is sensitive to the parameters and the curve start points are very important.Furthermore, when the image contains smooth areas of brightness increase or decrease, it does not work properly.In proposed area limiting and shortest path methods, the homogeneous pixels are placed in one area and create more favorable areas and border numbers than the other mentioned methods.But in these methods, there is the possibility of merging very similar adjacent regions.The area limiting method shows the image details better and the shortest path method creates more smooth areas and also creates fewer areas than the area limiting method.It is suggested that researchers in the future examine other methods for selecting the pixel seed to improve segmentation accuracy.

Fig. 1 .
Fig. 1.Evolution of the closed curve C expressed using a function between the two times t and .

Fig. 4 .
Fig. 4. Segmentation based on SSV similarity measure with the threshold value of 0.55.