## 1. Introduction

The field of two-dimensional filters and their design methods has known a large development due to its importance in image processing (Lim, 1990; Lu & Antoniou, 1992). There are methods based on numerical optimization and also analytical methods relying on 1D prototypes. A commonly-used design technique for 2D filters is to start from a specified 1D prototype filter and transform its transfer function using various frequency mappings in order to obtain a 2D filter with a desired frequency response. These are essentially spectral transformations from *s* to *z* plane, followed by z to

There are several classes of filters with orientation-selective frequency response, useful in tasks like edge detection, motion analysis, texture segmentation etc. Some relevant papers on directional filters and their applications are (Danielsson, 1980; Paplinski, 1998; Austvoll, 2000). An important class of orientation-selective filters are steerable filters, synthesized as a linear combination of a set of basis filters (Freeman & Adelson, 1991) and steerable wedge filters (Simoncelli & Farid, 1996). A directional filter bank (DFB) for image decomposition in the frequency domain was proposed in (Bamberger, 1992). In (Qunshan & Swamy, 1994) various 2D recursive filters are approached. Fan-shaped, also known as wedge-shaped filters find interesting applications. Design methods for IIR and FIR fan filters are presented in some early papers (Kayran & King, 1983; Ansari, 1987). An efficient design method for recursive fan filters is presented in (Zhu & Zhenya, 1990). An implementation of recursive fan filters using all-pass sections is given in (Zhu & Nakamura, 1996). In (Mollova, 1997), an analytical least-squares technique for FIR filters, in particular fan-type, is proposed. Design methods for efficient 2D FIR filters were treated in papers like (Zhu et al., 1999; Zhu et al., 2006). Zero-phase filters were studied as well (Psarakis, 1990). Different types of 2D filters derived from 1D prototypes through spectral transformations were treated in (Matei, 2011a).

We propose in this chapter some new design procedures for particular classes of 2D filters; the described methods are mainly analytical but also include numerical approximations. Various types of 2D filters will be approached, both recursive (IIR) and non-recursive (FIR). The design methods will focus however on recursive filters, since they are the most efficient.

The proposed design methods start from either digital or analog 1D prototypes with a desired characteristic. In this chapter we will mainly use analog prototypes, since the design turns out to be simpler and the 2D filters result of lower complexity. This analog prototype filter is described by a transfer function in the complex variable *s*, which can be factorized as a product of elementary functions of first or second order. The prototype transfer function results from an usual approximation (Butterworth, Chebyshev, elliptic) and the shape of the frequency response corresponds to the desired characteristic of the 2D filter.

The next design stage consists in finding the specific complex frequency transformation from the axis *s* to the complex plane

In this chapter we will approach two main classes of 2D filters. The first one comprises three types of orientation-selective filters, as follows: square-shaped (diamond-type) IIR filters, with arbitrary orientation in the frequency plane; fan-type IIR filters with specified orientation and aperture angles; and very selective IIR multi-directional filters (in particular two-directional and three-directional), which are useful in detecting and extracting simultaneously lines with different orientations from an image.

The other class discussed here refers to FIR filters. From this category we will approach zero-phase filters with circular frequency response. Zero-phase filters, with real transfer functions, are often used in image processing since they do not introduce any phase distortions. All these types of 2D filters are analyzed in detail in the following sections.

Stability of the two-dimensional recursive filters is also an important issue and is much more complicated than for 1D filters. For 2D filters, in general, it is quite difficult to take stability constraints into account during approximation stage (O’Connor & Huang, 1978). Therefore, various techniques were developed to separate stability from approximation. If the designed filter becomes unstable, some stabilization procedures are needed (Jury et al., 1977). Various stability conditions for 2D filters have been found (Mastorakis, 2000).

