Robust Corner Finding Based on Multi-Scale K-Cosine Angle Detection

Corner is widely utilized in computer vision and image processing. As a representative contour-based corner detection algorithm, RJ detector is first proposed to use the K-cosine to estimate curvature of digital curves for corner finding. However, such influential approach is quite sensitive to the geometric transformations and noise due to its dynamic smoothing scale. To overcome this drawback and enhance its performance further, this paper presents a multi-scale version of RJ detector. First, we adopt fixed region of radius (RoS) to avoid its sensitiveness to geometric transformations; second, the technique of scale product is employed to enhance curvature extreme peaks and suppress noise for improving localization. Extensive experiments on several corner detection datasets are conducted for evaluating its performances. And the experimental results demonstrate that such simple idea endows RJ an incredible improvement and MSRJ achieves the competitive performance compared with state-of-the-arts corner detectors under measure metrics of average repeatability and localization error.


I. INTRODUCTION
Corners are the outstanding local features of image and have played important roles on many applications in image processing and computer vision, such as robot navigation, video retrieval and intelligent transportation systems and so on. By now, plenty of corner detectors have been proposed, which can be broadly separated into two kinds: intensity-based detectors [1]- [9] and contour-based detectors [11]- [29]. With respect to contour-based methods, corners are mainly detected on the boundaries extracted from images among which estimating the digital curvature of the boundaries is the critical step.
Rosenfeld and Johnston (RJ) [11] first considered angle as the discrete curvature to find corners for digital curves and later they presented its improved version which used average angle instead [12]. In RJ algorithm and its improved version, the angles of a digital curve are calculated by K-cosine, where K is the radius of the region of support (RoS). Since the angle The associate editor coordinating the review of this manuscript and approving it for publication was Zhihan Lv . detection of RJ detector and its smoothed version depends on the curve length, they are sensitive to some geometric transformations, such as scaling, rotation and so on [18]. In addition, they may assign an incorrect region of support (RoS) and incorrect curvature measures to a point. In [13], Mokhtarian proposes the classical contour-based corner detector based on curvature scale space technology (CSS). After that, plenty of CSS based corner detectors are presented, such as MSCP [15], DCSS [16] and ATCSS [17] etc. However, CSS-based corner detectors are susceptible to the local variation of the curve and noise generally due to its small neighborhood [30].
To overcome the such problems of CSS corner detectors, Awrangjeb and Lu proposed to utilize chord-to-point distance accumulation technique (CPDA) [18] for corner finding and later they presented its accelerated version (fast-CPDA) [19]. CPDA detector reported better performances compared CSSbased detectors. Nevertheless, there are still some problems faced by CPDA algorithm. For example, the curvature values estimated of CPDA technique to measure the sharpness of the corners may not be proportional to the angle of the corners [23] and meanwhile some weak corners would be missed due to the larger radius of the RoS. To address this issue in CPDA, Teng et al. [23] proposed to utilize simple triangular theory and distance calculation for effective and efficient corner detection (CTAR) and Lin et al. [28] proposed to use the altitude-to-chord ratio accumulation (ACRA) as the curvature significance. In recent years, many other impressive contourbased corner detectors have also been proposed [21]- [29]. In [40], Zhang et al. estimated the curvature in a continuous way by employing the Chebyshev polynomial fitting, however, it's time consuming since the fitting has high computational complexity. In [24], Zhang et al. employed Laplacian of Gaussian (LoG) operator to analyze the scale-space behavior on a planar curve. To achieve the highest possible detection accuracy while minimize the computational complexity, Lin et al. [27] introduced a new measurement termed as secondorder difference of contour (SODC). Since SODC uses a relative bigger neighborhood and meanwhile choose a large value for the Gaussian smoothing parameter, it may miss some weak corners. RJ angle detection algorithm is somewhat older but still much used. However, its performance reported in [18], [30] is very poor. In this paper we attempt to overcome the weakness of RJ algorithm mentioned in [30] and at the same time introduce the technique of scale product to improve its localization and robustness to noise further.
We organize the remainder of this paper as follows. First, we present the most relevant RJ corner detection technique in section 2. Then in section 3 we introduce our new approach to overcome the sensitivity of RJ detector to geometric transformations and improve its performance further. Section 4 provides experimental results and section 5 draws the conclusions of the paper.

II. RELATED WORKS
In this section we simply introduce the RJ algorithm [11] and its smoothed version [12] mainly observing the description in [13]. Let the sequence of L integer-coordinate points describe a curve C, C = {p i = (x i , y i ) , i = 1, 2, · · · L}, where p i+1 is a neighbor of p i .

1) Define the k vectors at p i as
3) Let m = L/10 or L/15 and compute the cos ik , k = 1, 2, · · · , m. 4) Assume h j , j ∈ satisfies cos im < cos i,m−1 < · · · < cos i,h j > cos i,h j−1 and h (i) = max{h j , j ∈ }, then the curvature value at p i is defined as cos i,h (i) . 5) Those points p i which satisfy cos i,h (i) > cos j,h (j) , |i − j| ≤ h i /2 are considered as corners.

