=================================================================
% The matlab code corresponding to image classification of the 
% algorithm proposed in
%
% Peihua Li, Xiaoxiao Lu, Qilong Wang, "From Dictionary of Visual 
% Words to Subspaces: Locality-constrained Affine Subspace 
% Coding", CVPR 2015.
%
% written by 
% Xiaoxiao Lu (Email: shaw@mail.dlut.edu.cn) and
% Qilong Wang  (Email:  wangqilong.415@163.com) and 
% Peihua Li (Email: peihuali at dlut dot edu dot cn) 
=================================================================

- To run 'Demo_LASC_voc07.m' for evaluating classification performance on PASCAL VOC 2007 dataset. The code is written based on the released toolbox of VLFeat. 

- We also provide 'Demo_LASC_birds.m' for birds dataset. 
[http://www-cvr.ai.uiuc.edu/ponce_grp/data/] Birds is much smaller(in total of 600 images) than VOC07, so it is a more convenient choice to run and analyze our code. The result is not included in our paper, the purpose to provide this demo code is only for implement convenience.

- The demo code is tested on a PC with 4 cores and 32G RAM, Matlab R2013a. If your computer's RAM is less than 32G(e.g. 8G or 16G), we suggest you use less cores to test our demo code.

- The floder 'data' saves the files generated in the coding progress and the image datasets. 

- ImageSet path is: 
  1.PASCAL VOC2007: data/voc07/VOCdevkit/VOC2007/JPEGImages
  2.Birds: data/birds/
Please download the dataset first.

- trainEncoder: train the codebook and affine subspaces.
- encodeImage: encode features and pooling.
 
If you use this code in your work, please cite the paper:
@InProceedings{LASC_CVPR15,
  author       = {Peihua Li and Xiaoxiao Lu and Qilong Wang},
  title        = {From Dictionary of Visual Words to Subspaces: Locality-constrained Affine Subspace Coding},
  booktitle    = {In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
  year         = {2015}
}

The software is provided ''as is'' and without warranty of any kind, express, implied or otherwise, including without imitation, any warranty of merchantability or fitness for a particular purpose.