The medical image processing field has known a rapid development due to imaging value in assisting and assessing clinical diagnosis (Semmlow, 2004; Berry, 2007; Dougherty, 2011). In particular, the currently used vascular imaging technique is x-ray angiography, mainly in diagnosing cardio-vascular pathologies. A frequent application of cardiac imaging is the localization of narrowed or blocked coronary arteries. Fluorescein angiography is the best technique to view the retinal circulation and is useful for diagnosing retinal or optic nerve condition and assessing disorders like diabetic retinopathy, macular degeneration, retinal vein occlusions etc. There are many papers approaching various methods and techniques aiming at improving angiogram images. In papers like (Frangi et al., 1998) the multiscale analysis is used, with the purpose of vessel enhancement and detection. Usual approaches include Hessian-based filtering, based on the multiscale local structure of an image and directional features of vessels (Truc et al., 2007). In cardio-vascular imaging, an essential pre-processing task is the enhancement of coronary arterial tree, commonly using gradient or other local operators. In (Khan et al., 2004) a decimation-free directional filter bank is used. An adaptive vessel detection scheme is proposed in (Wu et al., 2006) based on Gabor filter response. Filtering is an elementary operation in low level computer vision and a pre-processing stage in many biomedical image processing applications. Some edge-preserving filtering techniques for biomedical image smoothing have been proposed (Rydell et al., 2008; Wong et al., 2004). At the end of this chapter some simulation results are given for biomedical image filtering using some of the proposed 2D filters, namely the directional narrow fan-filter with specified orientation and the zero-phase circular filter.

## 2. Analog and digital 1D prototype filters used in 2D filter design

This section presents the types of analog and digital 1D recursive prototype filters which will be further used to derive the desired 2D filter characteristics. An analog IIR prototype filter of order *N* has a transfer function in variable *s* of the general form:

This general transfer function can be factorized into simpler rational functions of first and second order. Such a second-order rational function (biquad) can be written:

where generally the second-order polynomials at numerator and denominator have complex-conjugated roots, and *k* is a constant. For typical approximations – Chebyshev or elliptic – usually

The frequency response magnitude of this LP filter for

The second prototype is an elliptic LP analog filter with parameters:

The frequency response magnitude of this LP filter for

In Fig.1 (d) the shifted filter response magnitude for

The transfer function magnitude for such a filter with

A useful zero-phase prototype can be obtained from the general function (1) by preserving only the magnitude characteristics of the 1D filter; this prototype will be further used to design 2D zero-phase FIR filters of different types, specifically circular filters, with real-valued transfer functions. In order to obtain a zero-phase filter, we consider the magnitude characteristics of

and so we get the polynomial expansion in variable *x*:

where the number of terms *N* is chosen large enough to ensure the desired precision. The next step is to substitute back

Next let us consider a recursive digital filter of order *N* with the transfer function:

This general transfer function with

The transfer function also contains second-order (biquad) functions, where in general the numerator and denominator polynomials have complex-conjugated roots:

We will further use the term *template*, common in the field of cellular neural networks, for the coefficient matrices of the numerator and denominator of a 2D transfer function

## 3. Diamond-type recursive filters

In this section a design method is proposed for 2D square-shaped (diamond-type) IIR filters. The design relies on an analog 1D maximally-flat low-pass prototype filter. To this filter a frequency transformation is applied, which yields a 2D filter with the desired square shape in the frequency plane. The proposed method combines the analytical approach with numerical approximations.

### 3.1. Specification of diamond-type filters in the frequency plane

The standard diamond filter has the shape in the frequency plane as shown in Fig.2 (a). It is a square with a side length of

The diamond-type filter in Fig.2 (e) is derived as the intersection of two oriented low-pass filters whose axes are perpendicular to each other, for which the shape in the frequency plane is given in Fig.2 (c), (d). Correspondingly, the diamond-type filter transfer function

The frequency characteristic of

### 3.2. Design method for diamond-type filters

The issue of this section is to find the transfer function

The spatial orientation is specified by an angle

The oriented filter

