A bayesian approach to edge detection in noisy images - IEEE Xplore

2 downloads 0 Views 840KB Size Report
Abstract—An adaptive method for edge detection in monochro- matic unblurred noisy images is proposed. It is based on a linear stochastic signal model derived ...
686

IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMS—I: FUNDAMENTAL THEORY AND APPLICATIONS, VOL. 46, NO. 6, JUNE 1999

A Bayesian Approach to Edge Detection in Noisy Images Alberto De Santis and Carmela Sinisgalli

Abstract—An adaptive method for edge detection in monochromatic unblurred noisy images is proposed. It is based on a linear stochastic signal model derived from a physical image description. The presence of an edge is modeled as a sharp local variation of the gray-level mean value. In any pixel, the statistical model parameters are estimated by means of a Bayesian procedure. Then an hypothesis test, based on the likelihood ratio statistics, is adopted to mark a pixel as an edge point. This technique exploits the estimated local signal characteristics and does not require any overall thresholding procedure. Index Terms—Bayesian procedures, identification, image edge analysis, image processing, nonlinear estimation, segmentation.

I. INTRODUCTION

T

HE importance of detecting abrupt changes in the characteristics describing signals is nowadays well established. These discontinuities represent transient processes carrying most of the information relevant to the observed physical phenomena. Nonstationary digital signals, either one-dimensional (1-D) or two-dimensional (2-D), are considered, for instance, in speech processing [1], geophysics [2], biomedical applications [3], and computer tomography [4]. In computer vision, digitalized images representing real scenes are collected: the edges represent the boundaries of objects, changes in surface orientation, illumination, or reflectance discontinuities [5]–[8]. In the field of image processing, the edge detection problem has been investigated in papers discussing filtering [9]–[13], segmentation [14], pattern recognition [15], and data compression [16]. In this work, the problem of edge detection of monochromatic noisy 2-D signals is addressed. The edge points localization is accomplished by an optimal adaptive algorithm based on an hypothesis test. The statistical test exploits the local signal characteristics estimated by a Bayesian procedure. Research in this area is extensive, with methods depending on the definition of an edge, the image model, and whether a deterministic or stochastic model is adopted. The definition of an edge may be highly dependent on the kind of image which is used. In [17] and [18] the concept of perceptual contour is introduced, based on the difference between seeing and recognizing. Roughly speaking, our ability in grouping patterns makes us recognize visual contours even though we Manuscript received September 1, 1995; revised June 15, 1998. This paper was recommended by Associate Editor A. Kuh. A. De Santis is with the Dip. di Informatica e Sistemistica-Universit`a degli Studi “La Sapienza” di Roma, 00186 Roma, Italy. C. Sinisgalli is with the Dip. di Informatica e Sistemistica-Universi`t degli Studi “La Sapienza” di Roma, 00184 Roma, Italy. Publisher Item Identifier S 1057-7122(99)04747-9.

do not actually see them, since no discontinuity in the signal level is present. In the deterministic description of signals, the edge points are generally defined as locations of discontinuity of suitable order [5], [7], [19]–[22], thus describing step, roof and line edges [5], corner points [22], and end and crack points [23]. In the neighborhood of these points the amplitude of the signal varies very quickly, so that the presence of an edge is associated with the local extrema of the signal derivatives. Searching these extrema points by processing real data is an ill-conditioned problem due to the additive noise. Before derivatives of any order are computed according to some finite difference scheme [7], [20], [24]–[30] a noise filtering is necessary. A global thresholding procedure is usually adopted to reduce false detections [28]–[30]. In [31]and [32] a hierarchical stochastic model for the original image is introduced, based on the Gibbs distribution. It accounts for various degradation mechanisms, such as blurring, nonlinear deformations, and multiplicative or additive noise. The restoration process consists of a stochastic relaxation algorithm which generates a sequence of images converging to the maximum a posteriori estimate (MAP) of the true image. Stochastic signal models are also considered in [2] and [33]–[37]. In these papers, hypothesis test techniques are exploited in designing procedures for model validation and estimation. The edge detection is then accomplished through an adaptive thresholding process. It should be noted that these methods consider only the probability of false detection, whereas optimal methods should also take into account the probability of wrong rejection. For the class of images defined in [38] we propose a method based on the definition of a stochastic state-space signal model. The image domain is partitioned into disjoint subsets where the function describing the gray level has continuous derivatives up to a suitable order. The edges occur at the boundaries of these domains of regularity. It is generally accepted that through an edge curve the signal level is going to vary quickly, so that the gradient presents a local maximum [21], [24] and has a direction orthogonal to the contour. Therefore, we can consider edges as generally regular curves representing the gradient maxima loci. In the neighborhood of any pixel, the assumed smoothness property of the gray level and its derivatives, allows us to define a structured signal component (signal state) via a truncated Taylor series. The series remainder is modeled as a random term, accounting for the variability of the approximation error within a given set of images of the same kind (for example,

1057–7122/99$10.00  1999 IEEE

DE SANTIS AND SINISGALLI: BAYESIAN APPROACH TO EDGE DETECTION

687

the same NMR body section in different individuals). Thus, all the possible signal realizations, and not just a particular data sample, are represented and a versatile modeling tool is obtained to account for many practical situations. In the smoothness subdomains we characterize the signal from a statistical point of view by further assuming that the gray-level distribution has constant mean value, while the distribution of its gradients has a zero-mean value. These hypotheses seem reasonable in many cases where the signal variations in any region are small compared to those occurring across the edge. The proposed procedure consists of a decision rule to mark as boundary one, rather than belonging to a given point the interior of a smoothness domain. A suitable set of pixels is considered, and the corresponding noisy neighboring measurements of the gray level are expressed as a function . Then, a Bayesian procedure is of the signal state at and the adopted to identify the unknown state vector at statistical parameters of the model. Based upon the optimal estimated values of the gradients, we derive a curve element passing through the chosen point which locally approximates the hypothetical contour. Then the presence of an edge is modeled by assigning different mean values to the signal distribution at points belonging to the opposite sides of the curve. Hence, the new statistical model is identified as well. Finally, by using the identified models we test the hypothesis that the data come from an homogeneous sample, as opposed to the alternative hypothesis that the sample statistics has a nonuniform mean value. The log-likelihood ratio statistics is used to define the trust region and an unbiased most powerful test is obtained [40] (i.e., both types of errors of detecting false edges and missing the existing ones are optimized). We stress that the numerical values of the signal gradients are not directly used to decide whether a pixel is an edge point (local maxima, zero crossings). As a consequence, a thresholding procedure is not required. On the other hand, once a confidence level is chosen, the test power set is determined according to the estimated local signal statistics, so that an optimal adaptive procedure is obtained. We summarize the algorithm features below. 1) A linear stochastic state space model based on a physically meaningful image description is adopted. 2) The model depends on a minimal number of parameters and adapts to many practical situations. 3) Edges of any order can be dealt with by simply choosing the model order. 4) Edge detection is based on an optimal statistical hypothesis test which is unbiased and most powerful. 5) The procedure is adaptive since the previous point relies on the local signal statistics, estimated from noisy data by an optimal Bayesian algorithm. We remark that optimality is obtained at the expense of computational complexity. Nevertheless, the algorithm is highly parallelizable. Improving the procedure efficiency is pursued by considering image strip processing and ad hoc largedimension optimization methods [44]. We do not consider subpixel accuracy, since our goal consists in only deciding

