+ All Categories
Home > Documents > PDE Transforms and Edge Detection€¦ · In edge detection, our goal is to approximate the jump...

PDE Transforms and Edge Detection€¦ · In edge detection, our goal is to approximate the jump...

Date post: 06-Aug-2020
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
16
PDE Transforms and Edge Detection Rishu Saxena * , Siyang Yang Abstract In this paper, we propose the use of partial differential equation (PDE) based novel PDE transforms for determining jump discontinuity locations in piecewise smooth data containting potential isolated jump discontinu- ities. The PDE transform method involves evolving coupled PDEs under different time scales to extract edge information. Multiscale edge detec- tion is done by varying the parameters and edges of different scales (kinds) are recovered. The focus is on linear PDEs and their implementation us- ing fast fourier transforms (FFTs). We show that PDE tansforms with linear PDEs act as very high order exponential filters. The use of FFTs adapts the PDE transforms for edge detection in spectral data. Exper- iments are presented in one and two dimensions for detecting edges in signals and images. For giving some background to the use of PDEs in image processing, in general, and edge detection, in particular, we also present a brief discussion of the topic in the beginning sections. 1 Introduction Detection of edges in piecewise smooth functions and images is important in many applications such as feature detection, face recognition, computer vision, medical diagnosis, remote sensing, machine vision, and artificial intelligence [4, 14]. These applications rely directly or indirectly on edge detection for ef- ficient implementation of algorithms as well as accuracy of final results of the application. For example, most image/data reconstruction algorithms so far are designed for smooth data or depend on an a priori knowledge of jump discon- tinuity locations [8]. Presence of edges in the underlying data deteriorates the performance of these algorithms. Direct applications of edge detection can be found in the processing of seismic data where a jump discontinuity could indicate a potential tsunami, or, in weather prediction, a jump discontinuity in the data collected could correspond to certain weather conditions. In the field of medical imaging, edges often represent features of interest. For instance, in an magnetic resonance image (MRI) of the brain, an edge may represent the boundary of a tumor, or, in a retinal image, an edge may indicate the boundary of a glaucoma. Jump discontinuities in data thus often store important information. The field of edge detection has attracted much attention of the scientific community in the last two decades, and many edge detection algorithms have * Department of Mathematics and Statistics, Arizona State University, Tempe, Arizona 85287 USA. Email:[email protected] Department of Mathematics, Michigan State University, East Lansing, Michigan, 48824 USA. Email:[email protected] 1
Transcript
Page 1: PDE Transforms and Edge Detection€¦ · In edge detection, our goal is to approximate the jump function [f](x): Wei et al. proposed an improved anisotropic di usion PDE to smooth

PDE Transforms and Edge Detection

Rishu Saxena∗, Siyang Yang†

Abstract

In this paper, we propose the use of partial differential equation (PDE)based novel PDE transforms for determining jump discontinuity locationsin piecewise smooth data containting potential isolated jump discontinu-ities. The PDE transform method involves evolving coupled PDEs underdifferent time scales to extract edge information. Multiscale edge detec-tion is done by varying the parameters and edges of different scales (kinds)are recovered. The focus is on linear PDEs and their implementation us-ing fast fourier transforms (FFTs). We show that PDE tansforms withlinear PDEs act as very high order exponential filters. The use of FFTsadapts the PDE transforms for edge detection in spectral data. Exper-iments are presented in one and two dimensions for detecting edges insignals and images. For giving some background to the use of PDEs inimage processing, in general, and edge detection, in particular, we alsopresent a brief discussion of the topic in the beginning sections.

1 Introduction

Detection of edges in piecewise smooth functions and images is important inmany applications such as feature detection, face recognition, computer vision,medical diagnosis, remote sensing, machine vision, and artificial intelligence[4, 14]. These applications rely directly or indirectly on edge detection for ef-ficient implementation of algorithms as well as accuracy of final results of theapplication. For example, most image/data reconstruction algorithms so far aredesigned for smooth data or depend on an a priori knowledge of jump discon-tinuity locations [8]. Presence of edges in the underlying data deteriorates theperformance of these algorithms. Direct applications of edge detection can befound in the processing of seismic data where a jump discontinuity could indicatea potential tsunami, or, in weather prediction, a jump discontinuity in the datacollected could correspond to certain weather conditions. In the field of medicalimaging, edges often represent features of interest. For instance, in an magneticresonance image (MRI) of the brain, an edge may represent the boundary of atumor, or, in a retinal image, an edge may indicate the boundary of a glaucoma.Jump discontinuities in data thus often store important information.

The field of edge detection has attracted much attention of the scientificcommunity in the last two decades, and many edge detection algorithms have

∗Department of Mathematics and Statistics, Arizona State University, Tempe, Arizona85287 USA. Email:[email protected]†Department of Mathematics, Michigan State University, East Lansing, Michigan, 48824

USA. Email:[email protected]

1

Page 2: PDE Transforms and Edge Detection€¦ · In edge detection, our goal is to approximate the jump function [f](x): Wei et al. proposed an improved anisotropic di usion PDE to smooth

PDE Transforms and Edge Detection 2

been proposed such as the Canny, Sobel and Prewitt’s edge detectors [3, 15].A common feature of most edge detectors is that they are at most second or-der. A significant limitation of low order edge detection algorithms is theirinability to distinguish jump discontinuities from steep slopes. Such distinctionrequires higher order edge detection algorithms. Higher order edge detectionalgorithms would also help in attaining accuracy in edge detection with rela-tively less amount of sampled data. Additionally, high order schemes for edgedetection would be helpful in handling oscillations in the underlying data. Anattempt to make edge detection a high order venture was made in [1] where theauthors proposed a polynomial annihilation method for edge detection. Themethod polynomial annihilation method has several advantages. It is localmethod, applicable to unstructured grids in both one and two dimensions, andis context independent as well as independent of user defined thresholds. How-ever, while the method is of higher order than the prevailing edge detectors, theinvolved operators often become ill-conditioned as the desired order increases,particularly on irregular grids.

