haralickMatrix            package:EBImage            R Documentation

_C_o-_o_c_c_u_r_r_e_n_c_e _m_a_t_r_i_c_e_s (_G_L_C_M) _a_n_d _H_a_r_a_l_i_c_k _t_e_x_t_u_r_e _f_e_a_t_u_r_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Computes the gray level co-occurrence matrix (GLCM, frequency of
     pixel intensities given the mean intensity of their 4 neighbouring
     pixels) and corresponding Haralick features from image objects.

_U_s_a_g_e:

       haralickFeatures(x, ref, nc = 32)
       haralickMatrix(x, ref, nc = 32)

_A_r_g_u_m_e_n_t_s:

       x: An 'Image' object or an array containing object masks. Object
          masks are sets of pixels with the same unique integer value.

     ref: An 'Image' object or an array, containing the intensity
          values of the objects.

      nc: A numeric value. Specifies the number of gray levels used to
          compute the co-occurrence matrix. Default value is 32.

_D_e_t_a_i_l_s:

     'haralickFeatures' computes the following set of statistics on the
     GLCM matrix:


   '_h._a_s_m' Angular second moment: 'sum[i=1^nc] sum[j=1^nc]p(i,j)^2'.

   '_h._c_o_n' Contrast: 'sum[i=2^(2*nc)] n^2 * sum[i=1^nc] sum[j=1^nc]
        p(i,j), for all i,j s.t ABS(i - j) = n'.

   '_h._c_o_r' Correlation: 'sum[i=1^nc] sum[j=1^nc]((i * j) * p(i,j) -
        mu_x * mu_y) / sigma_x * sigma_y'.

   '_h._v_a_r' Variance: 'sum[i=1^nc] sum[j=1^nc](i - mu)^2. * p(i,j)'.

   '_h._i_d_m' Inverse difference moment: 'sum[i=1^nc] sum[j=1^nc] p(i,j) /
        (1 + (i - j)^2) '.

   '_h._s_a_v' Sum average: 'sum[i=2^(2*nc)] i * Px+y(i)'.

   '_h._s_v_a' Sum variance: 'sum[i=2^(2*nc)] (i - sen)^2 * Px+y(i)'.

   '_h._s_e_n' Sum entropy: '-sum[i=2^(2*nc)] Px+y(i) * log(p(i,j))'.

   '_h._e_n_t' Entropy: '-sum[i=1^nc] sum[j=1^nc] p(i,j) * log( p(i,j) )'.

   '_h._d_v_a' Difference variance: 'sum[i=0^(nc-1)] (i^2) * Px-y(i)'.

   '_h._d_e_n' Difference entropy: 'sum[i=0^(nc-1)] Px-y(i) * log(
        Px-y(i,j) )'.

   '_h._f_1_2' Measure of correlation: 'abs(ent - HXY1) / HX'.

   '_h._f_1_3' Measure of correlation: 'sqrt( 1 - exp(2*(ent - HXY2)))'.

     where:

   '_p' is the GLCM matrix.

   '_P_x(_i)' Marginal frequency. Defined by 'Px(i) = sum[j=1^nc] p(i,j)'.

   '_P_y(_j)' Marginal frequency. Defined by 'Py(j) = sum[i=1^nc] p(i,j)'.

   '_m_u__x, _m_u__y' Means of 'Px' and 'Px'.

   '_s_i_g_m_a__x, _s_i_g_m_a__y' Standard deviations of 'Px' and 'Py'.

   '_P_x+_y' Probability of the co-occurrence matrix coordinates sums to
        'x+y'. Defined by 'Px+y(k) = sum[i=1^nc] sum[j=1^nc] p(i,j), i
        + j = k and k = 2,3,...,2*nc'.

   '_P_x-_y' Probability of the absolute value of the difference between
        co-occurrence matrix cooordinates being equal to 'x-y'. Defined
        by 'Px-y(k) = sum[i=1^nc] sum[j=1^nc] p(i,j), abs(i - j) = k
        and k = 2,3,...,2*nc'.

   '_H_X_Y_1' '-sum[i=1^nc] sum[j=1^nc] p(i,j) * log( Px(i),Py(j))'.

   '_H_X_Y_2' '-sum[i=1^nc] sum[j=1^nc] Px(i)*Py(j) * log( Px(i),Py(j))'.

     Computed Haralick features are rotational invariant and good
     descriptors of object textures.

_V_a_l_u_e:

     'haralickFeatures' returns a matrix (or a list of matrices if 'x'
     contains multiple frames) of features computed of the objects
     present in 'x' and using the intensity values of 'ref'.

     'haralickMatrix' returns an array (or a list of arrays if 'x'
     contains multiple frames) of dimension 'nc*nc*nobj', where 'nobj'
     is the number of objects  in 'x', containing the GLCM values of
     image objects.

_A_u_t_h_o_r(_s):

     Mike Smith, msmith@ebi.ac.uk; Oleg Sklyar, osklyar@ebi.ac.uk, 2007

_R_e_f_e_r_e_n_c_e_s:

     R. M. Haralick, K Shanmugam and Its'Hak Deinstein (1979).
     _Textural Features for Image  Classification_. IEEE Transactions
     on Systems, Man and Cybernetics.

_S_e_e _A_l_s_o:

     'getFeatures', 'zernikeMoments'

_E_x_a_m_p_l_e_s:

       example(getFeatures)

