Hi Daniel, I surprised you say that the LL image contains negative values. That I don't observe (nor would I expect it) for your data
im = imread('lena.bmp');
dwtmode('per')
[LL,LH,HL,HH] = dwt2(im,'haar');
isempty(find(LL<0))
You should get a 1 to indicate that there are no elements less than 0
Now to explain that you observe elements in the LL image with values larger than the original image.
Yes, that is expected. Here's why. With a 2-D separable wavelet transform you end up with a sum of averages in the LL image, so at a given element of the LL image you will have something like: 1/2(a+b)+1/2(a+b) = a+b
as a result you are likely to get elements up to twice in value of the original elements.
Here is a very simple example of that:
X = ones(4);
[LL,LH,HL,HH] = dwt2(X,'haar');
LL
You see the output LL image is [2 2; 2 2] where the elements are all of the form
1/2(1+1)+1/2(1+1)
Here is showing you exactly how that is obtained:
X = ones(4);
Lo_D = [1/sqrt(2) 1/sqrt(2)];
Y = conv2(X,Lo_D(:)','valid');
Y(:,end+1) = Y(:,end);
Y = Y(:,2:2:end);
Y(end+1,:) = Y(end,:);
Y = conv2(Y',Lo_D(:)','valid');
Y = Y';
Y = Y(1:2:end,:)
Compare the Y matrix to the LL matrix obtained from dwt2()
Best Answer