In the image processing field, Fourier or spectral analysis is a classical tech-nique for mode decomposition and remains to be a powerful tool in signal,image and data processing. To better detect sharp edges such as the localizedvisual features in the images, various methods like wavelet algorithms have beendesigned and widely applied. Recently, a new PDE transform method was con-structed and proposed for image processing via solving arbitrarily high ordernon-linear PDEs [17, 18, 19, 20, 21, 25]. The method has been shown to workvery well in various applications such as texture extraction, image denoising andbiomolecular surface reconstruction. In this paper, we propose to use the PDEtransforms for designing an arbitrarily high order edge detection technique. Weimplement the linear PDE transform here. Fast Fourier transform (FFT) canbe employed to provide fast and efficient numerical solution. Additionally, thefourier formulation for the PDE transforms with linear PDEs offers a techniquefor edge detection in spectral data. Specifically, the method is able to detectedges in situations where the data is given in terms of fourier coefficients ratherthan physical domain. Such situations arise, for example, in MRI and SARdata. Jump discontinuities in the input data are extracted sequentially in dif-ferent mode decomposition which are realized via design and applications of thePDE-transform related filter banks. We focus on uniformly sampled grids.

This paper is organized as follows: Section 2.1 reviews the use of PDEs forimage processing. Section 3 discusses the formulation of the PDE transformsfollowed by their use for edge detection. One and two dimensional numericalexamples are presented in Sections 3.1 and 3.2. Section 4 presents conclusionsand future work.

2 Background and Formulation

We start by providing a brief overview of the use of PDEs for edge detection[10, 12, 22, 23] and the PDE transforms methodology [17, 18, 19]. We thenpresent the formulation of the PDE transform for edge detection.

Page 3: PDE Transforms and Edge Detection€¦ · In edge detection, our goal is to approximate the jump function [f](x): Wei et al. proposed an improved anisotropic di usion PDE to smooth

PDE Transforms and Edge Detection 3

2.1 PDEs for Image Processing and Edge Detection

Let I(x),x ∈ Rn be a piecewise continuous function sampled on a set S of Ndiscrete points, S = x1,x2, · · · ,xN,x ∈ Rn. We use the symbol ∇ to denotethe gradient operator, i.e., ∇ = ∂

∂x . Now suppose that the data is subject to timedependent evolution and let u(x, t) : Ω ⊂ Rn → R, denote the processed dataat time t. For such a piecewise continuous function, the Perona-Malik equationswere introduced [12]:

∂u(x, t)

∂t= ∇ · [d(u(x), |∇u(x, t)|)∇u(x, t)]

u(x, 0) = I(x).

(1)

Here, d(u(x), |∇u(x, t)|) denotes the diffusion coefficient and can be chosen inmany ways. It may be chosen to be spatially constant, in which case equation (1)becomes equivalent to the isotropic heat equation with the image being uniformsmoothed. Since edges are also smoothed, substantial loss is caused to the edgeinformation. In order to preserve edges, one possible choice suggested in [12] wasto set d = 0 at in the interior of each region and d = 1 at the boundaries of eachregion. With such a setting, during the time evolution process, the diffusion(smoothing) occurs only in the interiors of the regions while the boundariesremain preserved. However, in most applications in real life, we would not knowthe boundaries in advance. So such a user defined choice of d becomes infeasible.This creates the need for choosing d to be some function of the image itself. Thesimplest choice suggested by the inventors of the Perona-Malik equations was

dq(x, y, t) = g(‖∇I(x, y, t)‖). (2)

A high order generalization of the Perona-Malik equations was introduced byWei in [22],

∂u(x, t)

∂t= ∇ · [dq(u(x), |∇u(x, t)|)∇u(x, t)] + e(u(x), |∇u(x, t)|),

u(x, 0) = I(x),

(3)

where dq denote the hyper diffusion coefficients. The function e(u(x, t), |u(x, t)|)is a bounded feature enhancing operator and is chosen so that it is edge sen-sitive and the contrast of image edges is enhanced. By choosing dq to be edgesensitive, the authors were able to get improved results compared to those fromthe original Perona-Malik equations. For example, choosing

dq = dq0exp(−|∇u|2

2σ2q

). (4)

helps prevent blurring of edges.In general, anisotropic diffusion was more effective in smoothing the image

while preserving the edges as compared to the fixed neighborhood edge detectors(canny, sobel and the like). However, one of the drawbacks of the method wasthat the decision on edges was still based on some or the other thresholdingtechnique [9], thus leading to substantial texture loss.

Page 4: PDE Transforms and Edge Detection€¦ · In edge detection, our goal is to approximate the jump function [f](x): Wei et al. proposed an improved anisotropic di usion PDE to smooth

PDE Transforms and Edge Detection 4

PDE based band pass and high pass filters for edge detection

An ‘edge’ (or a ‘jump discontinuity’) in a one dimensional signal may be for-malised as follows:

Definition 2.1 Let f : [a, b] −→ R be a piecewise continuous function knownonly on the set of discrete grid points S (where S is as defined in section 2.1.)Assume that f has well defined one sided limits, f(x±), at any point in thedomain. Let J = ξ : a < ξ < b denote the set of points of jump discontinuitiesof f. At any point x in the domain, we define the jump function [f ](x) as

[f ](x) = f(x+)− f(x−) =

0, if x 6= ξ,[f ] (ξ), if x = ξ.

(5)

In edge detection, our goal is to approximate the jump function [f ](x).Wei et al. proposed an improved anisotropic diffusion PDE to smooth noise

while preserving edges [23] via the synchronization of two coupled dynamicalsystems,

ut = F1(u,∇u,∇2u, · · · ) + ε1(v − u),vt = F1(v,∇v,∇2v, · · · ) + ε2(u− v).

(6)

