Introduction to Image Processing Using R Learning by Examples

This book introduces the statistical software R to the image processing community in an intuitive and practical manner. R brings interesting statistical and graphical tools which are important and necessary for image processing techniques. Furthermore, it

  • PDF / 953,004 Bytes
  • 17 Pages / 439.37 x 666.142 pts Page_size
  • 98 Downloads / 291 Views

DOWNLOAD

REPORT


Filters in the Image Domain

Filtro de Amor: 20 vellos tuyos, 3 gramos de polvo de tus uñas, o tres gotas de tu sangre (imprescindible; es la clave del filtro de amor, sirve para que el efecto de amor del filtro vaya dirigido hacia ti). http:// www.tarot-amor-gratis.com/ filtro_amor.htm

In this chapter we will see how to build filters defined on the image domain. They all share the property of being functions of values around the pixel being processed, so we will not consider approaches based on transformations as, for instance, Fourier or Wavelet domain. Albeit limited, this approach will allow the user to build and experiment with image filters. A more model-based approach can be found in the book by Velho et al. (2008). Other important references are the works by Barrett and Myers (2004); Jain (1989); Lim (1989); Lira Chávez (2010); Gonzalez and Woods (1992); Myler and Weeks (1993); Russ (1998) among many others. The reader is invited to recall the definitions of local operations, neighborhood and mask presented in Chap. 1 (p. x and 6). All the filters we consider will be defined on a mask: if f is the input image, then g = Υ M ( f ) is the result of applying the filter Υ with respect to the mask M to f . Each element of g is a function of the values observed in f locally with respect to the mask M and the values it conveys. For the sake of simplicity, all considered masks will be of the form presented in Eq. (2.3):   − 1  + 1   − 1  + 1 , × − , , M= − 2 2 2 2 i.e., masks are squared sets of coordinates of (odd) side . Oftentimes, we will need to define values in each mask coordinate, i.e., we will work with matrices of the form (m i, j )(−1)/2≤i, j≤(+1)/2 . The term “mask” and the notation M will be employed for both the support and the values. For the sake of simplicity, in all the theoretical descriptions we will assume that the input and output images are defined on the infinite support S = Z2 . When implementing the filters, the finite nature of the images needs to be taken into account. This can be done in at least two ways, namely, modifying the mask whenever needed A. C. Frery and T. Perciano, Introduction to Image Processing Using R, SpringerBriefs in Computer Science, DOI: 10.1007/978-1-4471-4950-7_5, © Alejandro C. Frery 2013

59

60

5 Filters in the Image Domain

(close to the edges of the original image), or applying the transformation only to those coordinates where the mask fits in. The latter will be used in our examples, as illustrated in the following code that will be common to all filters here discussed. Listing 5.1 presents the general convolution filter. It takes two arguments as input, the image to be filtered and the mask. The first operations consist in discovering the number of lines and columns of the original image (lines 6 and 7, respectively), and the side of the mask (line 8). Line 10 creates the container for the output image g by copying the input image f; g is created with the dimensions, type, and additional attributes f has. Listing  5.1 Convolution filter 1

C

Data Loading...