function A = features(I)
%FEATURES Calculation of postal image block classification features.
%   A = FEATURES(I) calculates six features to enable classification of I. 
%   The six featurs are as follows: 
%
%   A.mu     = mean value of pixel intensities
%   A.sigma  = standard deviation of pixel intensities
%   A.alpha  = count of active pixels
%   A.Dx     = sum of second derivative magnitudes in the x direction
%   A.Dy     = sum of second derivative magnitudes in the y direction
%   A.gc     = sum of cardinal gradient vector magnitudes
%
%   I is the matrix of pixel values of a grayscale image block.  
%
%   See also CLASSIFY64, ACTIVEPIXELS, DXDY, GRADDIR

%   Author(s): K. R. Varshney
%   School of Electrical and Computer Engineering, Cornell University
%   $Date: 2002/08/15 $

%calculate mean, standard deviation, and active pixels
[A.mu A.sigma A.alpha] = activepixels(I,1.8);

%calculate Dx and Dy for polynomial order 2 and frame length 5
[A.Dx A.Dy] = DxDy(I);

%calculate weighted gradient vector in four cardinal directions
A.gc = graddir(I);