Here u(x, t) and v(x, t) are scalar fields on Ω ⊂ Rn, and ε1 and ε2 are couplingstrengths. In equation (6), F1 and F2 denote general non-linear operators∗ .To extract edges using the system in equation (6), the same line of thoughtis utilized for the two equations set up with same initial value of the originalinput data or image, i.e., u(x, 0) = v(x, 0) = I(x) such that they are initially insynchronization, as well as identical mobility functions F1, F2 and parametersε1, ε2, d1, d2. The two coupled PDEs are then evolved at drastically differenttime scales. Each PDE evolution acts as a low pass filter in itself, and thedifference in the synchronization of the two coupled PDEs

r(x, t) = u(x, t)− v(x, t) (7)

at some finite time t corresponds to image edges as if it was obtained by high passor band pass filters. Such an anisotropic diffusion based edge detection avoidsthe above-mentioned use of thresholding. However, like most other algorithmsbased on anisotropic diffusion, this technique also involves solving a system oftime dependent PDEs. Solving very high order PDEs is numerically difficultas well as ill-conditioned when the initial data and/or the solution have jumpdiscontinuities. The computations become increasingly more complex with thenon-linearity of the equations involved. In general, 2nd order PDEs is mostcommonly employed, though 4th order PDEs are becoming popular approach.

Some non-PDE based filters for edge detection

Alternatively, one can construct the band pass filter bank for determining thelocation of edges, given the truncated N Fourier coefficients of the underlyingdata. In [2] the authors relied on the zero crossings of the band pass filtereddata, and considered the difference between an original function u(x) and a low

∗Notice that choosing F1 = ∇ · d1(|∇u(r)|)∇ and F2 = ∇ · d2(|∇v(r)|)∇ readily reducesequation (6) to equation (3).

Page 5: PDE Transforms and Edge Detection€¦ · In edge detection, our goal is to approximate the jump function [f](x): Wei et al. proposed an improved anisotropic di usion PDE to smooth

PDE Transforms and Edge Detection 5

pass filtered function uσN (x), with a low pass filter σ(k) of order ρ. Then it canbe shown that [16],

|aσN (x)− a(x)| ≤ CN1−ρ‖σ(ρ)‖L2(0,1)x−ρ, (8)

where C is independent of N, ρ, σ,x. Next, let σ1(x) and σ2(x) be two low passfilters of same order ρ. Taking the difference between aσ1

N (x) and σσ2

N (x) leadsto [2]

|aσ1

N (x)− aσ2

N (x)| ≤ 2CN1−ρ‖σ(ρ)1 − σ(ρ)

2 ‖L2(0,1)x−ρ. (9)

Along the same lines, if we define µ(k) = σ1(k) − σ2(k), then µ(k) acts as aband pass filter and the filtered function (again, as pointed out in [2]) obeys thefollowing relation:

|uµN (x)| < CN1−ρ‖µ(ρ)‖L2(0,1)x−ρ. (10)

Their difference would therefore act as a band pass filter. The zero crossing ofsuch a band pass filter were used to determine the jump discontinuity locationsin the underlying data. Methods that used zero crossings on top of filteringwere also proposed in [11, 13, 24]. Some other filters were designed in [5, 6, 7] todetermine edges in spectral data using the conjugate partial sums of the Fouriercoefficients.

3 PDE Transforms

The band pass and high pass filters described in equation (3) can be implementedin second order form for higher accuracy. However, second order PDEs them-selves lack frequency localization when viewed as filter banks. Consequently, ina signal consisting of multiple modes, which can be generally defined as varioustextures, edges, trends, etc., it is impossible to perform the mode decompositionto assist the subsequent signal/image processing. Furthermore, use of higher or-der PDEs are also useful for suppressing high frequency oscillations (e.g. noise)much faster. It is therefore desirable to extend the PDEs used for image analysisto higher order and/or nonlinear forms. In spite of such desirability, directlyextending equation (3) to high order with nonlinear coefficients is computation-ally very expensive. These limitations may be overcome by using the novel PDEtransforms recently introduced in [18]. A brief overview of the PDE transformsis first given here.

We start from equations (6) and (7). The matrix form of equation (6)generalized to higher orders j = 0, 1, · · · ,m (or, n) can be written in the form

∂t

(u

v

)=

m−1∑j=0

∇ · duj(|∇u|)∇∇2j − εu(|∇u|) , εv(|∇v|)

εu(|∇u|) ,n−1∑j=0

∇ · dvj(|∇v|)∇∇2j − εv(|∇v|)

(u

v

), (11)

Then the edge function in equation (7) can be re-written as

r(x, t) = HI(x), (12)

Page 6: PDE Transforms and Edge Detection€¦ · In edge detection, our goal is to approximate the jump function [f](x): Wei et al. proposed an improved anisotropic di usion PDE to smooth

PDE Transforms and Edge Detection 6

where H denotes a high pass filter made up of a coupled non-linear PDE oper-ator. Let us initialize the system using the given image so that X(1)(x) = I(x).We define X(2) as the ‘residual function’ after implementing H only once (referequation (12)) and extracting out the information caught in this first pass overthe input, then

X(2) = X(1) −HI(x). (13)

In general, if we let k denote the iteration level, X(1), · · · , X(k−1) be the first kresiduals, H1, · · · ,Hk be the filters at levels 1, · · · , k, respectively, and

X(1)(x) = H1X(1)(x), X(2)(x) = H2X

(2), · · · , ˜X(k) = HkX(1), (14)

be the edge functions at respective iteration levels, then the residual at step kcan be expressed as

X(k)(x) = X(1) −k−1∑j=1

X(j), ∀k = 2, 3, ... (15)

The original data can be perfectly reconstructed by putting together the modesas

I(x) =

k−1∑j=1

X (j) +X(k). (16)

The above iterative procedure of sequentially extracting the constituent modesof a given data is termed as the PDE transforms. In short, the idea is to subjectthe image iteratively to a series of PDE based filter banks, each of which is usedto extract the next highest frequency mode present in the input. The first (orfirst few) mode(s) extracted using equation (15) contains information on edgesor different textures [20], while the lower frequency modes and/or residual showtrend of the data/image. By iteratively implementing equation (15) the differentmodes can be extracted one at a time. The filter H is different at each iterationand is obtained by re-choosing the parameter values. If the signal has any modesthat correspond to this filter, they get picked up in this iteration. Otherwise,we move on to a new filter. This process is non-linear even if we use a linearPDE because the initial value changes at every time a mode is extracted.

