This is the reference implementation of the adaptive-manifold high-dimensional
filter described in the paper:

  Adaptive Manifolds for Real-Time High-Dimensional Filtering
  Eduardo S. L. Gastal  and  Manuel M. Oliveira
  ACM Transactions on Graphics. Volume 31 (2012), Number 4.
  Proceedings of SIGGRAPH 2012, Article 33.

Please refer to the publication above if you use this software. For an
up-to-date version go to:

           http://inf.ufrgs.br/~eslgastal/AdaptiveManifolds/


THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY EXPRESSED OR IMPLIED WARRANTIES
OF ANY KIND, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THIS SOFTWARE OR THE USE OR OTHER DEALINGS IN
THIS SOFTWARE.


=== Information About Our MATLAB Implementation

This directory contains the following files which implement our adaptive-manifold
high-dimensional filter:

   adaptive_manifold_filter.m
     This is the main implementation of our adaptive-manifold high-dimensional
     filter. The code is commented with pointers to the equations of our paper.
   
   h_filter.m
     This is the low-pass filter 'h' (Eq. (13)) we use for generating the
     adaptive manifolds.
   
   RF_filter.m
     This is the RF filter of [Gastal and Oliveira 2011], which we use to blur
     over the adaptive manifolds.
   
   compute_manifold_tree_height.m
     This code computes the manifold tree height for RGB color image filtering --
     Eq. (10) of our paper.

We also provide a few scripts showing how to use our filter for different
applications:

   example_edge_aware_filtering.m
      This script demonstrates how to perform edge-aware 5-D color filtering.

   example_color_detail_enhancement.m
      This script demonstrates how to perform edge-aware 5-D color detail
      enhancement.

   example_non_local_means_denoising.m
      This script demonstrates how to perform non-local-means denoising.

   example_extra_information_denoising.m
      This script demonstrates how to perform denoising in a space defined by
      non-local-means patches plus additional information (for this example, an
      infrared image).

To use these scripts, simply execute them using MATLAB.  The following files
are also included:

   example_Table_1.m
      This script generates the number of manifold values from Table 1 of our
      supplementary PDF.

   compute_non_local_means_basis.m
      This implements a simple non-local-means patchspace, which is used in the
      denoising scripts described above. Note that this code is not optimized
      for memory use.

   keep.m
      Small MATLAB utility script for memory management.

Finally, note that some of the filtered images included in the paper and in the
"Application_Examples" directory were computed with our CPU or GPU
implementation of the adaptive-manifold filter. Due to the different random
number generators in these approaches (used for computing the segmentation
vector v_1 --- Appendix B), the results generated by our MATLAB implementation
may not be pixel-by-pixel identical to some the filtered results included in this
zip.

%  Version 1.0 - January 2012.
