Coding wavelets the easy way

2D Image Processing Layout



Filtering


We will use the same set of filters as for 1D signals, except that, on each image, two filters will be applied
  • one is applied to all the rows in parallel
  • the other one is applied to all the columns in parallel

Image structure


Since two filters are applied on each image, the image structure will have three fields
  • the s field will hold the data
  • the rd will be the delay cause by the filtering on the rows
  • the cd will be the delay cause by the filtering on the columns

For instance, a grayscale image is initialized the following way:
grayImage = double(grayImage);
grayImage.s = grayImage;grayImage.rd=0;grayImage.cd=0;


Wavelet Transform structure


As in the 1D case, the wavelet transform WT will have two fields: WT.LoRes and WT.Details.
Similarly, WT.Details will be a column cell array
WT.Details = cell(scale,1)

The cell object WT.Details{i} will not be, however, an image object; it will be a structure with three fields. This is because three detail objects are produced in the processing:
  • WT.Details{i}.r is the image object obtained by applying the band pass filter on the rows and the low pass on the columns
  • WT.Details{i}.c is the image object obtained by applying the low pass filter on the rows and the band pass on the columns
  • WT.Details{i}.d is the image object obtained by applying the band pass filter on the rows and on the columns
WT.LoRes is obtained by applying the low pass filter on the rows and on the columns.