whether two adjacent pixels belong to the same smooth subdomain. This information can be used in designing variable structure filters for image restoration. In Section II, the statistical model derivation is detailed. In Section III, we describe the estimation procedure and in Section IV the statistical hypothesis test is developed. Numerical results are found in Section V. II. MODEL ASSUMPTIONS In this section, we derive a signal stochastic model for the class of images described in [38] by means of the following assumptions. 1) Smoothness assumption: The image domain is considered as the union of open disjoint subsets where the signal is continuously differentiable up to a suitable order . 2) Stochastic assumption: The signal gradients of order are modeled as independent white gaussian random fields. The smoothness assumption models the common situation encountered in observing a real scene where various objects are displayed on a background. Indeed, the projection of the observed 3-D scene onto a 2-D plane results in an ensemble of domains where the gray level has a relatively homogeneous distribution, linked to each other along generally regular curves. indicate the function representing the image Let signal. According to the smoothness assumption 1) let us belongs to the space of continuous assume in a functions with continuous derivatives up to order . In any point bounded domain the following vector can be defined ([38]):

(2.1) According to this with is found at the th definition, the gradient of with . The entry degree of regularity is a model parameter to be chosen for an adequate signal local representation; for piecewise constant . images, for instance, we can express Given any other point as a function of via a Taylor series expansion argument. To this aim, let us consider the following parametric : representation of the straight line segment

(2.2)

688

IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMS—I: FUNDAMENTAL THEORY AND APPLICATIONS, VOL. 46, NO. 6, JUNE 1999

where is the displacement along the direction determined by the directional cosines . Then for we have

(2.3)

the output of a linear stationary system fed by a white noise (see [42] and [43]). Hence, had the signal derivatives been assumed correlated random fields, they could have been represented as the sum of a structured component and a white noise. Therefore, model (2.4) would still have been obtained, of larger dimension. Model (2.4) but with a state vector describes the signal level at points lying in a neighborhood in terms of the full information contained in of Vector is assumed to be gaussian with mean and . Moreover, is independent covariance matrix for any . Consequently, is a of the stochastic term gaussian with the following mean and variance:

and Series (2.3) is a linear combination of the entries of , thus defining the following linear stochastic model:

where

(2.4) is a where It is as follows:

-row vector composed of

blocks.

(2.9) (2.10) . Note that coefficients in (2.9) where but on the difference , and (2.10) do not depend on is a stationary (i.e., space invariant) random implying that process. For reader convenience, we report in Appendix A the . explicit form of (2.4)–(2.10) for the case Measurement Model

(2.5) is a -row vector are the terms of the considered in the usual order i.e.,

matrix The available data are usually stored in an ’s of the image whose entries provide noisy observations sampled signal level uniformly in by step in both directions and . We then have

(2.6)

(2.11)

in (2.4) is a linear From (2.3) we see that the quantity -order signal derivatives combination of the . According to the stochastic assumption 2), these terms are considered as realizations of independent white gaussian random fields with variance equal , i.e., to

representing the measurement The diadic sequence noise, is a zero-mean white gaussian sequence, with variance (which is usually a known parameter of the signal detecting and of the noise term equipment). It is independent of for any Consider now the pattern of pixels, displayed in Fig. 1. In what follows we will identify any pair of coordinates by the pair of indexes The generic pixel in Fig. 1 is obtained by setting

In (2.5) each block whose entries polynomial

(2.7) is the Kronecker delta. Consequently, and gaussian with variance

is a (2.12) is computed by using The corresponding signal value obtaining (2.4) with initial point (2.8) (2.13)