We now focus on PDE transforms for linear PDEs and derive their imple-mentation for fourier data. To this end, we consider the following general formof a linear PDE,

∂u

∂t=

J∑j=0

dj(x, t)∂ju

∂xj+ ε(u0 − u), x ∈ [x0, xN ], x0, xN ∈ Rn, (17)

where dj , j = 0, · · · , J, are the coefficients in the PDE. In our implementation,we assume that dj(x, t) = dj(t)’s are either constants or only time dependent(independent of x). Let the Fourier representation of u at time t be denoted as

uN (x, t) =

N/2−1∑k=−N/2

u(k, t)e2πikx−x0

lx , (18)

Page 7: PDE Transforms and Edge Detection€¦ · In edge detection, our goal is to approximate the jump function [f](x): Wei et al. proposed an improved anisotropic di usion PDE to smooth

PDE Transforms and Edge Detection 7

where lx = x− x0 denotes the length of the interval in x−direction and

u(k, t) =1

N

N−1∑n=0

u(n)e−2πin kN , k = −N

2, · · · , N

2, (19)

are the Fourier coefficients of u(x, t). Then, substitution of equation (18) intoequation (17) gives the following equation in Fourier space,

∂tu(k, t) =

J∑j=0

dj

(2πik

lx

)ju(k, t) + ε (u(k, 0)− u(k, t)) (20)

with the initial conditionu(k, 0) = F(I(x)). (21)

Rearranging the terms in linear equation (20) and solving it with the initialcondition in equation (21) leads to the following closed form solution in spectraldomain:

u(k, T ) = u(k, t0)H(k, T ), (22)

where,

H(k, T ) = e(∑J

j=0 djωj−ε)(T−t0) − ε∑J

j=0 djωj − ε

(1− e(

∑Jj=0 djω

j−ε)(T−t0)),

(23)

ω =2πik(x− x0)

lx

Finally, by taking the inverse transform of the evolved spectral coefficients,we obtain the solution to the PDE, equation(17), at the same time avoiding thestability issues often involved in the traditional techniques for solving PDEs.Now, the following lemma validates the use of linear PDE based filters.

Lemma 1 PDE transforms with linear PDEs act as very high order exponentialfilters.

Proof: A filtered, truncated Fourier approximation can be expressed as

uσN (x) =

N/2∑k=−N/2

ukσ(k)eikx, (24)

where σ(k) denotes an admissible filter in frequency domain. The result isobvious when we substitute equation (22) in equation (18) and compare theresulting equation with equation (24). Q.E.D.

This formulation is of particular benefit when the data is collected in theform of fourier coefficients (eg. MRI images). FFT based formulation of thePDE transforms enables us to avoid an actual reconstruction yielding also apotential improvement in accuracy since no interpolatory errors are introduced.

Figure 1 demonstrates the different filters produced for different choices ofparameters for linear PDEs. The x−axis shows the input frequency k whilethe y−axis calibrates the response of the filter H, equation (23), to the cor-responding frequency. Figure 1(a) shows the influence of the order J of the

Page 8: PDE Transforms and Edge Detection€¦ · In edge detection, our goal is to approximate the jump function [f](x): Wei et al. proposed an improved anisotropic di usion PDE to smooth

PDE Transforms and Edge Detection 8

PDE used. Greater frequency localization is attained as order of PDE becomeshigher. (In this figure we have adjusted the evolution times T to pick up thesame frequencies.) Thus, by adjusting the order of the PDE used, we can controlthe frequency localization. Figure 1(b) displays the filters produced for differentevolution times T with the rest of the parameters fixed as quoted in the caption.For a given PDE, as we increase the evolution time, lower frequencies get picked.Adjusting the propagation time T lets us select the desired frequency precisionor multi-resolution analysis. This is demonstrated in figure 1(b). Figure 1(c)shows the dependence on the coefficient of the highest order term dJ . Figure 1(d)demostrates the effect of the synchronization factor ε on the filter when dJ , T, Jare fixed. In general, best frequency localization is produced when we chooseε = 0. We adhere to this choice of ε in all the examples we demonstrate later inthis paper, although the use of non-zero ε is not discouraged.

We summarize the nature of PDE transforms as follows: PDE transformswith linear PDEs act as exponential filters as shown in lemma 1. However,unlike the traditionally proposed exponential filters (see, for example, [5]), PDEtransforms provide a well defined procedure for mode desomposition. In general,PDE transform utilizes higher order nonlinear PDEs. This enables one to incor-porate geometric information, such as curvature, topology and the like. Theycarry the advantage of having flexible basis functions. This is in contrast withthe rigid basis functions used, for example, in the popular Fourier and wavelettransforms. The shape of the basis functions can be changed by altering thecoefficients of the PDE used. Finally, since the non-linear PDE transforms al-low edge sensitive anisotropic diffusion, they are naturally well suited for edgedetection on noisy data. Detailed discussions of non-linear PDE transforms,however, are beyond the scope of this paper.

3.1 Edge detection in one dimension

Comment: Will be better if we put here an example that demon-strates the benefit of high order PDE and multiscale analysis in onedimension instead of this current one.

Example 3.1 We consider the following discontinuous function on the domain[0, 2π]:

f(x) =

e0.75x − 1, if ex < π

2− cos(2x), if π

2 ≤ x < 3.0π + sin(4x)− x

π, if 3.0 ≤ x < 4.0

1− cos(2x), if x ≥ 4

(25)

The function in equation (25) is piecewise continuous over the domain withjump discontinuities at x = π

2 , 3, 4. The jump function for this function is thengiven by

[f ](x) =

−1, x = π

2 ,0.7, x = 3.0,1.2, x = 4,0, elsewhere.

(26)

