Visitor menu

Feature Extraction
Feature extraction in images with Matlab (cached)
refresh

Prediction algorithms and classifiers such as Genetic Programming can recognize elements in images. To make this task easier, we can extract relevant features from the image before the classifier analyse the data. Theses features, computed from the pixel values of the object of interest, are a representation of the shape, color or texture of the object.

Please note that complete feature extraction, with morphological information, can only be obtained if the object was properly segmented. I did not study segmentation algorithms for my work, prefering to use simple situations where the background can easily be identified. For my research, I used this script to segment objects in images.

I have programmed feature extraction functions for my master thesis project. As a reference and to help programmers or researchers that would like to do the same, the code is available here for download.

Quick information on the folders and files:

NameComment
createStdArffFile.mcreate a arff file and write the header in prevision of the extraction of feature in RGB images
appendToStdArffFile.mappend data using the RGB header to an already created arff file
createStdGrayArffFile.mcreate a arff file and write the header in prevision of the extraction of feature in Grayscale images
appendToStdGrayArffFile.mappend data using the Grayscale header to an already created arff file
createUnStdArffFile.mcreate a arff file and write the header in prevision of the extraction of feature in RGB without segmentation
appendToUnStdArffFile.mappend data using the RGB no-segmentation header to an already created arff file
getStats.mextracts the feature of an image. can work without segmentation
Local Binary Pattern (folder)contains everything to extract the LBP of an image (download the original code at this website), used by getStats.
Fourier Transform Analysis (folder)to obtain features from the Fourier transform, used by getStats
createDataOneClass.mextract data with getStats for all images (jpg or bmp) of a folder
createDataOneClassNoSeg.msame thing than the preceding function, but without segmentation

To make the extraction process automatic, all images from one class must be in the same folder (so we need minimally one folder per class). We can then use createDataOneClass.m on this folder to extract features from all the images at once. We append the data to an already created arff file afterwards.

To know more about the arff file format, click here.
If you have questions or comments about feature extraction with Matlab, please contact me.

Created by: Yan last modification: Thursday 08 of May, 2008[18:14:55 UTC] by Yan