The remainder of series (2.3) results in a random term which makes model (2.4) suitable in describing many possible realizations of images. Assumption 2) does not imply any loss of . It is a wellgenerality in the statistical description of known result in stochastic realization theory that any stationary finite bandwidth signal (correlated noise) can be realized as

and denote, respectively, and where with equal to . Variance will be denoted by Starting from the pixel at the upper left corner of Fig. 1, ’s in a and proceeding by columns, we group all the

DE SANTIS AND SINISGALLI: BAYESIAN APPROACH TO EDGE DETECTION

689

with mean value

and covariance matrix

given by

.. . .. .

The generic term of matrix represents the covariance and of the terms relevant to the pixels and , respectively. The and indexes and are computed by substituting given by (2.12) in formula (2.15). We can then write Fig. 1. Pattern of (2q + 1)

vector

2 (2

q

+ 1) pixels neighboring pixel (i; j ).

According to (2.14) we form the vector of measurements obtaining

. The following relation is obtained:

(2.16) The measurement noise vector has zero mean and covariance matrix We now adapt model (2.14) and (2.16) in order to describe the cases in which pattern of Fig. 1 either belongs to the same homogeneous subdomain (Model 1), or is crossed by an edge (Model 2).

.. . .. .

Model 1

.. .

.. .

.. .

.. .

Equation (2.4) describes a gaussian random field for According to the smoothness assumption 1) the signal level in each regularity subset is sufficiently homogeneous so that we can assume it has a constant mean value . On the other hand, for the signal gradients, representing the graylevel variations, it is realistic to assume a distribution with zero-mean value in these open domains. As a consequence, we have for any (2.14)

is a matrix of rows of dimension where sequentially allocated according to the chosen order. The vector of stochastic terms is congruently ordered and a diagonal covariance matrix and has mean . Quantities relevant to pixel are placed in (2.14) at computed as follows: position (2.15) Then we see that

where

denotes the th row of

.

is a gaussian vector

and for vector

defined by (2.14) we obtain

Model 2 Edge points occur at the boundaries of the smoothness domains. The presence of an edge is then modeled as a sharp variation in the mean value of the gray-level distribution. Due to the high resolution available, the set of pixels of Fig. 1 of pixel of a actually extends over a neighborhood very small measure so that the image signal can be locally represented by the following truncated Taylor series:

(2.17)

690

IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMS—I: FUNDAMENTAL THEORY AND APPLICATIONS, VOL. 46, NO. 6, JUNE 1999

where the coefficients of the expansion are the entries of Equation (2.17) is a generalization of (2.3) for a regular curve (not just a straight line) passing through Among such curves, we are interested in only the one giving the locus of points where the signal gradient is maximum. The restriction to of the projection of this curve on would give the edge element dividing points in belonging to different homogeneous subdomains. The edge of the element can be approximated by the segment level contour given by

III. ESTIMATION PROCEDURE From (2.14) and (2.16) we obtain the following linear model: (3.1) is a gaussian vector with zero-mean value where in the case of Model 1. In case of Model 2, it has entries for the pixels belonging to group one. Vector equal to has a covariance matrix given by (3.2)

From (2.17) we obtain that relation:

is defined by the following

where From (2.8) we have

with

and

satisfying (2.15).

(2.18) Then we can distinguish pixels in located at opposite sides , since for them we have either (group of (group two). We denote by and one, say) or the sets of indexes identifying the signal values ’s, related to the pixels of groups one and two, in vector respectively. In order to uniformly modify the signal mean value of group one, for instance, while retaining (2.4), we assign a nonzeroto the noise terms relevant to mean value equal to to those of group the series expansions relating pixel have the one. Hence, in (2.14) the random terms . This way, (2.14) still first entry with mean value equal to are holds but the entries of

By taking into account (2.2), for the pixel that

we obtain

which substituted in the previous relation eventually yields

(3.3) (2.19) We identify group one as the set of pixels belonging to the so subregion pointed by the gradient vector is actually added to the points where the signal has that a higher level. Equation (2.16), representing the available signal level measurements, delivers different statistical descriptions of the data according to the two situations described above. We first identify Model 1, thus estimating the entries of Then we determine function and by (2.18) we form groups one and two of measurement points, so that Model 2 is obtained by modifying the signal mean value according to (2.19). Once Model 2 is also identified, we test the hypothesis belongs to an homogeneous subset, as opposed that pixel to the alternative hypothesis that it lies on a curve element dividing adjacent subregions with different signal level mean is marked as an edge values. In the latter case, pixel point.

we need In (3.1), in addition to the random variable to also estimate the parameters defining the distributions of the random quantities involved. We denote by the vector of these unknown parameters. In particular, for Model 1 it is

and

for Model 2. In order to adopt a Bayesian approach, we consider as a vector of independent random variables with uniform over a suitable compact interval, or distribution Actually, Model 1 can be embedded in Model 2 once we set . Thus, our basic datum is represented by which is defined on the joint density function . According to the principle of maximum unconditional likelihood estimation (MULE) [39], we maximize

DE SANTIS AND SINISGALLI: BAYESIAN APPROACH TO EDGE DETECTION

function

with respect to The log-likelihood can be written as follows:

691

We know that

(4.2) and (3.4) with

(4.3) where

where is a vector with entries equal to one for the and zero otherwise (in the case of Model 1 indexes of set all the entries are zero). The peculiar form of (3.4) allows us to split the maximization problem in two steps: one solvable in closed form and the other of highly reduced order. The optimal estimate is obtained by solving the set of equations (3.5) (3.6)

Since for any admissible , is a quadratic concave the maximum respect to this variable exists function of obtained from (3.5) as and is attained at the point

(3.7)

and

is the th row of matrix . We can then write

(4.4) depends on a sum of The likelihood function independent random variables obtained as a second-degree ’s. The statistics polynomial transformation of gaussians are difficult to derive in closed form and only an of approximation can be attempted (see [41]). In the spirit of the hypothesis testing we should rather endeavor to determine a simple decision rule to accept one model or the other. In can be Appendix B it is shown that, to some extent, expressed in terms of an affine transformation of the ’s, obtaining (4.5)

By substituting (3.7) back in (3.6), an equation just for the optimal estimate is obtained (3.8)

Parameter interval is chosen in order to obtain a well-posed maximization problem for function In particular, the interval of admissible values must be chosen sufficiently away from zero on the of is a continuous positive real line. This implies that so that the existence of the function on the compact set maximum is guaranteed.

where the defined as

’s and

’s are suitable constants and the

’s

are independent standard normals in the case of Model 1, i.e., By setting

IV. HYPOTHESIS TEST Let us denote by and the estimated quantities related to Models 1 and 2, respectively. We compare the two models through an hypothesis test based on the generalized likelihood ratio (4.1)

relation (4.5) becomes (4.6) The probability of rejecting the null hypothesis

692

IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMS—I: FUNDAMENTAL THEORY AND APPLICATIONS, VOL. 46, NO. 6, JUNE 1999

when it is true (wrong rejection) is called the test significance defined as level. It is the probability measure of the set follows: (4.7) of the parameter space is called the test Then, the subset critical set of level . It is not uniquely defined by (4.7) so that it can be chosen in order to give the largest probability when it is false. This probability defines the of rejecting test power. Then, among all the tests of level we look for the most powerful one, which minimizes the probability of a wrong detection. According to the Pearson Lemma ([40]), the most powerful test of level is obtained by the relation

(a)

(4.8) where constant must be chosen in order to satisfy (4.7). through In our case, the determination of the critical set (4.7) and (4.8), would give rise to a biased test ([40]) and an unsymmetric rejection rule on the values of These unfavorable features can be eliminated by substituting inequality (4.8) with the following one (see again [40]):

(b)

(c)

(d)

(e)

(4.9) Constants and are determined so that the sign of equality with denoting the in (4.9) holds when value of a standard normal deviate (see [40, p. 211]). Then, the following symmetric two-sided rejection rule is obtained: (4.10) We yielding an unbiased and most powerful test of level remark that we are not concerned about the test uniformness since the alternative hypothesis is given by a specific point in the parameter space. V. NUMERICAL RESULTS The method has been tested on both simulated and real data. A comparison with other existing methods was also performed. Monochromatic 16 16-pixel simulated images were chosen to deal with some simple but meaningful cases. Two basic edge patterns have been considered, i.e., parallel straight lines and single closed curves (circles), analyzing the effect of varying some parameters such as the step size, the signal-to-noise ratio (SNR), the signal behavior in the smooth subdomains, and the test significance level. Straight parallel edges are useful to check the detector capability in resolving adjacent contours. Circles with small radius are representative of closed 90-pixel real image, with two high curvature edges. A 90 different SNR values, was finally processed. Simulated images were considered with a gray-level range between 0 and 255 and the signal model was obtained with . Parameter was chosen equal to two, thus obtaining a 5 5-pixel detector which featured a satisfying balance between noise filtering and detection capability. In all the experiments the detection starts at row three and terminates at row 14 because of the detector size. For the hypothesis test,

(f)

=

=

(g)

Fig. 2. (a) Original image. (b) Step 35, SNR 2. (c) Reconstructed edge. (d) Step 25, SNR 1. (e) Reconstructed edge. (f) Step 20, SNR 2=3. (g) Reconstructed edge.

=

=

=

=

in the cases of Figs. 2–4, a value was adopted, yielding a significance level within 1 and 5% ([40]). In the first test (Fig. 2) we considered piecewise constant images with a reference gray level equal to 100 and a central strip, 6-pixels wide, with values of 135, 125 (original image of Fig. 2), and 120. Then a noise was added with variance equal to 140, thus obtaining noisy images with SNR 2, Fig. 2(b), SNR 1, Fig. 2(d), SNR 2 3, Fig. 2(f). In Fig. 2(c), (e), and (g) the correspondent detected edges are reported. We see that by decreasing the SNR, the algorithm has

DE SANTIS AND SINISGALLI: BAYESIAN APPROACH TO EDGE DETECTION

693

(a)

(a)

(b)

(c)

(b)

(c)

(d)

(e)

(d)

(e)

(f)

(g)

(f)

(g)

=

=

Fig. 3. (a) Original image. (b) Step 35, SNR 2. (c) Reconstructed edge. (d) Step 25, SNR 1. (e) Reconstructed edge. (f) Step 20, SNR 2=3. (g) Reconstructed edge.

=

=

=

=

a conservative behavior (i.e., a fewer number of detections are likely to occur). On the other hand, when the SNR increases, both pixels across the edges tend to be marked as boundary points, going toward the situation where, in the absence of noise, we would obtain a double detection across the edges in any row (we did not report this result in Fig. 2). Depending on later use, we stress that the detected edge can be easily thinned by devising procedures based on the available likelihood values of the boundary points. As a final remark, we observe that no false detections occur away from the edges. This

