Keywords

1 Introduction

In the area of machine vision applications, the details of edges obtained from each image play an important role in the analysis of image information. Thus, the study of effective image information has become one of the major areas of research among experts. Edge detection is a method in which the change occurs at the pixel in the image. Among the more commonly used detection methods used are the Sobel, Prewitt, Laplace, Log and Canny methods. Even though each of these methods has their advantages in controlling a simpler and less computational algorithm, there are also certain deficiencies in their applications. For the Sobel and Prewitt methods, these apply convolution to solve each pixel dot by using first order differential, however, if the convolution kernel is not properly selected, whether it is too large or too small, the edges are coarsened or a lot of false edges are generated. The Laplace method detects image edges by solving the second-order differential partial zero-value points, so it influences the accuracy of edge detection by detecting the most noise points in the image. The Log method uses a Gaussian filter for data smoothing, then the Laplace non-directional operation will be applied, and uses zero crossing points on the image edge point. However, this method has been seen to wrongly detect edges that involve a bit change of grey scale in the local area [1]. There is a conventional analysis, the Canny operator, that whilst on the basis of theory and practice is concluded to be the most optimal method, often does not bring optimal results. First, in the Canny method the images are smoothed with a Gaussian filter. By using this filter the high frequency signals that make the edge pixels present may also be smoothed. This operation causes loss of edge information while suppressing the noise. Next, the high and low threshold values that have been set manually require thorough prior research and repeated experiments may be required to set the proper threshold. However, in practice, the high and low threshold values will change because the scenes and lighting changes are different for each image. Conventional operators lack the ability of adjustment in many cases, therefore, they cannot get satisfactory detection results [1, 2].

The Otsu method introduced by [3] is generally used in order to make the conventional Canny method adaptively find the high and low thresholds [4,5,6,7,8]. Much research has been done in the modification of the Canny method by using the Otsu method in specific areas such as in logo edge detection [4], classifying Penaeid prawns species [6], segmentation of field leaf image [7] and edge detection in the Berkeley dataset [9]. Fixed partitioning is used in order to thoroughly analyse the image globally and locally. By using fixed partitioning, the local spatial value of an image will be obtained. When using fixed partitioning on the image, the image is divided into several equal parts and for each part of the local histogram will be calculated. One of the main advantages of using this method is that it provides an additional input to the histogram in order to obtain the spatial distribution of image content [10]. A comprehensive approach to producing edges for the different types of image data have been used in this proposed method.

In this paper, we propose an algorithm for finding edge images from various types of images by using an adaptive threshold approach based on local value after fixed partitioning in five different levels of the image. The high threshold value is obtained by using the Otsu method [3] and the low threshold value is obtained by halving the high threshold value. The most accurate edge image obtained will be measured. The experiment shows that the proposed method gives the most accurate edge image compared to the Canny method and previous experiments. Datasets from Berkeley [11], DRIVE [12] and Persian [13] have been used since the ground truth images are provided as well as to validate data from CASIA V2.

2 An Adaptive Threshold Based on Multiple Resolution Levels for Canny Edge Detection

As each image is retrieved, it is transformed into grey level images. The image is then partitioned into different levels. Canny edge detection will be used to detect the edge with assistance from the Otsu method but some modification is applied in order to get the best high threshold (H t ) value and low threshold (L t ) value. Here, by using multiple resolutions of images, consideration variance values on global for L 1 and local spatial value in L 2 until L 5 are carried out.

Let L be an m × m partitioning image and each represented image partition in level L m where \( m = 1,2, \ldots ,5 \). In each level, partition L mj will contribute to give local H t and L t values where \( j = 1,2, \ldots ,m^{2} \) (see Fig. 1).

Fig. 1.
figure 1

Fixed partitioning on images

For non-partitioned and global analysed images L 1, H t and L t will be obtained directly [2, 9]

$$ H_{t} = {\text{Otsu Method}}\,\;\left[ 3\right]\,\;{\text{and}}\,L_{t} = \frac{1}{2}H_{t} $$
(1)

The proposed approach uses this concept to fix the partitioning in each L m image as carried out in [9]. Here, modifications are in determining the spatial H t and L t values in every local partition. At each stage of the resulting minimum value of H t will be selected.