This method is straightforward, still the resulted 2D filter will present linearity distortions in its shape, which increase towards the limits of the frequency plane as compared to the ideal frequency response. This is mainly due to the so-called frequency warping effect of the bilinear transform, expressed by the continuous to discrete frequency mapping:

where

In order to include the nonlinear mappings (21) into the frequency transformation, a rational approximation is needed. One of the most efficient is Chebyshev-Padé, which gives uniform approximation over a specified range. We get the accurate approximation for

Substituting the nonlinear mappings (21) with approximate expression (22) into (18) we get the 1D to 2D mapping which includes the pre-warping along both frequency axes:

Applying the bilinear transform (19) along the two axes we obtain the mapping

Here

Substituting the mapping (24) into the expression (2) of the biquad transfer function

where

and the

For instance, corresponding to the third biquad function

The characteristics of a diamond-type filter with orientation angle

The 2D low-pass filter is separable and results by applying successively the 1D filter along the two frequency axes; the

The resulted 2D square-shaped correction filter characteristic is shown in Fig.3 (a) and is almost maximally-flat, as required. The corrected version of the diamond-type filter from Fig. 3 (b), (c) has the magnitude and the contour plot shown in Fig. 3 (d), (e). It can be easily noticed that the initial distortions have been eliminated. Another two diamond-type filters with orientation angles

## 4. Fan-type recursive filters

In this section an analytical design method in the frequency domain for 2D fan-type filters is proposed, starting from an 1D analog prototype filter, with a transfer function decomposed as a product of elementary functions. Since we envisage designing efficient 2D filters, of minimum order, recursive filters are used as prototypes, and the 2D fan-type filters will result recursive as well.

In Fig.5 (a) a general fan-type filter is shown, with an aperture angle

The 1D analog filter discussed in section 2 is used as prototype. The general fan-type filter can be derived from a LP prototype using the frequency mapping (Matei & Matei, 2012):

In (31),

Applying the same steps as in Section 3.2 in order to obtain a discrete form of the above frequency mapping, using relations (21), (22) and (32) we obtain the 1D to 2D mapping which includes pre-warping along both axes of the frequency plane:

We now apply the bilinear transform (19) along the two axes and obtain the mapping

and the

Substituting the mapping (34) into the biquad expression (2) with

The 2D transfer function for each biquad is complex. The characteristics of a fan-type filter designed with this method and based on the prototype filter of order 4 given by (6)-(7) is shown in Fig.6 (a), for the indicated parameters. As with the diamond-type filter analyzed in the previous section, the fan-type filter characteristic features marginal linearity distortions which can be corrected using a LP filter, similar with the correction filter used in Section 3.2 and having the frequency characteristic shown in Fig. 3 (a).

Two corrected fan-type filters with specified parameters have the magnitudes and contour plots shown in Fig.6 (b), (c). The initial distortions have been eliminated. With the same correction filter, we obtain the two-quadrant fan filter, shown in Fig. 7, by setting the aperture angle

## 5. Very selective multidirectional IIR Filters

In this section a design method based on spectral transformations is proposed for another class of 2D IIR filters, namely multi-directional filters. The design starts from an analog prototype with specified parameters. Applying an appropriate frequency transformation to the 1D transfer function, the desired 2D filter is directly obtained in a factorized form, like the filters designed in the previous sections. For two-directional filters, an example is given of extracting lines with two different orientations from a test image. The spectral transformation used in the case of multi-directional filters is similar to the one presented in the previous section, derived for fan-type filters and given by (34), (35). In this section the design of two-directional and three-directional filters with specified orientation is detailed. The method can be easily generalized to arbitrary multi-directional filters.

### 5.1. Two-directional fan-type filters

A two-directional 2D filter is orientation-selective along two directions in the frequency plane. It is based on a selective resonant IIR prototype as given in section 2. Applying the same frequency transformation

The denominator matrix

The templates

