Keywords

1 Introduction

Edge detection has been of ultimate importance for numerous applications in the context of computer vision and image processing such as feature extraction [1], and noise detection [2]. As it is the primary step for several other computational procedures, its is widely applied to medical imaging [3, 4] and to other areas.

Since 1986, the methodology proposed by Canny [5] became widely used because of its simplicity, small number of parameters, and due its features such as good detection, good localization, and edge singleness. Afterwards, a number of works proposed improvements specially to parameter selection [6,7,8,9,10] and relevant edge recovery [11,12,13]. Nevertheless, no previous works enhanced Canny methodology to address Intensity non-uniformity in a satisfactory way.

Intensity non-uniformity may be described as a low-frequency noise, as it appears in the literature [14]. In this context, image inhomogeneity is described as a multiplicative low frequency noise showed in Fig. 1(a) and in Eq. 1, where J is the ideal image, I is the input image, B is the inhomogeneity, N is a high-frequency noise, and operator \(*\) is the Hadamard product.

$$\begin{aligned} I= & {} J * B + N, \end{aligned}$$
(1)
Fig. 1.
figure 1

Example 7 Tesla T1-weighted magnetic resonance image of the head. (a) The input image with very high inhomogeneity effect. (b),(c) Inhomogeneity effect partially corrected using N3 and N4 methodologies, respectively.

There are quite a few methodologies designed to correct the inhomogeneity effect of MRI without inserting artifacts into the image [15, 18]. Still, we are obviously not interested in methods that require edge detection or image segmentation as a pre-processing, since accurate edge detection is our final goal. Therefore, only two of them are well suited for our experiments. The first is the Non-parametric Nonuniform intensity Normalization [16] (N3) that was proposed in 1998 and estimates the inhomogeneity effects employing B-splines with a regular grid of control points in a interactive process. The second is denominated N4, and was proposed in 2010 by Tustison et al. [17] as an improvement to N3. It uses a more robust B-spline and a modified optimization strategy. Figure 1(b) shows the partial correction of the inhomogeneity effect by applying N3 over the input image (a).

In this paper, we make an evaluation of the effects of inhomogeneity correction prior to edge detection in 7T magnetic resonance imaging (MRI) of the brain. 7T images are particularly susceptible to intensity non-uniformity due to the strong bias field, and have attracted the attention of recent development of inhomogeneity correction methods [18]. We also propose a novel methodology to handle inhomogeneity while detecting edges in a non-supervised fashion.

The remaining of this paper is organized as follows: Sect. 2 presents related works; Sect. 3 describes the proposed methodology; Sects. 4 and 5 contain the experiments and the conclusions, respectively.

2 Related Works

Canny operator was one of the first methods introduced with mathematically formulated goals. The goals consist of detecting edge free from false borders, preserve all important edges, keep the minimum distance between the detected and actual borders, and set a single occurrence for each of them.

The basic Canny operator implementation follows the steps below:

  1. (1)

    Smooth the image applying a convolution with a Gaussian kernel removing image noise and irrelevant details. This step requires the definition of the Gaussian standard deviation \(\sigma \).

  2. (2)

    Compute the directional gradient of the pixels. A convolution with Sobel kernel may be used here.

  3. (3)

    Suppress pixels whose gradient are not maximal in the gradient direction, to achieve edge singleness.

  4. (4)

    Apply a hysteresis threshold, eliminating the weaker edges corresponding to less important details. This step requires the definition of higher (\(\tau _h\)) and lower (\(\tau _l\)) threshold parameters values.

The main parameters of Canny algorithm are \(\sigma \), \(\tau _h\), and \(\tau _l\). These parameters influence the amount of noise and details to be suppressed from the image.

Two kinds of strategy were designed to improve the original Canny method: automatic parameter selection; and recovery of mistakenly suppressed edges.

2.1 Parameter Selection

In [10], the authors adopted the automatic Otsu thresholding for \(\tau _h\) with \(\sigma =2.0\).

Huo et al. [9] proposed a probabilistic model to compute \(\tau _l\). The hypothesis is that lower intensity edges correspond to the texture that must be avoided.

Hui et al. [8] proposed the use of a sliding window to compute image signal to noise level and define \(\sigma \) after it.

