0

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.

Manasvi Karanam
  • 27
  • 3
  • 10

1 Answers1

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