The second two-directional filter in Fig.9 (d), (e) is a particular case, being oriented along the two frequency axes (

### 5.2. Three-directional fan-type filters

In order to design a three-directional filter like the one depicted in Fig. 8 (b), we must start from an analog three-band selective filter, like the one with frequency response shown in Fig. 8 (c). For a three directional filter, the middle peak frequency can always be taken *s* will be in this case the sum of three elementary functions:

The frequency response of a filter of this kind with parameter values

Each of the three elementary terms in (38) corresponds to a pair of

The numerator

where

We see that

At the denominator, we denoted

This implies the fact that the transfer function

## 6. Directional IIR filters designed in polar coordinates

We approach here a particular class of 2D filters, namely filters whose frequency response is symmetric about the origin and has at the same time an angular periodicity. The contour plots of their frequency response, resulted as sections with planes parallel with the frequency plane, can be defined as closed curves which can be described in terms of a variable radius which is a periodic function of the current angle formed with one of the axes.

It can be described in polar coordinates by

### 6.1. Spectral transformation for filters designed in polar coordinates

The main issue approached here is to find the transfer function of the desired 2D filter

The proposed design method for these 2D filters is based on the frequency transformation:

which maps the real frequency axis

In (48) *radial compressing function*. In the frequency plane

If the radial function

plotted in Fig.11 (b) on the range

For filters with an even number of lobes, the radial function

In order to obtain a rational expression for the frequency response of the 2D filter from an elementary 1D prototype of the form (45) or (46) by applying the frequency mapping (52), we need to derive rational expressions for the functions

which are sufficiently accurate on the range

with

narrower range around zero of the interval

We will use here a Chebyshev low-pass second-order filter of the general form (15). For this type of filter we have the coefficient symmetry

The numerator results real because the imaginary part is cancelled. Substituting the expressions (55) into this complex frequency response we get the rational approximation:

which can be also written as:

The function (58) has even parity, since it is expressed as a rational function in

### 6.2. Two-directional filter design

We approach now the design of a particular filter type designed in polar coordinates, namely two-directional (selective four-lobe) filters along the two plane axes or with a specified orientation angle. Let us consider the radial function given by:

where

and is plotted for

and the function

Finally we derive a transfer function of the 2D filter *s* by

(63) |

The template

where

Let us design a two-directional filter following this procedure. As 1D prototype let us consider a type-2 low-pass Chebyshev digital filter with the parameter values: order*z* is:

For a good directional selectivity we also choose

Taking into account the fact that the first singular value of the templates A and B is much larger than the other four, the filter designed above can be approximated by a separable filter.

The singular value decomposition of a matrix M is written as

write for the filter templates A and B:

If *T* for transposition. Similarly for B we find

For the template A we get

We finally obtain a very selective two-directional 2D filter implemented with two minimum size (

and

The final filter templates result according to relations (64) and (65).

Regarding the proposed method, the frequency responses of this class of 2D filters can be viewed as derived through a radial distortion from a generic maximally-flat circular filter. Indeed, referring to (48), the circular filter is the trivial case for which

## 7. Zero-phase FIR circular filters

Filters with circular symmetry are very useful in image processing. We propose an efficient design technique for 2D circularly-symmetric filters, based on the previous 1D filters, considered as prototypes. Given a 1D prototype

The currently-used approximation of the circular function

which corresponds to the

Let us consider as prototype a LP analog elliptic filter of order *s* is:

Using MAPLE or another symbolic computation program and following the design steps described in section 2, we obtain a a polynomial approximation of the magnitude

(77) |

In order to obtain a filter with circular symmetry from the factorized 1D prototype function, we replace in (12)

where

obtained by bordering C with zeros. The above expressions correspond to the factors in (12).

The frequency response

Let us denote the vector above as

Here *M* singular values (in our case *k*-th columns of the matrices *T* for transposition.

Fig.14 shows the frequency response magnitudes of the designed circular filter approximated by taking into account the first largest 8 singular values and 5 singular values. It can be noticed that even retaining only the first 5 singular values, the 2D filter preserves its circular shape without large distortions. In this case the filter template B is approximated by *separable* matrices according to (79). This is an important aspect in the filter implementation.

## 8. Applications and simulation results

An example of image filtering with a two-directional filter is given. We use the filter shown in Fig.3(e), (f). This type of filter can be used in simultaneously detecting perpendicular lines from an image. The binary test image in Fig.15 (a) contains straight lines with different orientations and lengths, and a few curves. It is known that the spectrum of a straight line is oriented in the plane

Let us apply the designed fan-type filters, which can be regarded as components of a DFB, in filtering a typical retinal vascular image. Clinicians usually search in angiograms relevant features like number and position of vessels (arteries, capillaries). An angular-oriented filter bank may be used in analyzing angiography images by detecting vessels with a given orientation. Let us consider the retinal fluorescein angiogram from Fig.16(a), featuring some pathological elements which indicate a diabetic retinopathy. This image is filtered using 5 oriented wedge filters with narrow aperture (

As can be easily noticed, the vessels for which the frequency spectrum overlaps more or less with the filter characteristic remain visible, while the others are blurred, an effect of the directional low-pass filtering (Matei & Matei, 2012). The directional resolution depends on the filter angular selectivity given by

The designed zero-phase circularly-symmetric FIR filters may be useful as well in pre-processing tasks on biomedical images, having a blurring effect on the image which depends on its selectivity given by the circular filter bandwidth. The effect is somewhat similar to the Gaussian smoothing, which is used as a pre-processing stage in computer vision tasks to enhance image structures at different scales. Applying the presented design procedure, a circularly-symmetric filter bank can be derived, with components having desired bandwidths. Let us consider another retinal fluorescein angiogram, displayed in Fig.17(a). In the simulation result shown in Fig.17 (b) and (c), the two circular filters introduce gradual blurring which is visible on the fine image details, like small vessels and capillaries. In the image in Fig.17 (c) all the finer details have been almost completely smoothed out.

## 9. Conclusion

The design methods presented in this chapter combine the analytical approach based on 1D prototype filters and frequency transformations with numerical optimization techniques. For the classes of 2D filters designed here, we have used mainly analog filters as prototypes, which turn out to make simpler the expressions of the derived frequency mappings, and therefore the complexity of the designed 2D filters is lower in the analyzed cases. The prototypes used here were both maximally-flat or very selective, either low-pass or band-pass. For each type of 2D filter, a particular spectral transformation is derived. An important advantage is that these spectral transformations include some parameters which depend on the 2D filter specifications, like bandwidth, orientation, aperture etc. Once found the specific frequency mapping, the 2D filter results from its factorized prototype function by a simple substitution in each factor. The designed filters are versatile in the sense that the prototype parameters (bandwidth, selectivity) can be adjusted and the 2D filter will inherit these properties.

An advantage of the analytical approach over the completely numerical optimization techniques is the possibility to control the 2D filter parameters by adjusting the prototype. Another novelty is the proposed analytical design method in polar coordinates, which can yield selective two-directional and even multi-directional filters, and also fan and diamond filters. In polar coordinates more general filters with a specified rotation angle can be synthesized.

The design methods approached here are rather simple, efficient and flexible, since by starting from different specifications, the matrices of a new 2D filter result directly by applying the determined frequency mapping, and there is no need to resume every time the whole design procedure.

Stability of the designed filters is also an important problem and will be studied in detail in future work on this topic. In principle the spectral transformations used preserve the stability of the 1D prototype. The derived 2D filter could become unstable only if the numerical approximations introduce large errors. In this case the precision of approximation has to be increased by considering higher order terms, which would increase in turn the filter complexity; however, this is the price paid for obtaining efficient and stable 2D filters. Further research will focus on an efficient implementation of the designed filters and also on their applications in real-life image processing.