Software for WInHD:	Wavelet-based Inverse Halftoning via Deconvolution
			(using redundant wavelets)
Software author: 	Ramesh Neelamani
Modification Date: 	September 18, 2002
Comments: 		neelsh@rice.edu

Reference: 

"WInHD: Wavelet-based Inverse Halftoning via Deconvolution",
R. Neelamani, R. Nowak, R. Baraniuk, Submitted to the IEEE
Transactions on Image Processing, September 2002. Available for
download from http://www.dsp.rice.edu/publications/


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
How to run the program?
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


Step 0) Since you are reading this file, you are in good shape! :)

Step 1) If you just want the results obtained by our algorithm, simply
change directory to the images sub-directory, and see the Readme file
in that directory. NOTE: The tif files can be read into matlab easily
by using the imread command. For example, lena =
imread('lena.tif'). You could also run the Compare command to compare
the WInHD estimate with the Gradient estimate.

Step 2) Run the Examples.m file. The Example.m file contains a variety
of examples to demonstrate halftoning and inverse halftoning with
WInHD that run in a self-explanatory fashion.

Important Notes: 
1) The WInHD inverse halftoning matlab routines included with this
package use redundant wavelets. Further improved results are possible
by using complex wavelets (cited in the paper). A WInHD implementation
with complex wavelets (CWT) is included in the directory CWT. However,
the CWT implementation relies of some routines written by Dr. Nick
Kingsbury (Email: ngk@eng.cam.ac.uk). Please contact him for his
complex wavelet matlab code and add a path to that directory as well.

2) In case of encountered errors check below for a possible fix.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Files in this directory are listed below.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Compare.m : Compare the inverse halftoned results of WInHD 
            algorithm (with complex wavelets) with the Gradient-based 
	    algorithm estimate of Kite et al.
	    (from http://www.ece.utexas.edu/~bevans/projects/halftoning/)

Examples.m : Contains a variety of examples to demonstrate halftoning
	     and inverse halftoning with WInHD.

floyd.m : Performs error diffusion halftoning of a gray scale image
          using the Floyd-Steinberg filter

jarvis.m : Performs error diffusion halftoning of a gray scale image
           using the Jarvis et al filter

IHT_Floyd.m : Performs inverse halftoning of a Floyd-Steinberg halftone
	      (uses redundant wavelets)

IHT_Jarvis.m : Performs inverse halftoning of a Jarvis halftone
               (uses redundant wavelets)

RunMe.m : Add the mtools and images directory to the current matlab
	  path.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Sub-directories are listed below.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CWT: 	 Contains the WInHD implementation using complex wavelets. 
	 Requires complex wavelet routines of Dr. Nick Kingsbury. 
	 Please email him for his complex wavelet package.

mtools:  Contains a variety of scripts called by the programs in this
	 directory. Includes files from the Rice wavelet toolbox (RWT)
	 to compute the forward and inverse wavelet transforms. Please
	 see http://www-dsp.rice.edu/software/ for more details in
	 this regard. If you encounter errors while running the
	 scripts in this file, change directory into mtools, and run 
	 compile at the matlab command prompt.

images:  Contains a variety of original, halftoned and inverse
	 halftoned images for the Lena and Peppers image. Please see
	 the Readme file in the images sub-directory for descriptions of 
	 the different tif images in that directory. NOTE: The tif
	 files can be read into matlab easily by using the imread
 	 command. For example, lena = imread('lena.tif');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Additional useful resources:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

To measure the visual qualities of the results, please download 
The Halftoning Toolbox for Matlab from 

http://www.ece.utexas.edu/~bevans/projects/halftoning/

The routines wsnr.m and img_qi.m are used to report the WSNR and
Universal Image Quality values for the results.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
In Case of Errors
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


The package is designed to run on Sun Solaris, Linux, or Windows
environment. I have tried to include precompiled mex files for many
common operating systems, but the list is not complete. If you have
any other platform, then you would need to download the Rice Wavelet
tool box, compile the C files for your platform, and then run the
programs. This could be particularly true if you are using new Windows
releases or new Linux releases.  Also see
http://www.dsp.rice.edu/software/ for more details on the Rice wavelet
toolbox.


If ERROR == "Warning: One or more output arguments not assigned during call to 'mrdwt'.", 

  SOLUTION: Compile the C files in the routines directory for your system.

	1) Change the matlab working directory to "routines" 
	2) Type "compile" at the matlab command prompt. This will
	   compile the C files for your operating system. Ofcourse,
	   you will need a C compiler to get this running.
