distmap               package:EBImage               R Documentation

_D_i_s_t_a_n_c_e _m_a_p _t_r_a_n_s_f_o_r_m _o_f _b_i_n_a_r_y _i_m_a_g_e_s

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

     The function performs a distance map transform of binary images.
     In a distance map each pixel contains the distance from that pixel
     to the nearest background point.

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

       ## S4 method for signature 'Image':
       distmap(x, t=0.05, exact=FALSE, bg=0.05, ...)

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

       x: A 'Grayscale' object of 'Image'. 'x' is considered as a
          binary image, consisting of 0's for background and all other
          values for foreground. 

       t: A numeric value for the background threshold in the range 
          '[0,1)'. Pixels with intensity smaller than 't' are
          considered  as background. 

      bg: A numeric value for the allowed minimum for the fraction of 
          background pixels in the image. The default and recommended
          value  corresponds to 5% (0.05). See details for more
          information. 

   exact: A logical value if the distance to the neighboring diagonal
          elements should be calculated exactly, as 'sqrt(2)', or it
          should be set to 1, same as that for the neighbouring pixels
          on the vertical and  horizontal axes. 

     ...: Reserved. 

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

     Given a binary or gray scale image with background set to 0, a
     distance map  transform generates an image each pixel of which
     contains the distance from that pixel to the nearest background
     pixel (zero) or the edge of the image. 

     If foreground constitutes more than 95% of the image, computation
     of a distance  map can be very lengthy as the function uses an
     iterative algorithm. This is a  very rare situation anyway and the
     value of 'bg' provides a protection  mechanism, e.g. in case a
     very noise image is supplied performing a threshold  first.

     This function is used extensively in object detection. Distance
     map is a standard  input for the 'watershed' algorithm used to
     identify and separate  closely positioned objects.

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

     A 'Grayscale' object of 'Image' with pixels containing the 'floor'
     values of their distances to the nearest  background points. The
     range of the resulting image is '[0,n]', where 'n', a positive
     integer, will be the distance from center of the largest  object.

     To preview the results visually, use 'display(normalize(result))'.

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

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

_S_e_e _A_l_s_o:

     ' Image, watershed, thresh, propagate '

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

       ## Not run: see ?watershed for an example

