thresh                package:EBImage                R Documentation

_A_d_a_p_t_i_v_e _t_h_r_e_s_h_o_l_d_i_n_g

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

     Thresholds an image using a moving rectangular window.

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

       thresh(x, w=5, h=5, offset=0.01)

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

       x: An 'Image' object or an array.

    w, h: Width and height of the moving rectangular window.

  offset: Thresholding offset from the averaged value.

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

     This function returns the binary image resulting from the
     comparison between an image and its filtered version with a
     rectangular window. It is equivalent of doing '{f = matrix(1,
     nc=2*w+1, nr=2*h+1) ; f=f/sum(f) ; x>(filter2(x, f)+offset)}'  but
     slightly faster. The function 'filter2' provides hence more 
     flexbility than 'thresh'.

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

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

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

     Oleg Sklyar, osklyar@ebi.ac.uk,  2005-2007

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

     'filter2'

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

       x = readImage(system.file('images', 'nuclei.tif', package='EBImage'))
       if (interactive()) display(x)
       y = thresh(x, 10, 10, 0.05)
       if (interactive()) display(y)

