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')

