"Copyright 1994 by the Massachusetts Institute of Technology. All rights reserved. Developed by Baback Moghaddam and Alex Pentland at the Media Laboratory, MIT, Cambridge, Massachusetts, with support from BT and Arbitron. For use by the MIT AI Lab. This distribution is approved by Nicholas Negroponte, Director of the Media Laboratory, MIT. Permission to use, copy, or modify this software and its documentation for educational and research purposes only and without fee is hereby granted, provided that this copyright notice and the original authors' names appear on all copies and supporting documentation. If individual files are separated from this distribution directory structure, this copyright notice must be included. For any other uses of this software, in original or modified form, including but not limited to distribution in whole or in part, specific prior permission must be obtained from MIT. These programs shall not be used, rewritten, or adapted as the basis of a commercial software or hardware product without first obtaining appropriate licenses from MIT. MIT. makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. There are 4 MATLAB files in this directory: klt.m performs the discrete KL transform on a set of vectors project.m does the projection on the resulting eigenspace, computes the "distance-from-feature-space" and the reconstruction. dffs_map.m computes the "distance-from-feature-space" at every pixel over in input image read_uchars.m utility for reading in a set of images into a matrix These files have MATLAB help files built in, so you can type (for example) >> help klt inside MATLAB for help on their syntax and function. --Baback (baback@media.mit.edu) ---------------------------------------------------------------------- Step 1: Take your set of training images and put them in a directory. The files should be unsigned char (8 bits/pixel) in standard raster format (with NO headers, just raw pixel dumps). Most importantly, they should be labeled data0, data1, data2 .... dataN Step 2: From inside matlab use read_uchars() to read them into a matrix, where each column is the vectorized image (column-concatenated). The arguments to read_uchars are the directory dir, an index vector n that indicates which (possibly a subset) of the data you wanna read in, and a 1-by-2 vector Size of the dimensions of the image. Type help read_uchars in Matlab for more info. Eg. Lets say you have 50 images of size 640-by-480 in the directory Test to read all the even ones into a matrix in Matlab you issue the command. >> X = read_uchars('Test',0:2:48,[640 480]); Step 3: Next you compute the principal components using the following command (type "help klt" in matlab for more detailed info): >> [U,Xm] = klt(X); Step 4: To project this (or another matrix of images) onto, say the first 10 eigenvectors, use project() >> C = project(X,Xm,U,1:10); C is now a matrix of coefficients, where each column is the expansion coefficients of the corresponding image in X Step 5: To compute the "distance-from-feature-space" metric for a set of images X, use project.m with the second output argument: >> [C,D] = project(X,Xm,U,1:10); To compute the DFFS metric at every pixel in an input image, use the function dffs_map.m