I want to apply haar transformation on a colored image. For this I will have to apply the haar function on red, green and blue components separately. Now according to my understanding, haar function is averaging and differencing. So the red, blue and green component values become negative in some cases( while performing differencing). Once i get negative values, I cannot map to r/g/b component. How to solve this problem. I am implementing haar function in JAVA. Also I am not using any library to compute harr transformation. Please help.
Asked
Active
Viewed 237 times
1 Answers
0
You have two choices. Either change your representation so you're not using unsigned 8-bit bytes anymore, or add a fixed offset such as 128. The appropriate choice depends on how you will process the result.

Mark Ransom
- 299,747
- 42
- 398
- 622
-
How to decide the offset value?.. Please pardon my ignorance. Also i am unable to reproduce the original image in the LL sub band. – Manasvi Karanam Mar 11 '13 at 18:41
-
@user2151173 I gave the example of 128 because it's the halfway point between 0 and 255 and is most commonly used if the result will be symmetric around 0. – Mark Ransom Mar 11 '13 at 18:51
-
OK.. I got your point. Thank you!.. But can you tell me the possible reasons for not getting the original image back in LL sub band? – Manasvi Karanam Mar 11 '13 at 18:57
-
@user2151173 I'm afraid that question is beyond me, and it isn't really relevant to the question you originally asked. – Mark Ransom Mar 11 '13 at 19:01
-
true.. it isnt relevant.. Anyaways.. Thanks for the help! – Manasvi Karanam Mar 11 '13 at 19:08