=

=

Fig. 4. (a) Original image. (b) Step 40, SNR 2. (c) Reconstructed edge. (d) Step 30, SNR 1. (e) Reconstructed edge. (f) Step 25, SNR 2=3. (g) Reconstructed edge.

=

=

=

=

depends on the chosen significance level, which makes the algorithm quite conservative. This is preferable, for instance, when a variable structure filter is to be subsequently used. In Fig. 3 we repeated the previous experiment by perturbing the true signal by the following harmonic function:

with We correspondingly raised the to 160 in order to obtain the SNR values noise variance previously chosen. Fig. 3(c), (e), and (g) show the reconstructed edges for decreasing values of SNR, confirming

694

IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMS—I: FUNDAMENTAL THEORY AND APPLICATIONS, VOL. 46, NO. 6, JUNE 1999

(a)

(a)

(b)

(c)

(d)

(b)

(e)

=

=

(c)

(d)

(e)

=

=

Fig. 5. (a) Original image. (b) Step 35, SNR 2. (c) Reconstructed edge. (d) Step 25, SNR 1. (e) Reconstructed edge.

Fig. 6. (a) Original image. (b) Step 40, SNR 2. (c) Reconstructed edge. (d) Step 30, SNR 1. (e) Reconstructed edge.

the conservative behavior already observed in the previous experiment. Moreover, comparing Fig. 3(c), (e), and (g) with the correspondent Fig. 2(c), (e), and (g) we see that for a given SNR the signal perturbation causes the algorithm to yield a lower number of detections. In this case, the detector response can be improved by increasing the signal model order . In Fig. 4, the second type of contour is considered, i.e., a disc with a diameter of 9 pixels of gray level equal to 70, 60 (original image of Fig. 4), and 55, centered in an image of constant gray level equal to 30. On noisy images with SNR equal to 2, 1, and 2 3, displayed on Fig. 4(b), (d), and (f), respectively, we obtained the results illustrated in Fig. 4(c), (e), and (g), which show again that the proposed procedure has a good detection performance and a conservative behavior in correlation with decreasing values of SNR. The next set of numerical experiments concerns the procedure assessment by using a less conservative value of , thus checking the effect of an increase of the probability of both the errors of missing existing edges and detecting , the false ones. The results were obtained with corresponding to a test significance level within 5 and 10%. Fig. 5(c) and (e) shows the outcome of the elaboration of the

data already considered in the examples of Fig. 2(b) and (d) for the straight line edges. Similarly, on Fig. 6(c) and (e) are reported the results related to data of Fig. 4(b) and (d) (circles). Comparing the corresponding cases between Figs. 2 and 5, as well as the corresponding cases between Figs. 4 and 6, we can observe a limited overall degradation of the detected patterns; actually, spurious detections occur away from the edges, but the detection across the edges are also affected. Nevertheless, the tests of both Figs. 5 and 6 still show a conservative behavior of the detector when the SNR decreases. In Fig. 7, a real image is considered. It represents a detail of the portrait of Susan, courtesy of IBM scientific center 90 sample of Fig. 7(a) the of Rome. On the selected 90 estimated noiseless signal variance was found to be equal to 4000. Noisy data with SNR 2 and SNR 1 were obtained equal to 2000 by adding measurement noise with variance [Fig. 7(b)] and 4000 [Fig. 7(d)]. We increased the detector size to 7 7 pixels by choosing to enhance the filtering action. The model order was again chosen equal to one, while for the hypothesis test a value equal to two was considered. Images with SNR 2 and SNR 1 were processed and the results are displayed in Fig. 7(c)

=

=

=

=

DE SANTIS AND SINISGALLI: BAYESIAN APPROACH TO EDGE DETECTION

695

(a)

(b)

(d)

(a)

(b)

(c)

(d)

(e)

(f)

(c)

2

(e)

Fig. 7. (a) Original image (90 90): particular of Susan, courtesy of IBM Scientific Center of Rome. (b) Noisy version of the original with SNR 2. (c) Reconstructed edges of Fig. 7(b). (d) Noisy version of the original with SNR 1. (e) Reconstructed edges of Fig. 7(d).

=

=

and (e), respectively. In Fig. 7(c) we can note a good edge reconstruction with a limited number of false detections in the homogeneous subregions. In Fig. 7(e) only part of the true edges are clearly demarcated, while no false detections occur. As a final study, a comparison between the performances of the proposed method and those obtainable by other existing techniques was made. Two algorithms among the least complex ones, based on the first derivative computation and global thresholding, were chosen. The comparison should tell if the complexity of the Bayesian procedure is ultimately worthwhile in terms of the quality of the detected contours. For convenience the kernels used are reported

Operator is the well-known Sobel detector [30], while was successfully used in [38] to adjust the Kalman filter

Fig. 8. (a), (c,), (e) Edges reconstructed by operator D1 with thresholds = 20; 25; and 30; respectively, for the original image of Fig. 4(b) (SNR = 2). (b), (d), (f) Edges reconstructed by operator D 1 with thresholds T H = 25; 35; and 45; respectively, for the original image of Fig. 4(d) (SNR = 1). TH

