morphology              package:EBImage              R Documentation

_P_e_r_f_o_r_m _m_o_r_p_h_o_l_o_g_i_c_a_l _o_p_e_r_a_t_i_o_n_s _o_n _i_m_a_g_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Functions to perform morphological operations on binary images.

_U_s_a_g_e:

       dilate(x, kern, iter)
       erode(x, kern, iter)
       opening(x, kern, iter)
       closing(x, kern, iter)

       makeBrush(size, shape=c('box', 'disc', 'diamond'), step=TRUE)

_A_r_g_u_m_e_n_t_s:

       x: An 'Image' object or an array. 'x' is considered as a binary
          image, whose pixels of value 0 are considered as background
          ones and other pixels as foreground ones.

    kern: An 'Image' object or an array, containing the structuring
          element. 'kern' is considered as a binary image, whose pixels
          of value 0 are considered as background ones and other pixels
          as foreground ones.

    size: A numeric containing the size of the brush, in pixels.

   shape: A character vector indicating the shape of the brush. Can be
          'box', 'disc' or 'diamond'. Default is 'box'.

    step: a logical indicating if the brush is binary. Default is
          'TRUE'.

    iter: Deprecated argument.

_D_e_t_a_i_l_s:

     'erode' applies the mask positioning its centre over every
     background pixel (0), every pixel which is not covered by the mask
     is reset to foreground (1). In this way image features grow in
     size.

     'dilate' applies the mask positioning its centre over every
     foreground pixel (!=0), every pixel which is not covered by the
     mask is reset to background (0). In this way image features seem
     shrink in size.

     'opening' is an erosion followed by a dilation and 'closing' is a
     dilation followed by an erosion.

     'makeBrush' generates brushes of various sizes and shapes that can
     be used as structuring elements.

_V_a_l_u_e:

     'dilate', 'erode', 'opening' and 'closing' return the transformed
     'Image' object or array,  after the corresponding morphological
     operation.

     'makeBrush' generates a 2D matrix containing the desired brush.

_A_u_t_h_o_r(_s):

     Oleg Sklyar, osklyar@ebi.ac.uk, 2006

_E_x_a_m_p_l_e_s:

           
         x = readImage(system.file("images", "shapes.png", package="EBImage"))
         if (interactive()) display(x)
         kern = makeBrush(5, shape='diamond')
         if (interactive()) display(kern, title='Structuring element')
         if (interactive()) display(erode(x, kern), title='Erosion of x')
         if (interactive()) display(dilate(x, kern), title='Dilatation of x')

         ## makeBrush 
         x = makeBrush(100, shape='diamond')
         if (interactive()) display(x, title="makeBrush(100, shape='diamond')")
         x = makeBrush(100, shape='disc', step=FALSE)
         if (interactive()) display(x, title="makeBrush(100, shape='disc', step=FALSE)")

