5.2 Image Segmentation
5.2.1 Image Segmentation based on Edge Detection
The edge detection methods of an image reduce the image data quantity to be processed and contain essential information regarding the object shape in the scene. They have been able to extract the exact edge line for all object in the image with good orientation as well as more literature about these techniques are available and applied in many applications such as biometrics, medical image processing, security, monitoring the electrical devices and many others. However, there is no study indicates and judges the performance of these techniques because all the judgment that have been done by authors are always separately based on their applications.
Several methods such as “Sobel”, “Prewitte”, “Roberts”, “Canny”, “LoG” and “Otsu” have been used for finding and extracting the hottest region from the thermal images by calculating the gradient based edge detection. The following sub-sections will review these techniques briefly.
5.2.1.1 Sobel Edge Detection
The Sobel edge detection method was introduced by Sobel in 1970 [167]. It proceeds the edge at those points where the gradients are higher. The gradient ( ) is the differences between the columns and rows of neighbourhood 3x3 which is calculated by Sobel operators, table 5-2 below shows the center pixel in each column and raw [168].
Table 5-2: Image neighbourhood (center pixel).
Z1 Z2 Z3 Z4 Z5 Z6 Z7 Z8 Z9
Where & are Sobel operators in the X and Y- axis respectively.
Masks for and direction in Sobel operators as shown in table 5-3 and table 5-4
5.2.1.2 Prewitt Edge Detection
The Prewitt edge detection has proposed by Prewitt in 1970 as well [167]. It estimates the magnitude and orientation of image object edge. It is limited to eight possible directions. Nevertheless, the result shows that the most direction estimates are not perfect than the first 8. The gradient-based edge detector is estimated in the 3*3 neighbourhood for 8 directions as shown in table 5-5 and table 5-6. Thus, if all the eight convolution masks are calculated, one of the masks will be selected for data processing.
Table 5-5: Masks for direction.
-1 -1 -1 0 0 0 1 1 1
Table 5-6: Masks for direction.
-1 0 1 -1 0 1 -1 0 1
Table 5-3: Masks for direction.
-1 -2 -1 0 0 0 1 2 1
Table 5-4: Masks for direction.
-1 0 1 -2 0 2 -1 0 1
Prewitt edge detection technique is slightly simple to implement than the Sobel detection, but it tends to produce somewhat noisier results.
5.2.1.3 Roberts Edge Detection
Lawrence Roberts introduced the Roberts edge detection method in 1965 [169]. It performs a simple, quick to compute, 2-D spatial gradient measurements to the image. Each point of the output image represents the estimated absolute magnitude of the spatial gradient of the input image at that point. In case of 2*2 gradient operator as shown in table 5-7 and table 5-8, Roberts operator has been used for calculating the difference between adjacent pixels.
Table 5-7: Masks for direction in Roberts operators.
-1 0 0 1 Table 5-8: Masks for direction in Robert’s operators.
0 -1 1 0 5.2.1.4 Canny Edge Detection
Canny edge detection is considered as multi-step method that can detect all object edge in the image with noise reduction [170], as shown in the following steps:
5.2.1.4.1 Noise Reduction
Gaussian filter has been applied to reduce the noise and unwanted details in the image based on the following equation:
Where , is the gradient operators, , is the Gaussian filter, is the standard deviation and , is the adaptive filter.
Where the is computed by:
√ (5-6) 5.2.1.4.2 The Gradient Computation
The gradient magnitude and direction have been calculated at every single point based on the Sobel kernel for both directions vertical ( ) and horizontal ( ). The gradient can be calculated for each pixel from two images as follows:
Where and are the derivatives directions of X and Y points.
In this step, two cases have been considered for gradient: the first is high gradient, which means that there is a significant change in the colour (implying edge), and the second is low gradient, which means that there is no substantial change (no edge). It is rounded into four angles, which are two diagonal directions, horizontal and vertical.
5.2.1.4.3 Non-Maximum Suppression
In this step, full scanning for the image will be done to remove any unwanted pixels that may not constitute as edge. Every pixel will be checked, whether it is a local maximum or not. If it is not a local maximum, the pixel will be set to zero, otherwise it will considered as edge. Consequently, at the end, the results will be a binary image (5-7)
The edge on the point A is in a vertical direction and the gradient direction as normal, which is point B. Therefore, point A will be checked, if it is in local maximum, it will be considered as edge, otherwise, it will considered as suppressed and set to zero.
5.2.1.4.4 Hysteresis Thresholding
In this stage, the decision will be made to all pixels to be really edge or not. In this case, two values for thresholding is needed, maxVal and minVal. Any values of edges with the intensity gradient less than minVal are non-edge (discarded) and those with more than maxVal are edge. The values that are lie between these two values, they will be checked based on the connectivity to decide either it is an edge or not. If they are connected to non-edge pixels, they will be considered as not edge. Otherwise, they will be considered as edge.
Unlike Sobel and Roberts, the Canny edge detection is not very susceptible to noise, if Canny detector worked well it would be superior.
5.2.1.5 LoG Edge Detection
Laplacian of Gaussian (LoG) has been proposed by Marr (1982) [171]. It is a second Figure 5-1: How to detect the edge by non-maximum suppression.
the laplacian, which yields a double edge image and locates the edges and finding the zero crossings between the double edges. The following masks have been used for implementing the laplacian function as shown in table 5-9 and table 5-10.
Table 5-9: Masks for direction in Log.
0 -1 0 -1 4 -1
0 -1 0
Table 5-10: Masks for direction in LoG.
-1 -1 -1 -1 8 -1 -1 -1 -1
The LoG has been used for finding the pixel of an edge whether it is on dark or on light side.
5.2.1.6 Otsu Method
This method has been widely applied for thermal image processing in order to detect the hot regions. It is automatically perform clustering based on image threshold. Every image has two classes of pixels, and then it separates these classes by calculating the optimum threshold with the aim of minimal into the intra-class variance. Four important steps need to be followed in this method to obtain the Otsu image, which are explained below [172]:
1) Select average value of image intensity (estimated threshold).
2) Divide the image into two regions R1 and R2, and then calculate the mean and values for each region.
3) Select a new threshold
4) Repeat steps 2-4 until and values do not change.
All the proposed edges detection methods above have been used for extracting the hottest region from the thermal image in order to have the exact and best hotspot in the induction motor thermal image. In addition, the results that are obtained from the edge detection methods have been used for extracting the best image metrics such as mean, mean square error and peak signal to noise ratio, variance, standard deviation, skewness and kurtosis with the purpose of using them in classification algorithms by assigning them to proper class. The following section describes and discusses the image metrics based on the edge detection results.