For the past week I had been working on implementing a Rice University based inverse halftoning algorithm which they had published in Matlab. The results were good and I was motivated to implement the same in C. This apparently was a bad decision because of the various complicated steps involved. My aim was to start with the denoising implementation and use the dwt code provided in the same toolkit. But this did not work and I got some random images which was definitly not what I had in mind for the final image. I realized that I should have carefully tested and understood the halftoning process.

The work done at Rice University was based on the original work done by Xiong, Orchard, and Ramchandran in a paper titled “Inverse Halftoning Using Wavelets”. This was the first paper of doing inverse halftoning using wavelets and most of the subsiquent research papers used some form of the the algorithm proposed by them. Unfortunately there is no implementation of the algorithm available online. Fortunately the method is easy enough to be implemented in Matlab. My goal was to first test how the algorithm works and then implement in C. So far I have results of how the code works on a Matlab implementation.

Here are the steps involved in the method:

Step 1: Take DWT of the halftoned image. This will produce four set of images say S, W_H, W_V, W_D. S will contain low frequency information of the image, W_H will be the horizontal high pass image, W_V will be the vertical high pass image, and W_D will be the diagonal high pass image.

Step 2: Pass W_H and W_V through a low pass gaussian filter and ignore W_D.

Step 3: Pass S through an edge preserving filter so as to not get blurry images. Instead of doing this, I also passed S through a gaussian filter. The result as expected was blurry but the amount was not that much. I will implement the particular noise removal filter soon.

Step 4: Calculate inverse DWT using changed wavelets coefficients and ignoring W_D.

The sequence of images starting from the orignial are shown below:

original image

S wavelet image

W_H wavelet image

W_V wavelet image

Passing each W_H, W_V, S through gaussian filtering and taking inverse we get:

final inverse halftoned image

If you compare this with the image I got in my previous post, you will notice a huge difference in the quality. I will improve upon this by changing the filter used for S wavelet coefficients. Once I have the Matlab code ready and I will implement this in C and then make it work for GIMP. This should take about 2-3 days because most of the code for doing Wavelet transforms is already available and I just have to get code for doing filtering (which I have actually written but realized there is a better and faster version online!) and specify the necessary kernel for doing filtering. I should have the final plugin done within 3 days. I will do testing of the Matlab code on some pictures that I have scanned from newspapers. That should give a good idea of how this method can actually be used becuase newspaper images are halftoned images.

## Leave a Reply