This project use slic superpixels as basis for two principle component analysis algorithms: Eigenfaces and Fisherfaces.
Below is the hierarchy for the repository. Files start with underscores are modified library's files, while those with double underscores are the two main project's files:
├── CMakeFiles.txt
├── __eigen.cpp
├── __eigen.hpp
├── __eigenHelpers.cpp
├── __slic.cpp
├── __view.cpp
├── _eigenframes.cpp
├── _framerec.hpp
├── _private.hpp
├── _slicAlgorithm.cpp
├── _slicAlgorithm.hpp
├── slicPrecomp.hpp
├── eigenframes.cpp
├── eiten
├── eigenfaces.cpp
├── createCsv.py
├── images.csv
├── build
│ ├── slic
│ ├── eigen
│ ├── ...
├── data
│ ├── file1.csv
│ ├── file2.csv
│ ├── ...
├── images
│ ├── person1
│ │ ├── image1
│ │ ├── image2
│ │ ├── ...
│ ├── person2
│ │ ├── image1
│ │ ├── image2
│ │ ├── ...
│ ├── ...
├── results
│ ├── superpixels_image1
│ ├── superpixels_image2
│ ├── ...
├── readme.md
Assuming that images are located in the images directory, and hierarchy is as above; you can run the project by executing the following:
cd build
cmake ..
make
./slic
Above runs SlicO, and below runds Slic
./slic -a=0
The output will be saved into data directory, as csv files.
To run the PCA part afterward on the generated csv files, you can execute the following:
./eigen
Or for a specific face test:
./eigen -test=285
If images.csv
needed to be edited, run the python command from build directory, to ensure that the hierarchy structre is the same.
Example:
python ../create_csv.py ../images
Here is the link for the AT&T face database.