perClass Documentation
version 5.4 (7-Dec-2018)
SDEXTRACT Extract features from images, objects or spectra

    OUT=SDEXTRACT(DATA,DOMAIN,FEATNAME,options)

 INPUT
    DATA     Input image or SDDATA set
    DOMAIN   String describing where we extract from
     'region'  - extract local image features from a sliding window
     'object'  - extract one feature vector per object (e.g. connected component)
     'color'   - color space transformation
     'band'    - extract features for bands in spectra (band is a group of wavelengths)
    FEATNAME String defining feature name or function handle for custom extractor

 OUTPUT
    OUT      SDDATA set with extracted features

 DESCRIPTION
 Extracts features from input image DATA. DOMAIN type and FEATNAME are
 required.

 REGION DOMAIN: Local image features in a sliding window
  'block',bs   Block size (default: 8 pixels)
  'step',s     Grid step size, (default: 1)
  'mask',M     Foreground mask, where the features get computed. (matrix of the same size
               as input image)
  'pixels',P   Represent only on these pixels by regions. P is a vector of lin.indices
 REGION FEATURES: Computed on a single image band
 'raw' - return raw pixel values unrolled into a feature vector
 'moments' - mean and variance in a region (default)
 'hist' - local histogram
   'range',[min,max] - Required vector with data range.Data out-of-range is discarded.
   'bins',b - Number of histogram bins (def: 8)
 'histfeat' - 5 features computed on the local histogram
   'range',[min,max] - Required vector with data range.Data out-of-range is discarded.
   'bins',b - Number of histogram bins (def: 8)
 'orihist' - histogram of local orientations (requires single feature in DATA)
   'bins',b - Number of bins (def: 8)
 'CM' - cooccurrence matrix
   'bins' - number of bins used to subsample original data (def:8)
             - data set contains cm_bins^2 output features
   'displ' - pixel displacement in vertical direction (def:1);
   'range',[min,max] - Required vector with data range.Data out-of-range is discarded.
 'Gauss' - Gaussian filter or derivative
   'sigma',S - smoothing (def: 2)
   'der',D   - derivative (def: 0, possibe to use vector 'der',[derx dery])
 'Sobel' - Sobel operator (magnitude + orientation) in 3x3 window
   sobel.x or sobel.y for directional outputs
   sobel.mag only for magnitude
 'fbank:LM' - Leung-Malik filter bank (48 multi-ori.,multi-scale), details in sdfilter
 'fbank:S' - Schmid (13 rotationally-invariant filters)
 'fbank:MR8' - Max.response filters combining multiple orientation (8 features)
 'fbank:MR4' - Max.response filters combining multiple orientation and scales (4 features)
 'fbank' - User-defined filter bank (requires definition of kernel 3D matrix K using 'kernel option.)
   'kernel',K  - 3D matrix (block size x block size x filter count) with user kernel coeficients
   'join',J - option to join multiple filters with max operation (J is a vector with one
              entry per filter). It contains one-based labels of final filters.
              (i.e. 'join',[1 1 1 2 2] says that from 5 filters in K, first three will be joined
              into 1st output and last two into second output)
 'erosion','dilation' - perform gray-level morphology erosion or dilation
 'edges' - gray-level morphology edge detection
 'opening','closing' - gray-level morhology opening and closing operation

 OBJECT DOMAIN: Extract one feature vector per object (defined by DATA.object labels)
 FEATURES that do not use spatial info (any DATA with object labels)
 'size' - size of an object (number of pixels)
 'sum'  - sum of per-object values (for all features in DATA)
 'mean' - mean of per-object values (for all features in DATA)
 'hist' - histogram of per-object values (requires single feature in DATA)
   'range',[min,max] - Required vector with data range. Data out-of-range is discarded.
   'bins',b - Number of histogram bins (def: 8)
 'orihist' - histogram of local orientations (requires single feature in DATA)
   'bins',b - Number of bins (def: 8)
 'class fractions',LAB - fraction of each class in LAB labels (LAB typically represents
            decisions of a pixel classifier. LAB must have same length as DATA
 'shape' - Hu moment invariants and shape eigenvalues from binary object mask
 'gray shape' - Hu moment invariants and shape eigenvalues from object content (single band)
 'resize',spec - resize each object into a fixed-size matrix with nearest neighbor alg.
   'background',VAL - fill VAL into background pixels (may be a vector with value per band)

 COLOR domain : sample is a pixel in color image, convert color space
  'rgb2hsv' - convert RGB values (doubles in 0..255 range) to HSV

 BAND domain : sample is a spectrum, features are extracted from bands (groups of wavelengths)
 FEATURES:
 'mean' - extract a mean value for each band
 'LDA' - extract features using Fisher criterion (maximizes separability)
 OPTIONS defining bands:
  'bands',B - manually define bands by indices in a cell array (e.g. 'bands',{10:20 50:60} )
  'cluster',N - cluster spectral domain using k-means asking for N clusters
  'size',S
  'step',ST - define sequence of bands by size and step

 EXAMPLES
  data=sdextract(im,'region','hist','block',8,'step',2,'bins',16)
 Calling custom feature extractor:
  data=sdextract(im,'region',@custom_extract_hist,'block',16)
 Passing parameters to custom feature extractor:
  data=sdextract(im,'region',@custom_extract_hist,{'bins',16,'min',0,'max',1},'block',16)


 READ MORE
http://perclass.com/doc/guide/feature_extraction.html

 SEE ALSO
 SDIMAGE, CUSTOM_EXTRACT_HIST, SDFILTER

sdextract is referenced in examples: