************************************************
* Combined Demosaicing and Denoising Algorithm *
************************************************
  Designed by:  Keigo Hirakawa
                kh237@cornell.edu

  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.  The algorithm is developed according to:
  
  K. Hirakawa, T.W. Parks, "Joint Demosaicing and Denoising," 
     IEEE ICIP, 2005.
  K. Hirakawa, T.W. Parks, "Joint Demosaicing and Denoising," 
     IEEE Trans. Image Processing (accepted).

  For more information, visit: www.accidentalmark.com/research

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

  Y = TLSdemosaic(X,k0,k1)

  X        RGB mosaic image, ranges 0~255. 
  k0,k1    noise parameter: we assume signal-dependent noise
           model, X=S+(k0+k1*S)*delta, where delta~N(0,1).

  Assumed Bayer pattern is:
    G R
    B G

  Please note that the algorithm is painfully slow.  There are
  ways to speed it up (with some image quality tradeoffs), but 
  this is not documented in any paper.

******************************************************
  Pre-print of the journal paper (accepted for IEEE Trans.
  on Image Processing) is also included in this ZIP package.

  Have fun!
  Keigo

  9/30/2005