Page 9: PDE Transforms and Edge Detection€¦ · In edge detection, our goal is to approximate the jump function [f](x): Wei et al. proposed an improved anisotropic di usion PDE to smooth

PDE Transforms and Edge Detection 9

(a) varying J (b) varying T

(c) varying d (d) varying ε

Figure 1: Frequency-response curves for PDE transform acting as high passfilters. Variation with (a) the highest order of PDE J, with fixed d = 6.5 ×10−8, ε = 0; (b) time of evolution T with fixed J = 40, d = 6.5× 10−8, ε = 0; (c)coefficient d, with fixed T = 5.0, J = 4, ε = 0; and, (d) the coupling strength ε,with fixed T = 1.0, J = 4, d = 6.5× 10−4.

(a) original data (b) high frequency mode (c) edges

Figure 2: Jump function approximation on a one dimensional example. Thethin dashed line indicates the true jump function. (a) Input data; (b) Highfrequency mode extracted using the PDE transforms, (c) jump discontinuities.J = 2, d2 = 6.5× 10−4, ε = 0, T = 5.0, N = 128.

Figure 2(a) shows the data on n = 128 grid points. We consider the PDE

ut(x, t) = dJ∂Ju(x, t)

∂xJ,

u(x, 0) = f(x),(27)

where f(x) is as defined in equation (25) and J is chosen to be even. Figure 2(b)shows the high frequency mode extracted from the original input using equa-

Page 10: PDE Transforms and Edge Detection€¦ · In edge detection, our goal is to approximate the jump function [f](x): Wei et al. proposed an improved anisotropic di usion PDE to smooth

PDE Transforms and Edge Detection 10

tion (6) implemented using FFT. We notice that the high pass filtered functionhas local maxima/minima immediately before and following the actual locationof the jump discontinuity. This, in general, is true whenever we extract high fre-quency mode from a discontinuous signal: the filtered signal has local extremevalues in the vicinity of the jump discontinuity location and crosses zero in thecell containing the discontinuity. We utilize this fact for determining the exactlocation of the jump discontinuity (accurate up to one grid cell). Specifically,we look for zero crossings (sign change) in the high frequency mode values. Iftwo adjacent grid points have values of different signs (one plus and one minus),we label the enclose grid cell as one containing a jump discontinuity. Otherwise,we label the cell as free of jump discontinuity. Specifically,

do i = 0,N-1if(uN (i)× uN (i+ 1) < 0)thenedge(i) = uN (i+ 1)− uN (i)

endifend do

(28)

Similar approach of determining jump discontinuity locations using zero cross-ings have been used in the past in [2, 15] and some others. The primary noveltyin our approach is the use of the PDE transform based filters. These filtersenable us to separate modes with very close frequencies. The jump discontinu-ity information obtained after processing the data in figure 2(b) according toequation (28) is shown in figure 2(c).

Since the implementation for linear PDEs is based on fast fourier transforms,the method works very well on periodic signals. The implementation for non-priodic signals can be realized by imposing appropriate boundary conditions.

3.2 Edge detection in two dimensions

We consider general high order linear PDE in two dimensions,

ut =

Jx∑jx=1

dxj∂jx

∂xjx

Jy∑jy=1

dyj∂jy

∂yjy

u

u(x, y, 0) = I(x, y)

(29)

where I(x, y) is the given image. Let the truncated fourier expansion of thesolution be given by

uN (x, y, t) =

Ny/2−1∑k2=−Ny/2

Nx/2−1∑k1=−Nx/2

u(k1, k2, t)e2πi(

k2yLy

+k1xLx

)(30)

where the fourier coefficients are given by

u(k1, k2) =

Ny−1∑j=0

Nx−1∑i=0

u(xi, yj)e−2πi

(k2Ny

+k1Nx

). (31)

Here, the original data I(x, y) is of size Nx × Ny and k1 and k2 denote thefrequency values in x− and y− directions, respectively. The Fourier coefficients

Page 11: PDE Transforms and Edge Detection€¦ · In edge detection, our goal is to approximate the jump function [f](x): Wei et al. proposed an improved anisotropic di usion PDE to smooth

PDE Transforms and Edge Detection 11

are denoted by u(k1, k2). The expression for integrating Fourier coefficients of alinear PDE in one time step then takes the form

u(k1, k2, T ) = u(k1, k2, t0)e∑Jx

jx=1

∑Jyjy=1(dxk1

ωxk1dyk2

ωyk2)(T−t0), (32)

or,u(k1, k2, T ) = I(k1, k2)H(k1, k2, T ), (33)

where, H is used to denote the exponential term in equation (32), and,

ωxk =2πikx

lx. (34)

We remark that this formulation implements edge detection in both x− andy−directions simultaneously unlike the dimension by dimension approach of-ten adopted in several traditional methods, for example in wavelet transforms.comment: what is the advantage of direct implementation comparedto dimension by dimension implementation when the grid is regular?I know advantages on randomly sampled grids but we don’t use suchgrids in this paper.

Example 3.2 Shepp Logan phantom image. The Shepp Logan phantom con-sists of several ellipses of different sizes and orientations and is displayed infigure 3(a). We subject the image to PDEs according to the parameter valuesmentioned in the caption for figure 3. We remark that the grid points usedfor displaying the jump discontinuities are not the same as those used in theoriginal image. The original image was given at the grid points (xi, yj), i =0, · · · , nx − 1, j = 0, · · · , ny − 1 (leading to a 128 × 128 grid). The edges mapis displayed at the grid points (xi+ 1

2, yj+ 1

2), i = 0, · · · , nx− 2, j = 0, · · · , ny− 2

(127 × 127 grid). In other words, the edges are indicated with respect to thecontaining grid cell and naturally correspond to the centers of the correspond-ing grid cells. We call the centers of the grid cells the reconstruction pointsfor the edge map. Then, given a reconstruction point (xi+ 1

2, yj+ 1

2), we look

