moments               package:EBImage               R Documentation

_I_m_a_g_e _m_o_m_e_n_t_s _a_n_d _m_o_m_e_n_t _i_n_v_a_r_i_a_n_t_s, _f_e_a_t_u_r_e _e_x_t_r_a_c_t_i_o_n

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

     A set of functions to compute central, scale and rotation
     invariant moments as well as to estimate object rotation angles
     and elongations based on  central moments.

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

       ## S4 methods for signatures 'x=IndexedImage,ref=Image'
       ## and 'x=IndexedImage,ref=missing'
       cmoments(x, ref, ...)

       ## S4 method for signature 'IndexedImage, Image':
       smoments(x, ref, pw=3, what="s", ...)
       ## S4 method for signature 'IndexedImage, missing':
       smoments(x, ref, pw=3, what="s", ...)

       ## S4 methods for signatures 'x=IndexedImage,ref=Image'
       ## and 'x=IndexedImage,ref=missing'
       rmoments(x, ref, ...)

       ## S4 methods for signatures 'x=IndexedImage,ref=Image'
       ## and 'x=IndexedImage,ref=missing'
       ## and 'x=Image,ref=missing'
       moments(x, ref, ...)
       

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

       x: An object of 'Image'; a 'Grayscale' object of 'Image' in the
          last case.

     ref: A 'Grayscale' object of 'Image'.

      pw: A numeric value. When calculating central os scale invariant 
          moments using 'smoments' 'pw' specifies the order of the 
          matrix of moments to calculate. 

    what: A character string, or the first case insensitive letter, 
          for the type of the moments to calculate: 'C'entral, 'S'cale
          invariants, or 'R'otation invariants (specifying 'R' is
          essentiall the same as calling 'rmoments'. 

     ...: Reserved. 

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

     'cmoments' computes centers of the objects ('x=M10/M00, 
     y=M01/M00'), their "mass" (intensity, 'int=M00') and the area
     (number of  non-background pixels).

     'smoments' computes for each object in an image a square matrix of
     order  'pw' of either central moments ('mu[i,j]') or scale
     invariant moments  ('nabla[i,j]') depending on the parameter
     'what'.

     'rmoments' computes for each object the Hu's set of 7 rotation
     invariants.

     'moments' computes for each object a summary of interesting
     moments and derived descriprots that include mass (total
     intensity), location, elements of the covariance matrix and its
     eigenvalues, rotation angle and the Hu's 7  rotation invariants.

     Functions with signature 'x=IndexedImage' work on images with
     multiple indexed objects in every frame. The index information is
     used to identify every object and serves as a mask resetting for
     every object pixels outside of the mask to background. The
     intensity is retrieved from the corresponding reference image. If
     it is not supplied, the intensity is set to 1 at each pixel of an 
     object.

     'moments' with 'x='Image'' expect input image to contain one and
     only one object in each frame (such as those obtained by
     'stackObjects').

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

     For 'x=IndexedImage':

     For a single frame in 'x' the result of 'smoments' with types 'S'
     and 'C' is a 3D array with first two dimensions building square
     matrices of size 'pw'*'pw' and the third dimension corresponds to
     the number of indexed objects in the frame. All other functions
     return 2D matrices with different moments or descriptors in
     columns and objects in rows.

     For multiple frames a list of the above will be returned.

     For 'x=Image':

     The result is a 2D matrix of with different moments or descriptors
     in  columns and objects in rows. (each frame is assumed to contain
     a single object).

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

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

_R_e_f_e_r_e_n_c_e_s:

     M.K. Hu, _Visual Pattern Recognition by Moment Invariants_, IRE
     Trans. Info. Theory, vol. IT-8, pp.179-187, 1962

     _Image moments_: <URL: http://en.wikipedia.org/wiki/Image_moments>

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

     ' IndexedImage, watershed, getFeatures '

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

       ## see example(getFeatures)

