Clone wiki

PsycoSuperRes / Home

Welcome to PSyCoSuperRes

This repository contains the source codes of a re-implementation of the PSyCo transform and its application to Super Resolution, both of them presented in CVPR 2016 [PerezPellitero et al. 2016]. This code has been extracted from a bigger, ongoing project related with a journal publication that will be also included in the release in the upcoming months.

This code consists on:

  • C++ class Psyco (defining the PSyCo transform method) with parallel support
  • C++ class PsycoSuperRes (defining the SR regression that makes use of class PSyCo) with parallel support
  • MATLAB class interfaces to the underlying C++ classes (also with parallel support)
  • Test script for Super-Resolution (run_SR.m)

The code comes with a research only license (see license.txt) and there are trained regressors and already compiled binaries in the downloads sections. It has been extensively tested in linux platforms, and although it might work in windows platforms as well, we have not deeply explored it (we give some hints below). If you are a windows user and you did not manage to compile and run the code, you migh consider using the cross-platform original binaries submission.

Please use the issue tracker if you find any unexpected behavior or unmatched result when compared to the paper. I will do my best to go through them, even though this is a best-effort compromise :D.

Citations

If you use this code please cite the following paper:

[PerezPellitero et al. 2016]

@inproceedings {Perezpellitero2016_2,
  author = {P\'erez-Pellitero, E. and Salvador, J. and Ruiz-Hidalgo, J. and Rosenhahn, B.},
  title = {PSyCo: Manifold Span Reduction for Super Resolution},
  booktitle = {Proc. {IEEE}  Conference on Computer Vision and Pattern Recognition},
  year = {2016},
}

Requirements

  1. OpenMP 3.0 compatible compiler (note Visual Studio is only OpenMP 2.0 compatible)
  2. Matlab (tested with 2015a, but should work with any recent version)

Usage

Please download one of the zipped packages from the downloads section and then run a hg pull -u to get the latest repository modifications.

Linux

If you want to compile your own mex binaries, please make sure your gcc compiler is configured within MATLAB (
mex -setup ) and then run:

>> make

This will generate the binaries with the -fopenmp flag (parallel support) enabled and place them in the bin folder.

To run a Super-Resolution experiment just type

>> run_SR

There are a few configuration parameters you can modify in order to get the right I/O of images. In our zipped package we provide the images of Set5 as an illustrative example.

Windows

The main issues with windows are:

  1. Lack of OpenMP 3.0 support in the most commonly supported Visual Studio compilers.
  2. We use undocumented advanced memory management in MEX interfacing (mexLock functions) for the class instances, which might result in unexpected behavior in windows.

For (1) there are several solutions:

  • Use GCC compiler (working natively from MATLAB 2015b onwards)
  • Use TDM-GCC and gnumex to set GCC as your compiler in older Matlab versions where it is unsupported (caution: you might find dragons).
  • Use a visual studio compiler (ensure you are compiling with \openmp flag) and replace the following line in PsycoSuperRes.cpp:
#pragma omp parallel for collapse(2)

by this line:

#pragma omp parallel for

Note that this is a less efficient parallelization and thus the resulting code is slightly slower. We provide a pre-compiled binary with this less-efficient modification.

  • Use an Intel OpenMP 3.0 compatible compiler (non-free).
  • Give a try at our pre-compiled windows binary (caution: you might find dragons)

With respect to (2), we have not played enough with the code in windows as to guarantee that some of the undocumented MEX functions will perform as desired. Again, please use the issue tracker if you find strange behavior so that we are aware of it.

Expected output

>> run_SR
This run is operating with an upscaling factor of x2 and 1024 atoms.
Starting               [                    ] ... 
Running PsycoSuperRes  [====================] Done. 

The average PSNR for PSyCo vs bicubic is 36.9233 dB vs 33.6767 dB.
The average time for PSyCo vs bicubic is 0.1186s  vs 0.0017s s.
Have a nice day!

Future and TO-DO

  • Extend the wiki page with more information about usage, dimensionality of the variables and interfacing.
  • Explore the cross-platform compilation and running for windows machines.
  • Provide an example of the usage of the PSyCo class alone.
  • Provide an OpenMP 2.0 friendly version (collapse the nested for so that the collapse pragma (2) is not needed)

Updated