for zero crossings z1 ∈ ((xi, yi), (xi, yj+1)) and z2 ∈ ((xi, yj), (xi + 1, yj)) (twodimensional analogue of the method described in example 3.1). An edge is thendefined as z =

√z21 + z22 .

For shorter time t = 0.1, the inner ellipses are determined very accurately(figure 3(d)). However, there are false alarms in the vicinity of the outer ellipses.For a larger evolution time t = 5.0, the outer ellipses get resolved very well(figure 3(f)) but there are some oscillations/fall alarms in the vicinity of theellipses close to the center.

Finally, we demonstrate the implementation of the PDE transforms basededge detection technique on natural images.

Example 3.3 Low-dose CT image of the abdomen. Figure 4(a) displays thenoised abdomen image using low-dose CT. Figures 4(b), 4(c) and 4(d) displaythe residues generated sequentially using high pass filters with a second orderlinear PDE. Equivalently, these residues correspond to the denoised images,where the degree of denoising is controlled by the magnitudes of the diffusioncoefficients (or diffusion time equivalently). Without loss of generality, we chose

Page 12: PDE Transforms and Edge Detection€¦ · In edge detection, our goal is to approximate the jump function [f](x): Wei et al. proposed an improved anisotropic di usion PDE to smooth

PDE Transforms and Edge Detection 12

(a) original data (b) Re(f(k1, k2)) (c) high frequency mode

(d) edges (e) high frequency mode (f) edges

(g) f(32, yj), j = 0, · · · , Ny . (h) edge information

Figure 3: Shepp Logan phantom: 128 × 128 grid, J = 2, dJ = −(−1)J/26.5 ×10−4, (a) original data; (b) Fourier transform; (c),(d) T = 0.1; (e),(f) T = 5.0;(g) a cross-section of the shepp logan phantom image, f(32, yj), j = 0, · · · , Ny;(h) cross section of the high frequency mode extracted (stars) and the edgefunction approximation (crosses).

the values of diffusion coefficients corresponding the cut-off frequencies of 0.4,0.3 and 0.2 respectively (compared with the Nyquist frequency of 0.5 for thedigital image processing).

Example 3.4 MRI brain image. We consider the edge detection for a bench-mark MRI image shown in Figure 5(f). We implement our technique to thisimage. Figures 5(g), 5(h) and 5(i) display the modes extracted iteratively usinghigh pass filters with a second order linear PDE for the first four modes. Fig-ures 5(j) shows the residual after extracting the four modes from the originalimage. Figures 5(k), 5(l) and 5(m) show the first three modes extracted whena 20th order PDE is used (J = 20). Instead of enforcing chosen t and dJ , wechose the frequencies we wanted to separate out. The frequency ω value wasset to ω = 0.45, 0.20, 0.04 and 0.02, for the four modes. Then the correspondingtime t and the coefficient dJ are then calculated by the code. We remark herethat in case of this image, dx = 1.0, leading to a Nyquist frequency of 0.5.This motivated us to choose the aforementioned frequencies. Edges are then

Page 13: PDE Transforms and Edge Detection€¦ · In edge detection, our goal is to approximate the jump function [f](x): Wei et al. proposed an improved anisotropic di usion PDE to smooth

PDE Transforms and Edge Detection 13

(a) original (b) residue 1 (c) residue 2 (d) residue 3

Figure 4: Figures 4(b) through 4(d) show the three denoised images for the CTimage of the abdomen in Figure 4(a) using the PDE transform with 2nd orderPDE and different diffusion coefficients corresponding to cut-off frequency of0.4, 0.3, and 0.2 compared to the Nyquist frequency of 0.5 for the digital imageprocessing. High level of noise is present in the original image due to the use oflow dose in CT imaging.

extracted from the each mode using the zero-crossings technique described inexample 3.2.

The tendency can be represented by a polynom of order

relatively low ð0; 1; 2Þ: The results in Fig. 10 show the

possibility of low level processing (filtering or denoising)

with this technique. After having applied the decompo-

sition, this filtering would be easily carried out by the

subtraction with the original image of one or several modes.

The residue represents the filtered image.

4.3. Extraction of inhomogeneous illumination

Since sifting process extracts firstly the highest fre-

quency, the firsts modes correspond generally to the noise.

Conversely, the image tendency is contained in the latest

mode or more generally in residual image resulting to the

sifting process (Fig. 11).

After the decomposition, we subtract residue image from

original image (Fig. 12c) to perform inhomogeneous

illumination correction.

4.4. Perspectives

In the bidimensional case, the regional extrema are not

always well defined. The saddle points (or more generally,

the pattern of ridges and valleys) should be taken into

account. Thus, we propose the straightforward extension of

the 1D EMD to the 2D case by using morphological

