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)

