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

_D_e_s_c_r_i_p_t_i_o_n:

     Computes the distance map transform of a binary image. The
     distance map is a matrix which contains for each pixel the
     distance to its nearest background pixel.

_U_s_a_g_e:

       distmap(x, metric=c('euclidean', 'manhattan'))

_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.

  metric: A character indicating which metric to use, L1 distance
          ('manhattan')  or L2 distance ('euclidean'). Default is
          'euclidean'.

_D_e_t_a_i_l_s:

     A fast algorithm of complexity O(M*N*log(max(M,N))), where (M,N)
     are the dimensions of 'x', is used to compute the distance map.

_V_a_l_u_e:

     An 'Image' object or an array, with pixels containing the
     distances to the nearest background points.

_A_u_t_h_o_r(_s):

     Gregoire Pau, gpau@ebi.ac.uk, 2008

_R_e_f_e_r_e_n_c_e_s:

     M. N. Kolountzakis, K. N. Kutulakos. Fast Computation of the
     Euclidean Distance Map for Binary Images, Infor. Proc. Letters 43
     (1992).

_E_x_a_m_p_l_e_s:

        x = readImage(system.file("images", "shapes.png", package="EBImage"))
        if (interactive()) display(x)
        dx = distmap(x)
        if (interactive()) display(dx/10, title='Distance map of x')