Instead of computing the \(\tau _h\) and \(\tau _l\) to find the edges in a so called “instability zone”, [7] proposed to find the most appropriate thresholds in a large range, based on edge intensity and connectivity.

More recently, Rong et al. [6] proposed the use of adaptive thresholding methods, depending on the quantity of edges contained in the input image. It also introduced the concept of gravitational field intensity to replace image gradient preserving more relevant borders during non-maximum suppression.

2.2 Edge Refining

In [13] the authors computed the “major edges” by the traditional maximum suppression step, and detected “minor edges”, i.e. maximal intensity points in other directions than their gradient direction. Afterwards, only minor edges that are connected to major edges are preserved.

In the same fashion, Worthington [12] proposed a method that uses local curvature consistency to adaptively control the smoothness of gradient estimates, based on their neighborhood curvature, reducing the lost of relevant pixels.

Finally, Wang and Jin [11] tried to recover more suppressed edge pixels by including diagonal direction information both in gradient computation and in the non-maximum suppression step.

3 Proposed Methodology

The proposed methodology detects edges while dealing with non-uniformity effects in a non-supervised framework based on Canny algorithm. As inhomogeneity is a regional scale effect, the idea behind the methodology is to apply the thresholding process in multiple different scales and partitions of the image, so that important low contrast edges are detected. Also, it may be interesting to apply a filter, removing the components that are not connected to the edges found in higher scales. Algorithm 1 describes the proposed procedure:

figure a

Input parameters are: the input image \(Img_0\), the standard deviation of the Gaussian filter (\(\sigma \)); fractions (\(\tau _{fl}, \tau _{fh} \in [0.0,1.0]\)), used to compute hysteresis thresholds \(\tau _l, \tau _h\); and the number times (\(div_{max}\)) we divide the input image in smaller sections. The output is a binary image (Edge) with the detected edges.

In line 1, we smooth \(Img_0\) applying a Gaussian filter with standard deviation \(\sigma \) and generate \(Img_s\). Then, in line 2, we compute gradient magnitude and direction (Grad) from \(Img_s\). The non-maximum edges are suppressed in line 3 resulting in Supr. Hysteresis with parameters \(\tau _l\) and \(\tau _h\) is applied to Supr in line 5, generating the first set of edges Edge. The calculation of \(\tau _l\) and \(\tau _h\) may be a simple multiplication of \(\tau _{fl}\) and \(\tau _{fh}\) by the maximum gradient value, or a more sophisticated method as proposed by [7].

The external loop in lines 6–13 computes the size dims of image partition with successively smaller dimensions. Then, in the internal loop (lines 8–12) Supr is partitioned into \(Supr_p\) accordingly. For each partition, in line 10, a new hysteresis is applied, extending the current set of edges Edge. Note that \(\tau _h\) and \(\tau _l\) computed in line 9 might be different for each partition and for each scale, since they are based on local gradient values. Optionally, the new edges that are not connected to the previous ones are discarded in line 11. The external loop is repeated until the maximum number of subscales \(div_{max}\) of the image domain is reached. Finally, Edge is returned in line 14.

The key idea behind the algorithm is that instead of getting lower thresholds to detect all important edges influenced by inhomogeneity effect, it might be more insightful to employ distinct thresholds for each image section. In this way, there will be no spurious details in brighter regions.

The optional step in line 11 may be interesting for applications in which structures are strongly connected.

4 Experiments

In this paper, we implemented the unsupervised method proposed in [7] (MEDINA) and compared it with the addition of the non-uniformity treatment proposed in this paper (NOVEL). Notice that any improvement described in Sect. 2 could also be added to the framework proposed in this paper.

We used Baddeley’s measure [19] as comparison metric, given by Eq. 2:

$$\begin{aligned} \varDelta ^p_w(A,B)= & {} \left[ {\frac{1}{|X|}} \sum _{x \in X} {|}w(d(x,A)) - w(d(x,B)){|}^p \right] ^{1/p} \end{aligned}$$
(2)

