Discrete Wavelet Transform LeGal 5/3 with Lifting (negative values, visualizing, LH HL confusion)

ε祈祈猫儿з 提交于 2019-12-05 04:52:30

I wrote a blog about building a WDR image compression system. You can read more here:

http://trueharmoniccolours.co.uk/Blog/

(You'll note that I'm not a very prolific blogger ;) ). It should contain all you need to implement your own C++ version of WDR image compression. If not feel free to fire me a message and ask!

  1. Yes this is a really under documented "feature" from what I could work out. The value returned from the DWT is actually a short and requires the range -255 to +255. Now of course -255 is not directly renderable when using 8-bit colour. As such what people usually do is divide the value by 2 and add 128 for display (Don't forget display is just a tool for debugging). This way you move 0 to be a 128 and hence a "mid grey" on a greyscale image.

  2. It doesn't really matter provided you do the inverse transform the same way you do the forward transform.

  3. No it should make no difference. When implementing you decide where to write the destination pixel so you are free to write it where you like (to a completely different image for example).

Edit: Regarding your comment the Daub 5/3 lifting equation is as follows:

d = s[n + 1] - ((s[n + 0] + s[n + 2]) / 2);

So in the case of a source image of 255, 0, 255 ... that would result in a d of -255. Starting with 0, 255, 0 would give the maximum of 255 so you should definitely be in the range -255 to +255 or there is something wrong with your implementation.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!