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)