where A and B are the processed and ground-truth edge pixel sets, respectively. X is the set of all pixel in the image domain, d(xA) is the distance of pixel x to the closest border pixel in A, w(t) is a continuous and concave function on interval \([0,\infty [\), |X| is the size of set X, and p is a scalar greater than 1. For an uncut distance function we chose \(w(t)=\min (t,c)\), with \(c=\sqrt{M^2 + N^2}\), where M and N are the number of columns and lines in the image, and \(p=2\).

For our database, we used 6 ultra high field of 7 Tesla (7T) T1-weighted magnetic resonance (MR) images of the human head. These are state-of-the-art images with higher resolution obtained at cost of field inhomogeneity. MR data was collected in a Siemens Magnetom at Martinos Center for Biomedical Imaging, Massachusetts General Hospital Charlestown, MA.

The experiments consisted in detecting edges belonging to the head and to the brain, without taking too many details. This procedure is extremely important to estimate the pose of the brain by means of the head position, and to strip the brain in the image [20]. It is very important to avoid detecting too many edges of small structures since they may confuse skull-stripping algorithms. Evidently, it is also fundamental to keep the most relevant and long borders.

In a initial qualitative analysis we manually set parameters to the best set of values to detect external brain and head edges in 3D images. Figure 2 shows the improvement achieved by our methodology (Inhom) with the optional step (line 11 of Algorithm 1) with 3 scales over 7 Tesla MR images. We executed traditional Canny algorithm over the input image, and over corrected images by N3, and N4. It is clear that it is impossible to detect the lower edges around the head and neck and at the same time avoid marking several edges from brain gyri and sulci without using the proposed methodology (Compare the first two columns in Fig. 2 to the last column).

Fig. 2.
figure 2

Qualitative experimental results with best parameters tuned manually. Input images showed in Fig. 1(a)(b)(c) generated results in the first, second, and third lines, respectively. First column: Canny algorithm with \(\tau _l=0.6\), \(\tau _h=0.95\), \(\sigma =1.0\). The cerebellum was not delineated, but borders of small structures already appear inside the brain. Second column: Canny with \(\tau _l=0.45\), \(\tau _h=0.9\), \(\sigma =1.0\). The neck was not delineated, but almost all internal borders already appear in the brain and part of the cerebellum. Third column: Proposed approach with \(\tau _l=0.45\), \(\tau _h=0.9\), \(\sigma =1.0\), \(div_{max}=3\). The main edges were correctly delineated, with a few borders inside the brain. Dark gray, light gray, and white pixels were found in the first, second, and third scale iteration, respectively.

In our qualitative evaluation of 7T MR images, we run NOVEL with 2 scales and MEDINA with \(\sigma \in \{0.6, 1.2, 1.8\}\) against manually segmented brain and head contours by a specialist. We used 18 test cases, being two sagittal slices extracted from each 3D image. Table 1 shows the accuracy of the methods according to Baddeley’s measure. The best results were achieved with \(\sigma =0.6\), in which NOVEL improved MEDINA in 28.0% in average. All comparisons between corresponding NOVEL and MEDINA are significant according to paired t-test, achieving \(p<0.0062\).

Table 1. Mean and standard deviation of Baddeley’s measure between estimated edges and the ground truth in 7T dataset. Testes executed over input images, and corrected images by N3 and N4. The lower is the value, the more accurate is the method.

Contrarily to what happened to MEDINA, our method improved the accuracy with higher \(\sigma \) values. Higher \(\sigma \) values blur the smaller details of the image, but NOVEL was able to get stronger contours in darker areas due to its local analysis. Also, executing MEDINA over N3, or N4 corrected images did not improve the results, as someone may expect. This happened because the automatic parameter selection tend to give higher priority to the borders in brighter regions (i.e. gyri and sulci) to the detriment of the darker edges that seems to be more relevant to human eyes (i.e. inferior border of the brain and cerebellum, neck and chin), even though they were considerably enhanced by N3 and N4. Therefore, correcting inhomogeneity is not sufficient for a more precise and clean head and brain edge detection.

5 Conclusion

We showed in this paper that current inhomogeneity correction algorithms are not sufficient for head and brain edge detection in 7T MRI images using the original framework proposed by John Canny. It became clear that both Canny’s and Medina’s methods lack a better treatment for images corrupted by non-uniform low-frequency noise. We also proposed a non-supervised method that solved this problem efficiently, detecting important local edges weakened by shades or inhomogeneity in MRI. Future works include an evaluation of the proposed method with respect to non-maximum suppression edge refinement.