5
$\begingroup$

I am trying to do DWT steganography. I first obtain the DiscreteWaveletTransform of the image as follows

dwd = DiscreteWaveletTransform[carrierImage, HaarWavelet[], 1]
(* Out: DiscreteWaveletData[<< DWT >>, < 1 >, {256, 256}] *)

This splits the image into four separate images that can be obtained with dwd[All, "Image"], but when I use those with InverseWaveletTransform I get a blurred version of the original image. Why is it so?

MWE to recreate the problem:

img = ExampleData[{"TestImage", "Lena"}];
dwd = DiscreteWaveletTransform[img, HaarWavelet[], 1];
newdwd = DiscreteWaveletData[dwd[All, "Image"], HaarWavelet[], DiscreteWaveletTransform];
Row[{
  Show[InverseWaveletTransform[newdwd], ImageSize -> 200],
  Show[InverseWaveletTransform[dwd], ImageSize -> 200]
  }]

Mathematica graphics

For @JasonB it's even worse (image link copied from his comment):

Mathematica graphics

$\endgroup$
  • 1
    $\begingroup$ @C.E. - I get a much worse reconstruction than you do: i.stack.imgur.com/RZuml.png $\endgroup$ – Jason B. Mar 14 '16 at 16:08
  • $\begingroup$ @JasonB That's interesting, I added it to the question so it becomes even more intriguing at first glance. $\endgroup$ – C. E. Mar 14 '16 at 16:12
  • $\begingroup$ You told the WaveletTransform to use a Haar wavelet. Which wavelet do you suppose the InverseTransfom is using? $\endgroup$ – bill s Mar 14 '16 at 16:19
  • $\begingroup$ I've never reconstructed a DiscreteWaveletData object before. If you compare the files FullForm[dwd] >> "test1.txt"; FullForm[newdwd] >> "test2.txt"; you see that test1.txt is 889 lines longer... $\endgroup$ – Jason B. Mar 14 '16 at 16:19
  • 2
    $\begingroup$ Every test I run returns that newdwd is not a properly constructed DiscreteWaveletData object. Try newdwd["TreeView"] and newdwd[All, "Image"] versus dwd["TreeView"] and dwd[All, "Image"]. Perhaps you could rephrase the question "How can I reconstruct a discrete wavelet data object from its constituent parts?" $\endgroup$ – Jason B. Mar 14 '16 at 16:30
5
$\begingroup$

The reason behind the blurry inverse transformations lies in the fact that a function (ImageAdjust) is applied to the wavelet coefficients when you call DiscreteWaveletData. And that's not what we want.


img = ExampleData[{"TestImage", "Lena"}];

dwd = DiscreteWaveletTransform[img, HaarWavelet[], 1];

newdwd = DiscreteWaveletData[
        dwd[All, {"Image", "ImageFunction" -> Identity}], HaarWavelet[], 
        DiscreteWaveletTransform];

Row[{Show[InverseWaveletTransform[newdwd], ImageSize -> 200], 
        Show[InverseWaveletTransform[dwd], ImageSize -> 200]}]

dwd

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.