You are here

Wavelet Decompose - Understanding the Code

Hello.
Today I encountered this GIMP Plug In - Wavelet Decompose (http://registry.gimp.org/node/11742).
The source code is available.

I wanted to recreate this effect in Matlab as my knowledge in C / C++ is small.

The function I wanna know about is "hat_transform" (http://www.pasteall.org/15917/c):

/* code copied from UFRaw (which originates from dcraw) */
static void
hat_transform (wdsint * temp, wdsint * base, int st, int size, int sc)
{
int i;
for (i = 0; i < sc; i++)
temp = 2 * base[st * i] + base[st * (sc - i)] + base[st * (i + sc)];
for (; i + sc < size; i++)
temp = 2 * base[st * i] + base[st * (i - sc)] + base[st * (i + sc)];
for (; i < size; i++)
temp = 2 * base[st * i] + base[st * (i - sc)]
+ base[st * (2 * size - 2 - (i + sc))];
}

I read about Wavelet and never encountered this kind of transformation.
I couldn't figure it out, would anyone assist me with that?

This is what I could manage to understand (Hopefully correctly):
The function works on a vector of numbers (Row or Column of the Image).
base - Input Row / Column.
temp - Output Row / Column.
size - Length / Width of the Row / Column.
sc - Scaling.
Couldn't figure what's "st" and what exactly the function does.

Could anyone help me with that? Just to recreate the effect of this Plug In.
I'd really appreciate this.

Subscribe to Comments for "Wavelet Decompose - Understanding the Code"