B. THE IMPROVED VERSION OF RJ DETECTOR
Compared with RJ algorithm, its improved version executes the calculation of k cosines (k > 1) at each point in step 2 as follows: The { −→ cos ij } are then treated just like cos ij after step 2. RJ detector presents an angle-based method for corner finding on digital contours. However, since its smoothing factor m in step depends on the curve length, it is sensitive to some geometric transformations (scaling, shearing etc) and it fails on extensive comparative experiments [18]; besides, RJ algorithm is also very time-consuming due to the dynamical acquire of the region of support (RoS) in step 3.

III. MSRJ CORNER DETECTION ALOGORITHM
In this section, we provide our procedure to improve the RJ detector in detail. First, to make RJ detector more robust under geometrics or other attacks and more efficient, we choose fixed RoS instead of depending on the curvelength; second, the multi-scale technique is introduced to suppress noise and improve localization further. With this philosophy and the problems of RJ algorithm in mind, a new angle detection procedure is proposed as follows: 1) Let represent a regular planar curve which is parameterized by the integer number n: (n) = (x(n), y(n)), (n, σ ) denotes an evolved version of the curve , i.e (n, σ ) = (X (n, σ ), Y (n, σ )) where X (n, σ ) = x (n)⊗g (n, σ ), Y (n, σ ) = y (n)⊗g (n, σ ), and ⊗ is the convolution operator. g (n, σ ) denotes a Gaussian function with deviation σ . Note a nk = (x(n+k, σ )−x(n, σ ), σ )), then the k − cosine of the angle between the k vectors a nk and b nk under scale factor σ is represented as It is not hard to derive that −1 ≤ c k (n, σ ) ≤ 1, and c k (n, σ ) = 1 for the sharpest angle (0 • ), and −1 for a straight line (180 At each point p n = (x(n), y(n)), assign the multi-scale curvature product as the corner response function. 3) Retain those points p n where c k,n > c k,j for all j such that |n − j| ≤ 2 as the curvature maxima. Since c k (n, σ ) ∈ [−1 1] may be negative, we use 1 + c k (n, σ ) ∈ [0 2] alternatively to calculate the discrete curvature represented in equation (3). The main differences between MSRJ algorithm and RJ algorithm lie in two aspects: first, the RoS of RJ detector is changed with the smoothing factor m and local contour variation while the RoS of MSRJ detector is fixed; second, the curvature value for each point corresponding to MSRJ is calculated using different scales while that corresponding to RJ is calculated using single scale. It is pointed out in [18], [30] that RJ detector showed poor performance since its smoothing factor depends on the curve length. So, by adopting fixed RoS, MSRJ algorithm can alleviate the weakness of RJ algorithm mentioned in [30]. What's more, inspired by the MSCP and SODC corner detectors, we take the product of the corner response values at different scales as the final corner response output to improve our detector further.
The basic workflow of the MSRJ can be illustrated as follows:
Outputs: corners of the gray-scale image.
Step 1: extract and select N contours from the original gray image Step 2: fill gaps and locate the T-junctions and mark them as T-corners in the edge contours.
Step 3: for i = 1 : N , do step 4-step 7 Step 4: smooth the ith contour (assume the length is N i ) using Gaussian kernels with standard derivation σ 1 = 2 and σ 2 = 4 respectively to remove noise and trivial details.
Step 5: for j = 1 : N i , do step 6 Step 6: among the region of support, calculate the discrete curvature of the ith contour in the jth point according to the equation (3).
Step 7: determine the corners in the ith contour by nonmaximum suppression with a threshold value and save their locations.
Step 8: output the all saved corners.

A. IMAGE DATASETS
There are two datasets utilized in our experiments to evaluate the compared corner detectors. The images in Dataset 1 (Fig. 1) are from [20] and the images in Dataset2 (Fig. 2) are provided by Dr. Awrangjeb et al. [30]. The images of the

B. EVALUATION CRITERIA
We employ two evaluation metrics to assess the performance of the comparative corner detectors, that is, Average Repeatability [18] and Localization Error.

1) AVERAGE REPEATABILITY (AR)
Let N o be numbers of corners detected from original images and N T be numbers of corners detected from test images. N r VOLUME 8, 2020  is the number of repeated corners between them. The AR metric is

2) LOCALIZATION ERROR (LE)
LE metric is measured via using the Root-Mean-Square-Error (RMSE) of the detected corners where (x ti , y ti ) and (x oi , y oi ) are the positions of the ith matched corner in the original and test images respectively.  An RMSE value of maximal 3 pixels is allowed to find a repetition.
In general, AR metric indicates the stability of a corner detector while LE metric indicates the accuracy of a corner detector.

