2.2 Classical Edge Detection Methods
Edges represent the boundary of objects and it is one of the classical segmentation algorithms. From the human perception of point of view, edges play a vital role and in medical image processing, they characterize anatomical organs or anomalies like a tumor, cyst.
The edges are characterized by intensity changes and the gradient operator is widely used to determine the magnitude and direction.
The gradient vector of the image is defined as follows
$$\nabla Y=\left[\begin{array}{c}{S}_{x}\\ {S}_{y}\end{array}\right]=\left[\begin{array}{c}\frac{\partial S}{\partial x}\\ \frac{\partial S}{\partial y}\end{array}\right]$$
The magnitude (M) and direction of gradient vector (\(\nabla Y\)) at the location are determined as
$$M\left(x,y\right)=\sqrt{{S}_{x}^{2}+{S}_{y}^{2}}$$
$$\theta \left(x,y\right)={\text{tan}}^{-1}\left(\frac{\partial S}{\partial x}\right)$$
The partial derivatives \(\frac{\partial S}{\partial x}\)and \(\frac{\partial S}{\partial y}\) are determined at every pixel of the image to compute the gradient vector. The classical edge detectors kernels are depicted in Figures 1,2,3 and 4.
The Roberts, Prewitt, Sobel, and Canny are based on first-order derivatives and the difference is how the computations are carried out. The most commonly used approach for approximation of the first-order derivative is to apply Taylor’s series expansion with a small value of h.
The \({S\text{'}}_{x}\)is determined as\({S\text{'}}_{x}\simeq S\left(x+h\right)-S\left(x\right)/h\)
The first-order derivative of the image in discrete form is
$${S}_{x}=\frac{\partial S(x,y)}{\partial x}\simeq S\left(i+1,j\right)-S(i,j)$$
$${S}_{y}=\frac{\partial S(x,y)}{\partial y}\simeq S\left(i,j+1\right)-S(i,j)$$
The 2D Roberts masks are as follows
The 2D masks are relatively simple. However not symmetrical for central points. The symmetrical edges are a desirable property and can be obtained with odd-sized masks.
The 3x3 masks for the Prewitt edge detector are as follows.
The x-direction derivative is represented by the difference between the first and third rows. The derivative in the Y direction is represented by the difference between the first and third columns. Image smoothing is improved when the center coefficients are given more weight.
The 3x3 masks for the Sobel edge detector are as follows.
There are several edge detection algorithms; nevertheless, among the standard approaches, the canny edge detector was shown to yield the best results. Because the input medical images are prone to noise, preprocessing is required before edge recognition. The steps can be stated as follows:
-
As a first stage in reducing noise from medical images, a Gaussian filter with a kernel size of 5 is utilized.
-
The non-maximum suppression method is used to delete pixels that are not part of edges.
-
The final step that detects the image using two thresholds (tupper and tlower)is hysteresis. It is defined in the pixel when the pixel gradient is greater than the tupper, and the pixel is discarded when the pixel gradient value is smaller than the tlower. If the pixel gradient lies in the range tupper<t<tlower, then pixel is selected if it is linked to pixel greater than tupper.
The Laplacian of Gaussian (LOG) is an edge detector based on second-order derivative and is expressed as follows
$$L\left(x,y\right)=\frac{{\partial }^{2}S}{{\partial x}^{2}}+\frac{{\partial }^{2}S}{{\partial y}^{2}}$$
Similar to the Canny edge detector, Gaussian smoothing is performed initially to remove the spurious details in the image. The LOG masks are expressed as follows.
2.3 Gauss Gradient Edge Detectors
2.3. 1 First Order Derivative based Gauss Gradient edge detector
The gauss gradient approach determines the edge of 2D images and 3D volumes using the derivative of the Gaussian function.
The 2D Gaussian function is expressed as
$$h\left(x,y\right)=\frac{1}{2\pi {\sigma }^{2}}{e}^{-\left(\frac{{x}^{2}+{y}^{2}}{{\sigma }^{2}}\right)}$$
Here in the proposed gauss gradient approach, separable filtering is employed. The one-dimensional Gaussian kernel is formulated and applied along the x and y directions. The steps in the gauss gradient approach are expressed as follows.
Step 1: Set the value of sigma for the input grayscale or color image. The parameter sigma value is crucial, as the high value will blur the resultant image.
Step 2: The mask is formulated along the x and y direction for convolution with the input image to trace the edges.
The 2D Gaussian function when expressed in 1D function in terms of the variables x and y is expressed as
$$g\left(x\right)=\frac{1}{\sigma \sqrt{2\pi }}{e}^{-\frac{{x}^{2}}{{2\sigma }^{2}}}$$
$$g\left(y\right)=\frac{1}{\sigma \sqrt{2\pi }}{e}^{-\frac{{y}^{2}}{{2\sigma }^{2}}}$$
The first-order derivative of the one-dimensional Gaussian function along the x-direction is expressed as follows
$$\frac{\partial }{\partial x}\left(g\left(x\right)\right)=\frac{1}{\sigma \sqrt{2\pi }}\frac{-2x}{{2\sigma }^{2}}{e}^{-\frac{{x}^{2}}{{2\sigma }^{2}}}$$
$${g}^{\text{'}}\left(x\right)=-x\left(\frac{1}{\sigma \sqrt{2\pi }}\right)\frac{{e}^{-{x}^{2}}}{{2\sigma }^{2}}*\frac{1}{{\sigma }^{2}}$$
$${g}^{\text{'}}\left(x\right)=-x*g\left(x\right)*{\sigma }^{2}$$
Similarly, the first-order derivative of the one-dimensional Gaussian function along y-direction is expressed as follows
$$\frac{\partial }{\partial x}\left(g\left(y\right)\right)=\frac{1}{\sigma \sqrt{2\pi }}\frac{-2y}{{2\sigma }^{2}}{e}^{-\frac{{y}^{2}}{{2\sigma }^{2}}}$$
$${g}^{\text{'}}\left(y\right)=-y\left(\frac{1}{\sigma \sqrt{2\pi }}\right)\frac{{e}^{-{y}^{2}}}{{2\sigma }^{2}}*\frac{1}{{\sigma }^{2}}$$
$${g}^{\text{'}}\left(y\right)=-y*g\left(y\right)*{\sigma }^{2}$$
Step 3: the generated masks along the x and y direction are convolved with the input image for tracing the boundary of objects
$$\text{H}\text{x}=\text{g}\left(\text{x}\right)\text{*}{\text{g}}^{{\prime }}\left(\text{x}\right) \text{a}\text{n}\text{d} \text{H}\text{y}={\text{H}\text{x}}^{{\prime }}$$
2.3.2 Second Order Derivative Gauss Gradient (SDGD) Edge Detector
The second-order derivative method is extremely sensitive to spatial changes in the image's edge pixels, such as brightness or zero crossings. The SDGD (Second Order Derivative Gauss Gradient) operator has a nonlinear property.
The Laplacian operator is defined as follows.
$${\nabla }^{2}=\frac{{\partial }^{2}a}{{\partial x}^{2}}+\frac{{\partial }^{2}a}{{\partial y}^{2}}=\left({h}_{2x}⨂a\right)\left({h}_{2y}⨂a\right)$$
Where \({h}_{2x}\) and \({h}_{2y}\) are the second derivative filters.
$$\left[{h}_{2x}\right]=\left[{h}_{2y}\right]=\left[\begin{array}{ccc}1& -2& 1\end{array}\right]$$
$$\left[{h}_{2}\right]=\left[\begin{array}{ccc}0& 1& 0\\ 1& -4& 1\\ 0& 1& 0\end{array}\right]$$
When combined with Gaussian filter,\(b={g}_{0}⨂\left({h}_{2}⨂a\right)={(g}_{0}⨂{h}_{2})*a\)
Where \({g}_{0}\)is the Gaussian low pass filter.
The partial derivatives used in the SDGD filter are as follows
$${A}_{xx}=\frac{{\partial }^{2}a}{{\partial x}^{2}}; {A}_{xy}=\frac{{\partial }^{2}a}{\partial x\partial y}; {A}_{x}=\frac{\partial a}{\partial x}; {A}_{yy}=\frac{{\partial }^{2}a}{{\partial y}^{2}}; {A}_{y}=\frac{\partial a}{\partial y}$$
$$SDGD=\frac{{A}_{xx}{A}_{x}^{2}+2{A}_{xx}{A}_{x}{A}_{y}+{{A}_{yy}A}_{y}^{2}}{{A}_{x}^{2}+{A}_{y}^{2}}$$
2.3.3 VLSI Implementation of Gauss Gradient Edge detectors
Signal and image processing applications were found to benefit from the Xilinx Kintel-7 FPGA board. The Kintex-7 FPGA DSP Development Kit with High-Speed Analog has the following features.
The Kintel -7 series was also found to be efficient for video processing applications. The figure 5 depict the interfacing of Kintel-7 with VGA.
The flow of edge detection proposed in this research paper is depicted in figure 6. The hardware implementation of the edge detection algorithms is shown in figure. 7.
Figure 8 depicts the design and implementation flow using FPGA for the implementation of image processing algorithms.