tags:

views:

51

answers:

2

Hello. My prof. gave me two programs written in C: a lossless compression and a decompression one. I have to implement the Integer Wavelet Transform (I was using the lifting scheme of Haar's function but I changed to the Daubechies 5/3 int-to-int later) to the code blocks to improve the compression ratio.

Everything was going fine in the modified programs except one mistake which also exists in the original programs he handed out.

Among several medical-type images of *.bmp extension, there are two images that cannot be recovered to their initial forms (i.e. just seeing some blocks of black and white instead of seeing a human face) although checking function informs that there is no difference between the files before and after the compressing process.

Remember that the rest images after decompressing look identical to the original ones.

You can take a look of these images here: http://s844.photobucket.com/home/miroseh. Moon surface and Zelda (girl) are not good. X-rayed chest is perfect.

I hope to hear solutions from you. I've stuck with this for weeks.

I attach the create_matrix_image (in compress.cpp) and restorebmp function (in decompress.cpp) as following.

If these still are ambiguous, you can download the source codes and grey images here

Using Borland C/C++ 5.02 compiler is better off: http://www.mediafire.com/?njmm1ovenmm

Thank you for your consideration.

A: 

What do you mean by "checking function informs that there is no difference between the files before and after the compressing process"? I guess you're comparing the raw data between the two images. If the raw image data are identical but files end up being different, this may have to do with an incorrect BMP header. Try comparing the BMP files as well. I see that the Zelda images only differ on the first 1088 bytes, whereas the chest images only differ on the first 64 bytes.

Take a look at the BMP file spec here, you may find some info about the header:

http://en.wikipedia.org/wiki/BMP_file_format#BMP_File_Header

fbonnet
A: 
Norle