1) PARAMETER SELECTION
Several experiments are conducted to provide some analysis on the behaviors of the proposed MSRJ detector to select its optimal parameters. We mainly investigate three parameters of the MSRJ detector, that is, Gaussian smoothing scale (σ ), RoS (n), and curvature threshold (T ).
A degree of smoothing can make the curvature extrema points more distinguishable from other curve-points [30]. With respect to MSRJ detector, we select scale σ = 2, 4. This selection is mainly based on the following consideration: a low value for the smoothing parameter (σ = 2) can keep many important details while large scale factor (σ = 4) can significantly reduce the effect of noise. We illustrate the advantage of multiscale detector over single scale detector simply with Fig.3. Fig.3 (a)-(b) show the edge image (of original ''Lena'' image) and the ground truth corners. Fig.3 (c)-(e) show the detected corners by RJ detector with fixed RoS under σ = 2, σ = 2, 4 and σ = 4 respectively. MSRJ (σ = 2, 4) detector finds all true corners without introducing any false corner while RJ detector with VOLUME 8, 2020 fixed RoS under σ = 2 introduces one false corner and that under σ = 4 misses one true corner. Fig.4 shows the effects of different parameters (the size of RoS n and curvature threshold T ) to the performances of the MSRJ, where we just present the performance on Dataset 1. In this experiment, we tune one parameter at one time and keep the others fixed at same time. The optimal parameters summarized in Table 2 of the other eight compared detectors on the two datasets have also been well tuned for fair comparison. In addition, the same Canny edge extraction [10] and contour-tracking methods have been applied to all the comparative detectors. Table 3, Fig.5 and Fig.6 show the average repeatability and localization error of the compared detectors under four geometric transformations and Gaussian noise on Dataset 1 and Dataset 2 respectively. The comparative results show that MSRJ detector offered highest average repeatability on both Dataset 1 and Dataset 2, with the best localization error (low error) on Dataset 1 and a similar localization error as the one of the LoG detector. Also, we can see that RJ [11] performed worst among all the competed detectors, one reason was that its smoothing factor depended on the curve length leading to its sensitivity to geometric transformations and other operations [30]; In addition, both an incorrect RoS and incorrect curvature measures may be assigned to a point. By adopting a fixed RoS and different angle calculation methods, MSRJ detector can alleviate this problem. Further, multi-scale technique has been employed to improve its localization and robustness to noises. Fig.7 shows the four sample images and their corresponding corner detection results by RJ and MSRJ respectively. It can be seen that RJ detector misses some true corners meanwhile yields many false corners compared with MSRJ detector. In short, the above experimental results show that MSRJ indeed overcomes the mentioned weakness to a great extent, which means that MSRJ has enormously improve the RJ based on fixed RoS and multi-scale technique. On the other hand, compared with other seven stateof-art methods, MSRJ provides promising results indicating that angle detection procedure is a powerful tool for corner detection. The performances of GCM detector is not as good as that of LoG and CTAR detectors. Due to the fact that GCM detector adopts a very small neighborhood, it is highly sensitive to geometric transformation [30]. Eigenvector detector performed not well either, because the wavelet transform of contour orientation is actually sensitive to the noise. MSRJ can alleviate these problems, since its angle calculation did not involve any derivative of curve-point locations. CPDA offered best localization error in Dataset 2, but its performance on Dataset 1 and Dataset 2 is not so good in terms of AR. Teng et al. [23] and Lin et al. [27] pointed out that its curvature values estimated suffered from some weakness and also some weak corners would be missed due to the larger radius of the RoS. MSRJ showed higher repeatability and lower localization error compared with CTAR, we attribute this partly to the fact that CTAR is a single-scale detector while MSRJ is a multi-scale detector. Table 4 shows the running time of each compared detector on two datasets, which is obtained on a Win10 machine with 3.4 GHz Intel(R) Core(TM) i7-7700 CPU and 8.00 GB RAM. It should be noted that the time for curve extraction is not included considering that the computational costs of this procedure are all the same for every detector. The reason why the execute time of the image from Dataset 2 is generally longer than that from Dataset 1 is that the images from Dataset 2 are larger. We can see from Table 3 that CTAR runs fastest while Eigenvector runs lowest. It is not hard to understand this situation since CTAR just need to calculate three Euclidean distances while the execution of wavelet transform is timeconsuming. MSRJ is slightly slower than F-CPDA mainly due to the execution of the Gaussian smoothing of the contour twice. From Table 3 we can also see that MSRJ is more efficient than RJ detector.

V. CONCLUSION
In this paper, we presented a novel discrete curvature estimator based on the classical RJ algorithm. First, we adopt fixed region of radius (RoS) to make it efficient and meanwhile avoid its sensitiveness under geometric transformations. Second, the technique of scale product are employed to improve its localization and robustness to noise. Experimental results show that MSRJ has greatly improve the performance of RJ, which also means that angle detection procedure is still a powerful tool for corner detection.
Nevertheless, MSRJ is a contour-based corner detector and also suffers from the problem seriously depending on the extracted contours; besides, since we choose the candidate corners from those points with local maxima of the absolute curvature function, determining the true corners just by setting thresholds may introduce some false corners. Afterwards, we would address the above two problems to further improve the performance of MSRJ.

ACKNOWLEDGMENT
(Shizheng Zhang and Baohuan Li contributed equally to this work.)