$$ H_{t} = \frac{1}{n} \times \,\arg \,\hbox{min} (H_{t} \in L_{mj} ) $$
(2)

Then, the corresponding L t for each L mj is

$$ L_{t} = \frac{1}{2}H_{t} \,{\text{for}}\,{\text{each}}\,H_{t} \in L_{mj} $$
(3)

Next, the minimum value of L t

$$ L_{t} = \frac{1}{n} \times \,\arg \,\hbox{min} (L_{t} \in L_{mj} ) $$
(4)

where \( n = 1,2,3, \ldots ,10. \)

Furthermore, the value H t and L t that give the accurate edge image are selected.

3 Experiment and Results

In this study datasets from Berkeley [11], DRIVE [12] and Persian [13] which provide the ground truth images been used. In addition, the iris data from CASIA V2 have also been used. Even though the DRIVE and Persian databases provide the ground truth images, in this experiment some modification has been made because the ground truth images provided in the dataset are for binary image analysis. So, in order to compare with the result from this experiment, edge images from the binary image provided have been produced.

Here, the measurement is Figure of Merit (FOM) provided by Pratt [14], which is:

$$ {\text{FOM}} = \frac{1}{{\hbox{max} (N_{1,} N_{T} )}}\sum\limits_{i = 1}^{{N_{T} }} {\frac{1}{{1 + \alpha d_{i}^{2} }}} $$
(5)

where N 1 and N T refer to the number of ideal and the actual edge points, while, d i is the pixel Euclidean distance of the ith edge detected, and \( \alpha \) is a scaling constant selected to be \( \alpha = \frac{1}{9} \) and is used for penalising the displaced edges. Larger FOM values (values are between 0 and 1) indicate better performance in the resultant images.

Here only \( n = 1,2,3, \ldots ,10 \) are considered because from the result of FOM on one of each dataset used shown in Fig. 2 that the most accurate edge image is contained in between that range which is the highest FOM value (marked by the arrow). By using this method 41 values of H t and 41 values of L t will be produced. After that, the edge image obtained is compared with the image obtained from the traditional Canny method and the other adaptive method by [9].

Fig. 2.
figure 2

Graph of FOM results obtained from one image on each levels for each dataset used

Table 1 shows the FOM values from the Berkeley, DRIVE and Persian datasets. The FOM results from the adaptive method by [9] are not all higher than those from the Canny method. There are certain images that give FOM results lower than the Canny method such as in all four DRIVE images and the Persian02 image. Furthermore, by using the proposed method, the results show that the FOM values are higher than values from the Canny method and the adaptive method by [9] work.

Table 1. FOM result

In terms of the image, the results show that the Canny method contained more unwanted edges and that the adaptive method by [9] contained fewer edges which give incomplete edge results. However, the proposed method shows the complete edge image result (see Figs. 3, 4, 5 and 6).

Fig. 3.
figure 3

Edge image obtained from image 3063 Berkeley dataset. (a) Original image, (b) Ground truth image, (c) Canny method, (d) adaptive method by [9] and (e) Proposed method.

Fig. 4.
figure 4

Edge image obtained from image 01 DRIVE dataset. (a) Original image, (b) Ground truth image, (c) Canny method, (d) adaptive method by [9] and (e) Proposed method.

Fig. 5.
figure 5

Edge image obtained from image Persian01 Persian dataset. (a) Original image, (b) Ground truth image, (c) Canny method, (d) adaptive method by [9] and (e) Proposed method.

Fig. 6.
figure 6

Edge image obtained from CASIA V2. (a) Original image, (b) Canny method, (c) adaptive method by [9] and (d) Proposed method.

4 Conclusion

This paper proposes a modified Canny edge detection method by applying self-adaptive threshold values selected with the aid of the Otsu method. Furthermore, the calculations have been carried out on images globally and locally using fixed partitioning and at multiple resolution levels. In order to get the optimal threshold value, a sampling approach has been used by calculating the minimum between class variance values from each block.

The results show that from the four type different image datasets used, the proposed method outperforms the Canny method and previous work in terms of FOM values and the edge image results obtained. The result of the image shows the accurate edge image because it contains the edge image from the foreground and has ignored the edge image from the background.