operators. To detect lines peaks (respectively, the line

Fig. 9. Brain MRI.

Fig. 11. Synthetic texture.

Fig. 10. Retinal image.

J.C. Nunes et al. / Image and Vision Computing 21 (2003) 1019–10261024

(a) original

The tendency can be represented by a polynom of order

relatively low ð0; 1; 2Þ: The results in Fig. 10 show the

possibility of low level processing (filtering or denoising)

with this technique. After having applied the decompo-

sition, this filtering would be easily carried out by the

subtraction with the original image of one or several modes.

The residue represents the filtered image.

4.3. Extraction of inhomogeneous illumination

Since sifting process extracts firstly the highest fre-

quency, the firsts modes correspond generally to the noise.

Conversely, the image tendency is contained in the latest

mode or more generally in residual image resulting to the

sifting process (Fig. 11).

After the decomposition, we subtract residue image from

original image (Fig. 12c) to perform inhomogeneous

illumination correction.

4.4. Perspectives

In the bidimensional case, the regional extrema are not

always well defined. The saddle points (or more generally,

the pattern of ridges and valleys) should be taken into

account. Thus, we propose the straightforward extension of

the 1D EMD to the 2D case by using morphological

operators. To detect lines peaks (respectively, the line

Fig. 9. Brain MRI.

Fig. 11. Synthetic texture.

Fig. 10. Retinal image.

J.C. Nunes et al. / Image and Vision Computing 21 (2003) 1019–10261024

(b) mode 1

The tendency can be represented by a polynom of order

relatively low ð0; 1; 2Þ: The results in Fig. 10 show the

possibility of low level processing (filtering or denoising)

with this technique. After having applied the decompo-

sition, this filtering would be easily carried out by the

subtraction with the original image of one or several modes.

The residue represents the filtered image.

4.3. Extraction of inhomogeneous illumination

Since sifting process extracts firstly the highest fre-

quency, the firsts modes correspond generally to the noise.

Conversely, the image tendency is contained in the latest

mode or more generally in residual image resulting to the

sifting process (Fig. 11).

After the decomposition, we subtract residue image from

original image (Fig. 12c) to perform inhomogeneous

illumination correction.

4.4. Perspectives

In the bidimensional case, the regional extrema are not

always well defined. The saddle points (or more generally,

the pattern of ridges and valleys) should be taken into

account. Thus, we propose the straightforward extension of

the 1D EMD to the 2D case by using morphological

operators. To detect lines peaks (respectively, the line

Fig. 9. Brain MRI.

Fig. 11. Synthetic texture.

Fig. 10. Retinal image.

J.C. Nunes et al. / Image and Vision Computing 21 (2003) 1019–10261024

(c) mode 2

The tendency can be represented by a polynom of order

relatively low ð0; 1; 2Þ: The results in Fig. 10 show the

possibility of low level processing (filtering or denoising)

with this technique. After having applied the decompo-

sition, this filtering would be easily carried out by the

subtraction with the original image of one or several modes.

The residue represents the filtered image.

4.3. Extraction of inhomogeneous illumination

Since sifting process extracts firstly the highest fre-

quency, the firsts modes correspond generally to the noise.

Conversely, the image tendency is contained in the latest

mode or more generally in residual image resulting to the

sifting process (Fig. 11).

After the decomposition, we subtract residue image from

original image (Fig. 12c) to perform inhomogeneous

illumination correction.

4.4. Perspectives

In the bidimensional case, the regional extrema are not

always well defined. The saddle points (or more generally,

the pattern of ridges and valleys) should be taken into

account. Thus, we propose the straightforward extension of

the 1D EMD to the 2D case by using morphological

operators. To detect lines peaks (respectively, the line

Fig. 9. Brain MRI.

Fig. 11. Synthetic texture.

Fig. 10. Retinal image.

J.C. Nunes et al. / Image and Vision Computing 21 (2003) 1019–10261024

(d) mode 3

The tendency can be represented by a polynom of order

relatively low ð0; 1; 2Þ: The results in Fig. 10 show the

possibility of low level processing (filtering or denoising)

with this technique. After having applied the decompo-

sition, this filtering would be easily carried out by the

subtraction with the original image of one or several modes.

The residue represents the filtered image.

4.3. Extraction of inhomogeneous illumination

Since sifting process extracts firstly the highest fre-

quency, the firsts modes correspond generally to the noise.

Conversely, the image tendency is contained in the latest

mode or more generally in residual image resulting to the

sifting process (Fig. 11).

After the decomposition, we subtract residue image from

original image (Fig. 12c) to perform inhomogeneous

illumination correction.

4.4. Perspectives

In the bidimensional case, the regional extrema are not

always well defined. The saddle points (or more generally,

the pattern of ridges and valleys) should be taken into

account. Thus, we propose the straightforward extension of

the 1D EMD to the 2D case by using morphological

operators. To detect lines peaks (respectively, the line

Fig. 9. Brain MRI.

Fig. 11. Synthetic texture.

Fig. 10. Retinal image.

J.C. Nunes et al. / Image and Vision Computing 21 (2003) 1019–10261024

(e) residue

(f) original (g) mode 1 (h) mode 2 (i) mode 3 (j) residue

(k) mode 1 (l) mode 2 (m) mode 3 (n) residue

Figure 5: Figures 5(d) through 5(e) show the multiscale modes and residue ob-tained for the original image 5(a) using empirical mode decomposition methods.The three modes and residue generated for the original MRI brain image (Fig-ure 5(f)) using the PDE transform with 2nd order PDE are shown in Figures5(g) through 5(j)). Figures 5(k) through 5(n)) show the similar results exceptthat a higher order PDE (20th order) is used in the PDE transform.

Example 3.5 Mandrill image. Figure 6(a) displays the Mandrill image. Fig-

Page 14: PDE Transforms and Edge Detection€¦ · In edge detection, our goal is to approximate the jump function [f](x): Wei et al. proposed an improved anisotropic di usion PDE to smooth

PDE Transforms and Edge Detection 14

ures 6(b), 6(c) and 6(d) display the modes extracted iteratively using high passfilters with a second order linear PDE. Once again, we enforced our chosenfrequencies and let t and dJ were calculated to correspond to the chosed fre-quencies. Edges are then extracted from each mode using the zero-crossingstechnique described in example 3.2.

(a) original (b) mode 1 (c) mode 2 (d) mode 3 (e) residue

Figure 6: Figures 6(b) through 6(e) show the mode decomposition for the man-dril image in Figure 6(a) using the PDE transform with 2nd order PDE.

4 Conclusion

In this paper, we have proposed a PDE transforms based filtering for edge de-tection. The main advantage of using such an approach is the ability of thePDE transforms to separate out frequencies that are very close together. Suchfeature can be employed for many advanced data and image analysis, such asselective extraction and separation of image textures involving spatial entangle-ment, gray scale mixing, and high frequency overlapping are challenging tasksin image analysis [20]. The paper focuses on the discussion and application ofthe linear PDEs due to the unique efficiency and simplicity for general-purposeimage and signal analysis. The high order linear PDE transform can be numeri-cally implemented via the fast Fourier transforms to speed up computations andavoid numerical instabilities. The high speed is beneficial in applications wherethe speed of image processing matters, e.g. in digital camera (less lag), videostransmissions (real time), and SAR images. The Fourier implementation alsoallows PDE transforms the benefit of being able to detect edges in fourier data.This is of significance, for example, for MRI data. The results of implementingthe proposed algorithm are demonstrated on several examples in one and twodimensions. The results depend on the choice of parameters but, currently, thesame set of parameters work for all the examples we experimented with, andcan be tuned and fixed through out the whole process in many applications suchas molecular surface reconstruction [25]. Future work in this direction wouldinclude error estimates, and adjustment to noisy and/or blurred fourier data,edge detection in derivatives of the given data, and analysis on the choice ofparameters.

5 Acknowledgements

We thank Professor G. W. Wei for his helpful comments throughout this paper.

Page 15: PDE Transforms and Edge Detection€¦ · In edge detection, our goal is to approximate the jump function [f](x): Wei et al. proposed an improved anisotropic di usion PDE to smooth

PDE Transforms and Edge Detection 15

References

[1] R. Archibald, A. Gelb, and J. Yoon, Polynomial Fitting for Edge De-tection in Irregularly Sampled Signals and Images, SIAM Journal for Num.Analysis, Vol. 43, No.1, pp. 259–279, 2005.

[2] R. B. Bauer, Band Pass Filters for Determining Shock Locations, Ph.D.thesis, Applied Mathematics, Brown University, 1995.

[3] J. Canny, A Computational Approach to Edge Detection, IEEE Trans. Pat-tern Analysis and Machine Intell., Vol. 8, pp. 679–698, 1986.

[4] M. Farge, Wavelet Transforms And Their Applications To Turbulence, An-nual Review of Fluid Mechanics, Vol. 24, pp. 395–457, 1992.

[5] A. Gelb and E. Tadmor, Detection of Edges in Spectral Data, Appliedand Computational Harmonic Analysis, Vol. 7, pp. 101–135, 1999.

[6] A. Gelb and E. Tadmor, Detection of Edges in Spectral Data II. Nonlin-ear Enhancement, SIAM Journal of Numerical Analysis, Vol. 38, No. 4, pp.1389–1408, 2000.

[7] A. Gelb and E. Tadmor, Adaptive Edge Detectors for Piecewise SmoothData Based on the Minmod Limiter, Journal of Scientific Computing, Vol.28, No. 2-3, pp. 279–306, 2006.

[8] D. Gottlieb, C. W. Shu, A. Solomonoff, and H. VanDeven, On theGibbs Phenomenon I: Recovering Exponential Accuracy from the FourierPartial Sum of a Non-periodic Analytic Function, 1988.

[9] M. Heath, S. Sarkar, T. Sanocki, and K. W. Bowyer, Comparisonof Edge Detectors: Initial Study and Methodology, Computer Vision andImage Understanding, Vol. 69, No. 1, pp. 38, Jan 1998.

[10] Z. J. Hou, and G. W. Wei, A New Approach to Edge Detection, PatternRecognition, Vol. 35, pp. 1559–1570, 2002.

[11] D. Marr, Vision, W. H. Freeman and Company, 1982.

[12] P. Perona and J. Malik, Scale-space and edge detection usinganisotropic diffusion, IEEE Transactions Pattern Analysis and Machine In-telligence, Vol. 12, pp. 629–639, 1990.

[13] A. Rosenfeld and M. Thurhurston, Edge and Curve Detection forVisual Scene Analysis, IEEE Transactions on Computers, Vol. 100, pp. 562–569, 1971.

[14] Spedding, G. R. and Browand, F. K. and Huang, N. E. and Long,S. R., A 2-D Complex Wavelet Analysis Of An Unsteady Wind-GeneratedSurface-Wave Field, Dynamics of Atmospheres and Oceans, Vol. 20, pp.55–77, 1993.

[15] I. Sobel, An Isotropic 3× 3 Image Gradient Operator, Machine Vision forThree-Dimensional Scenes (H. Freeman editor), Academic Press, Boston,1990.

Page 16: PDE Transforms and Edge Detection€¦ · In edge detection, our goal is to approximate the jump function [f](x): Wei et al. proposed an improved anisotropic di usion PDE to smooth

PDE Transforms and Edge Detection 16

[16] H. VanDeven, Family of Spectral Filters for Discontinuous Problems,Journal of Scientific Computing, Vol. 6, pp. 159–192, 1991.

[17] Y. Wang, G. W. Wei and S. Yang, Partial Differential Equation trans-form – Variational Formulation and Fourier Analysis, in preparation.

[18] Y. Wang, G. W. Wei and S. Yang, Iterative Filtering DecompositionBased in Local Spectral Evolution Kernel, Journal of Scientific Computing,to appear, 2011 (DOI: 10.1007/s10915-011-9496-0).

[19] Y. Wang, G. W. Wei and S. Yang, Mode decomposition evolu-tion equations, Journal of Scientific Computing, to appear, 2011 (DOI:10.1007/s10915-011-9509-z).

[20] Y. Wang, G. W. Wei and S. Yang, Selective extraction of entangledtextures via adaptive PDE transform, International Journal for NumericalMethods in Biomedical Engineering, accepted and to appear, 2011

[21] Y. Wang, G. W. Wei and S. Yang, Partial Differential Equation trans-formation for non-stationary data analysis, to be submitted

[22] G. W. Wei, Generalized Perona-Malik Equation for Image Restoration,IEEE Signal Processing Letters, Vol. 6, pp. 165–167, 1999.

[23] G. W. Wei and Y. Q. Jia, Synchronization-Based Image Edge Detection,Europhysics Letters, Vol. 59, No. 6, pp. 814–819, 2002.

[24] A. Witkin, Scale-space filtering: A new approach to multi-scale descrip-tion, Proceedings of IEEE International Conference on Acoustic Speech Sig-nal Processing, Vol. 9, pp. 150–153, 1984.

[25] Q. Zheng, S. Yang and G. W. Wei, Biomolecular surface constructionby PDE transform, International Journal for Numerical Methods in Biomed-ical Engineering, accepted and to appear, 2011 (DOI:10.1002/cnm.1469)


Recommended