0

I am trying to code Haar DWT based steganography. Coefficients of subbands are coming in float64. In order to embed secret in pixels, I need subband as integers.

Matlab provides a lifting schemes to convert subbands to integers. Does any python library provide such function?

Using: pywavelets, numpy, python2.7

Himani Agrawal
  • 1,242
  • 12
  • 14
  • Tried the iwt implementation provided. The image received after [iiwt2(iwt2(image))](http://i64.tinypic.com/2qlh2th.png) is quite different from original image, which is we don't want in case of stegnography. – Himani Agrawal Apr 25 '16 at 01:22
  • I can guarantee you 101% it works for 2D arrays. So either you plotted it with something other than `np.uint8` type, or there was something off about your array. Did you pass `image` as type int? Regardless, the steps of creating your own lifting scheme are included in that answer. Feel free to roll your own implementation if something about that example doesn't satisfy your needs. – Reti43 Apr 25 '16 at 01:31
  • I am passing image as np.uint8 and the resultant array is in integers. But the image received after the inverse is so different that one can easily tell it's not the original image. – Himani Agrawal Apr 25 '16 at 01:37
  • You have to pass the image as int, or else the sums and differences can't go outside the 0-255 range. If you don't want to do this manually, add a line at the top of each function with `array = array.astype(int)`. – Reti43 Apr 25 '16 at 01:39
  • Passing the image as int worked, but I didn't understand how? Also, there are no negative values. – Himani Agrawal Apr 25 '16 at 01:46

0 Answers0