****************************************************
* Adaptive Homogeneity-Directed Demosaic Algorithm *
****************************************************
  Designed by:  Keigo Hirakawa
                kh237@cornell.edu

  Y = MNdemosaic(X,delta)
        X        RGB mosaic image, ranges 0~255
        delta    ball set size

  Files: MNdemosaic    main algorithm
         MNrgb2lab     color space conversion
         MNdemosaicX   horizontal interpolator
         MNdemosaicY   vertical interpolator
         MNartifact    reduce interpolation artifacts
         MNparamA      adaptive parameter calculation
         MNballset     returns convolution filters defining ball set
         MNhomogeneity homogeneity map calculation

  This algorithm was developed according to Hirakawa's master's 
  thesis.  The matlab code is prepared strictly for research use
  only.  Do not distribute the matlab code without a written 
  permission from either Prof. Thomas W. Parks or from Keigo 
  Hirakawa.

******************************************************
To run the adaptive homogeneity-directed demosaic algorithm,

[Y] = MNdemosaic(X,delta)

X         mosaiced RGB input image
delta     ball set size
Y         reconstructed RGB image

- delta=2 is recommended/default, but delta=1 also produces
  good results.  There are pros and cons to each, so please
  try both.
- replacing CIELAB space with YCbCr also works well, and it
  is more efficient.
- see test_demosaic.m for example.

******************************************************
Pre-print of the journal paper (intended for IEEE Trans.
on Image Processing) is also included in this ZIP package.
It is much easier to read than the ICIP 2003 paper. 

I appologize that the matlab codes are written in a cryptic
manner.  It speeds up the execution time for matlab.

Have fun!
Keigo

5/1/2004