behavior across the edges. Images are then processed in both and ) and vertical directions the horizontal (using and to estimate the signal first derivatives at any pixel ; hence, the gradient norm is obtained as and compared with the chosen threshold . was first applied to the test image of Fig. 4(b) Operator (SNR 2), obtaining the results displayed in Fig. 8(a) , Fig. 8(c) , and Fig. 8(e) . The image of Fig. 4(d) (SNR 1) was then processed, obtaining , Fig. 8(d) , the plots of Fig. 8(b) . We see that operator gives a and Fig. 8(f) good performance since the global thresholding fits well to the simple test image considered, nevertheless, some trials are needed to adjust the threshold and the result obtained is quite [compare Fig. 8(b), (d), and sensitive to the choice of (f)]. Comparing plots of Fig. 8 to the contours obtained in Fig. 4(c) and (e), we see that the Bayesian procedure performs : edges are better demarcated at least as well as detector

696

IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMS—I: FUNDAMENTAL THEORY AND APPLICATIONS, VOL. 46, NO. 6, JUNE 1999

(a)

(b)

(c)

(d)

(e)

(f)

Fig. 9. (a), (c), (e) Edges reconstructed by operator D1 with thresholds (T H = 75; 100; and 125; respectively, for the image of Fig. 7(b) (SNR = 2. (b), (d), (f) Edges reconstructed by operator D 1 with thresholds (T H = 125; 150; and 175; respectively, for the image of Fig. 7(d) (SNR = 1.

and no spurious detections are found. Since such simple test images were chosen to check the method effectiveness on small details, we can conclude that our algorithm performs with a tuned threshold. locally at least as well as detector was apThe situation is quite different on real images. plied to image Fig. 7(b) (SNR 2) with obtaining the results shown on Fig. 9(a), (c), and (e), respec1) was then processed with tively. Image Fig. 7(d) (SNR obtaining the results shown in Fig. 9(b), (d), and (f), respectively. In both cases, too many wrong detections occur with poorly demarcated edges. Moreover, since the global thresholding badly adapts to data of this example, we the result did not improve as well as see that by increasing in the case of Fig. 8. Compared with the plots of Fig. 7(c) and . Of (e), it is clear that the Bayesian detector outperforms course this also depends on the difference in size between the , which has detectors. In this respect, we adopted operator , and processed again images better filtering properties than of Fig. 7(b) and (d). Fig. 10(a), (c), and (e) (SNR 2) shows respectively, the detected contours with while Fig. 10(b), 10(d), and 10(f) (SNR 1) show those ones . Observing Fig. 10(a) and (b) we with yields edges reasonably demarcated [less, at any see that rate, than those of Fig. 7(c) and 7(e)], but with too many spurious detections in the homogeneous subregions. These

(a)

(b)

(c)

(d)

(e)

(f)

Fig. 10. (a), (c), (e) Edges reconstructed by operator D 2 with thresholds (T H = 60; 80; and 90; respectively, for the image of Fig. 7(b) (SNR = 2. (b), (d), (f) Edges reconstructed by operator D 2 with thresholds (T H = 80; 100; and 120; respectively, for the image of Fig. 7(d) (SNR = 1.

false detections are practically absent in Fig. 7(c) and 7(e). , true edge points are invariably missed. By increasing As a final remark, we can say that a rather good detection performance is attainable by the optimal Bayesian procedure studied in this paper. On the other hand, rather high values have been preferred to avoid spurious detections due of to noise, even at the expense of missing some edge points. This is generally recommended in image restoration when using space-variant techniques (see for instance [45]) where the information about the edges is exploited to cause the filter reinitialization. The algorithm complexity mainly depends on the optimization procedure adopted to identify the signal models. The numerical efficiency can be actually improved via largedimension optimization techniques [44]. VI. CONCLUSIONS A method for edge detection of noisy images belonging to the class described by the smoothness and stochastic assumptions 1) and 2), has been proposed. For any pixel , a set of neighboring points is collected and a linear stochastic relation is established between the gray-level noisy measurements of the signal and its at these points and the values at derivatives up to a certain order . Then, through a Bayesian estimation technique, two statistical models are identified on the considered data sample. In Model 1 the signal gray level

DE SANTIS AND SINISGALLI: BAYESIAN APPROACH TO EDGE DETECTION

has a constant mean value and Model 2 describes the presence of an edge as a sharp variation in the signal mean value for pixels belonging to opposite sides of the contour. The likelihood of one model versus the other is evaluated by a statistical hypothesis test. Besides the choice of the test confidence level, the test critical set depends on the statistical signal parameters estimated through Models 1 and 2. An adaptive algorithm is then obtained which does not require any thresholding procedure. Parameter determines the signal model order and can be suitably chosen depending on the signal behavior in the smoothness domains. Nevertheless, the higher the , the larger the number of variables to be estimated. Thus, a larger data sample must be collected, determining a detector of larger support. This in turn implies a lower resolution power. Thus, a tradeoff between different goals must be achieved. As a general rule, since we are interested in edge localization rather than in image restoration, high-order models should be avoided in favor of less complex algorithms and better resolution features. The numerical tests performed on simulated data were encouraging and denoted a certain degree of robustness versus false detections in increasingly noise corrupted images. This feature is particularly useful when the information on edge location is to be used in space-varying filters for image restoration. APPENDIX A Let us fix

697

are independent gaussians with variance in (A.2)

has variance

the random term

computed in (2.8) and given by

APPENDIX B The exponential in (4.4) can be manipulated obtaining

(B.1) where ing that

Assum(B.2)

From (2.1) we obtain

(A.1)

term in the second i.e., it is small enough to neglect the factor of each addendum in (B.1), this expression eventually becomes

Equation (2.3) becomes

(A.2) In order to build matrix the row vectors

according to (2.5), let us compute defined in (2.6). We obtain

(B.3) where

so that

Recalling that

698

IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMS—I: FUNDAMENTAL THEORY AND APPLICATIONS, VOL. 46, NO. 6, JUNE 1999

The argument involved in assumption (B.2) can be justified via practical considerations. In the homogeneous image subvalue is expected to be estimated. Then domains a low and , depending on the the difference between determination, is likely to be negligible. On the other hand, this is no longer true across the edges. From (3.6) we can easily obtain that

Upon substituting this expression in (3.5) and (3.6), when identifying Model 2, each measurement term is perturbed as follows:

(B.4) is the cardinality of set . We see that on increasing where the measurement perturbation due to is reduced, while for small values a limited number terms is affected, and the effect on the overall estimation procedure is limited. These considerations seem to support the assumption made, is also taking into account that the difference which is always greater than divided by ACKNOWLEDGMENT The authors wish to thank Prof. A. Bertuzzi and Prof. A. Gandolfi of IASI-CNR of Rome for their useful suggestions and comments that improved the work. REFERENCES [1] R. M. Gray, A. Buzo, A. H. Gray, and Y. Matsuyama, “Distortion measures for speech processing,” IEEE Trans. Acoust., Speech, Signal Processing, vol. ASSP-28, pp. 367–376, Aug. 1980. [2] M. Basseville and A. Benveniste, “Design and comparative study of some sequential jump detection algorithms for digital signals,” IEEE Trans. Acoust., Speech, Signal Processing, vol. ASSP-31, pp. 521–534, June 1983. [3] N. Ishii, H. Sugimoto, A. Iwata, and N. Suzumura, “Computer classification of the EEG time-series by Kullback information measure,” Int. J. Syst. Sci., vol. 11, pp. 677–688, June 1980. [4] S. M. Lehar, A. J. Worth, and D.N. Kennedy, “ Application of the boundary contour/feature contour system to magnetic resonance brain scan imagery,” in Proc. Int. Joint Conf. Neural Networks, San Diego, CA, June 1990, vol. 1, pp. 435–440. [5] V. S. Nalwa and T. O. Binford: “On detecting edges,” IEEE Trans. Pattern Anal. Machine Intell., vol. PAMI-8, pp. 699–714, Nov. 1986. [6] T. O. Binford, “Inferring surfaces from images,” Artificial Intell., vol. 17, pp. 205–244, Aug. 1981.

[7] V. Torre and T. A. Poggio, “On edge detection,” IEEE Trans. Pattern Anal. Machine Intell., vol. PAMI-8, pp. 147–163, Mar. 1986. [8] D. H. Ballard and C. Brown, Computer Vision. Englewood Cliffs, NJ: Prentice-Hall, 1982. [9] S. A. Rajala and R. J. P. De Figuereido, “Adaptive nonlinear restoration by a modified Kalman filtering approach,” IEEE Trans. Acoust., Speech, Signal Processing, vol. ASSP-29, pp. 1033–1042, Oct. 1981. [10] J. F. Abramatic and L. M. Silverman, “Nonlinear restoration of noisy images,” IEEE Trans. Pattern Anal. Machine Intell., vol. PAMI-4, pp. 141–149, Mar. 1982. [11] H. E. Knutsson et al., “Anisotropic nonstationary image estimation and its applications: Part I Restoration of noisy images,” IEEE Trans. Commun., vol. Com-31, pp. 388–397, Mar. 1983. [12] J. W. Woods et al., “Image estimation using doubly stochastic Gaussian random field models,” IEEE Trans. Pattern Anal. Machine Intell., vol. PAMI-9, pp. 245–253, Mar. 1987. [13] A. M. Tekalp et al., “Edge-adaptive Kalman filtering for image restoration with ringing suppression,” IEEE Trans. Acoust., Speech, Signal Processing, vol. ASSP-37, pp. 892–899, June 1989. [14] U. Massari and I. Tamanini, “Regularity properties of optimal segmentations,” J. f¨ur die reine und angewandte Mathematik, vol. 4200, pp. 61–84, 1991. [15] E. Joseph and T. Pavlidis, “Bar code waveform recognition using peak locations” IEEE Trans. Pattern Anal. Machine Intell., vol. PAMI-16, June 1994. [16] J. Froment and S. Mallat, “Second generation compact image coding with wavelets,” in A Tutorial in Theory and Applications, C. Chui, Ed. New York: Academic, June 1992, pp. 655–678. [17] S. Grossberg and E. Mingolla, “Neural dynamics of perceptual grouping: Textures, boundaries, and emergent segmentations,” Perception Psycophys., vol. 38, pp. 141–171, 1985 [18] S. Grossberg, E. Mingolla, and D. Todorovi´c, “A neural network architecture for preattentive vision,” IEEE Trans. Bio-Med. Eng., vol. 6, pp. 65–84, Jan. 1989. [19] D. Marr and E. Hildreth, “Theory of edge detection,” Proc. R. Soc. Lond., vol. 207, pp. 187–217, 1980. [20] A. Huertas and G. Medioni, “Detection of intensity changes with subpixel accuracy using Laplacian-Gaussian masks,” IEEE Trans. Pattern Anal. Machine Intell., vol. PAMI-8, pp. 651–664, Sept. 1986. [21] S. Mallat and W. L. Hwang, “Singularity detection and processing with wavelets,” IEEE Trans. Inform. Theory, vol. 38, pp. 617–643, Mar. 1992. [22] H. Asada and M. Brady, “The curvature primal sketch,” IEEE Trans. Pattern Anal. Machine Intell., vol. PAMI-8, pp. 2–14, Jan. 1986. [23] D. Mumford and J. Shah, “Optimal approximations by piecewise smooth functions and associated variational problems,” Comm. Pure Appl. Math., vol. 42, pp. 577–685, 1989. [24] R. M. Haralick, “Digital step edges from zero crossings of second directional derivatives,” IEEE Trans. Pattern Anal. Machine Intell., vol. PAMI-6, pp. 58–68, Jan. 1984. [25] W. H. Lunscher and M. P. Beddoes, “Optimal edge detector design I: Parameter selection and noise effects,” IEEE Trans. Pattern Anal. Machine Intell., vol. PAMI-8, pp. 164–177, Mar. 1986. , “ Optimal edge detector design I: Coefficient quantization,” [26] IEEE Trans. Pattern Anal. Machine Intell., vol. PAMI-8, pp. 178–187, Mar. 1986. [27] A. J. Tabatabai and O. R. Mitchell, “Edge location to subpixel values in digital imagery,” Trans. Pattern Anal. Machine Intell., vol. PAMI-6, pp. 188–201, Mar. 1984. [28] M. F. Hueckel, “An operator which locates edges in digitized pictures,” J. Assoc. Comput. Mach., vol. 18, pp. 113–125, 1971. [29] W. Frei and C. C. Chen, “Fast boundary detection: A generalization and a new algorithm,” IEEE Trans. Comput., vol. C-26, pp. 988–998, Oct. 1977. [30] Sobel in Pattern Classification and Scene Analysis, R. O. Duda and P. E. Hart, Eds. New York: Wiley, 1971. [31] S. Geman and D. Geman, “Stochastic relaxation, Gibbs distributions, and the Bayesian restoration of images,” Trans. Pattern Anal. Machine Intell., vol. PAMI-6, pp. 721–741, Nov. 1984. [32] D. Geman and G. Reynolds, “Constrained restoration and the recovery of discontinuities,” Dept. Math. and Statist. Univ. Massachusetts, Amherst, Rep. [33] J. K. Tugnait, “Linear model validation and order selection using higher order statistics,” IEEE Trans. Signal Processing, vol. 42, pp. 1728–1736, July 1994. [34] J. Princen, J. Illingworth, and J. Kittler, “Hypothesis testing: A framework for analyzing and optimizing Hough transform performance,” Trans. Pattern Anal. Machine Intell., vol. PAMI-16, pp. 329–341, Nov. 1984.

DE SANTIS AND SINISGALLI: BAYESIAN APPROACH TO EDGE DETECTION

699

[35] H. Rohling, “Radar CFAR thresholding in clutter and multiple target situations,” IEEE Trans. Aerosp. Electr. Syst., vol. AES-19, pp. 608–621, July 1983. [36] P. Weber and S. Haykin, “Ordered statistic CFAR processing for twoparameter distribution with variable skewness,” IEEE Trans. Aerosp. Electr. Syst., vol. AES-21, pp. 819–821, Nov. 1985. [37] P. H. Gregson, “Using angular dispersion of gradient direction for detecting edge ribbons,” Trans. Pattern Anal. Machine Intell., vol. PAMI-15, pp. 682–695, July 1993. [38] A. Germani and L. Jetto, “Image modeling and restoration: A new approach,” Cir., Syst., Signal Proc., vol. 7, pp. 427–457, 1988. [39] A. V. Balakrishnan, Kalman Filtering Theory. New York: Optimization Software Inc., 1987. [40] H. Cramer, Mathematical Methods of Statistics. Princeton, NJ: Princeton Univ. Press, 1946. [41] V. A. Zorin and A. K. Iyubimov, “The distribution of quadratic forms of Gaussian vectors,” Theory Probab. Appl., vol. 33, pp. 557–560, 1988. [42] A. K. Jain, “Partial differential equations and finite-difference methods in image processing, Part 1: Image representation,” J. Opt. Theory Appl., vol. Jota-23, no. 1, pp. 65–91, Sept. 1977. [43] M. Niedzwiecki and W. A. Sethares, “Smoothing of discontinuous signals: The competitive approach,” IEEE Trans. Signal Processing, vol. 43, pp. 1–13, Jan. 1995. [44] L. Grippo, F. Lampariello, and S. Lucidi, “A truncated Newton method with nonmonotone line search for unconstrained optimization,” J. Optim. Theory Appl., vol. 60, pp. 401–419, 1989.

[45] A. De Santis, A. Germani, and L. Jetto, “Space-variant recursive restoration of noisy images,” IEEE Trans. Circuits Syst. II, vol. 41, pp. 249–261, Apr. 1994.

Alberto De Santis was born in Rome, Italy, on April 11, 1958. He received the Laurea degree in electrical engineering in 1984 from the University “La Sapienza” of Rome. He was a Researcher at Istituto di Analisi dei Sistemi e Informatica of CNR, Rome, from 1987 to 1992. He then joined the Dip. di Informatica e Sistemistica, University “La Sapienza” of Rome, where he is currently Associate Professor. His research interests include signal and image processing, distributed parameter modeling, and control of mechanical structures.

Carmela Sinisgalli received the Laurea degree in electrical engineering and the Ph.D. degree in system engineering from the University “La Sapienza” of Rome, in 1991 and 1995, respectively. Her research interests are in the areas of parameter estimation theory in signal and image processing, as well as in the field of biomedical systems, with particular reference to cell population modeling and analysis of cytometric data.

Suggest Documents