floodFill              package:EBImage              R Documentation

_R_e_g_i_o_n _f_i_l_l_i_n_g

_D_e_s_c_r_i_p_t_i_o_n:

     Fill regions in images.

_U_s_a_g_e:

       floodFill(x, pt, col, tolerance=0)

_A_r_g_u_m_e_n_t_s:

       x: An 'Image' object or an array.

      pt: Coordinates of the start filling point.

     col: Fill color. This argument should be a numeric for Grayscale
          images and an R color for Color images.

tolerance: Color tolerance used during the fill.

_D_e_t_a_i_l_s:

     Flood fill is performed using the fast scan line algorithm.
     Filling starts at 'pt' and grows in connected areas where the
     absolute difference of the pixels intensities (or colors) remains
     below 'tolerance'.

_V_a_l_u_e:

     An 'Image' object or an array, containing the transformed version
     of 'x'.

_A_u_t_h_o_r(_s):

     Gregoire Pau, Oleg Sklyar; 2007

_E_x_a_m_p_l_e_s:

       x = readImage(system.file("images", "shapes.png", package="EBImage"))
       y = floodFill(x, c(67, 146), 0.5)
       if (interactive()) display(y)

       y = channel(y, 'rgb')
       y = floodFill(y, c(48, 78), 'red')
       y = floodFill(y, c(156, 52), 'orange')        
       if (interactive()) display(y)

       x = readImage(system.file("images", "lena.gif", package="EBImage"))
       y = floodFill(x, c(226, 121), 1, tolerance=0.1)
       if (interactive()) display(y)

