# Image downsampling with Haar DWT?

How can the resolution of an image in matlab be reduced by using 2D haar wavelet by downsampling-decimation? Is there any predefined code or tool within wavemenu? thanks in advance

• Hello and welcome to DSP.Stackexchange! It looks like you have a question on how to use a very specific piece of software called wavemenu. Chances anyone around here has heard it before or would be familiar with it are not that high. If your question is about that software specifically, it's probably best to contact its authors. If you can make it more general, your question might be a good fit for StackOverflow if it's about how to implement things or even here (but then you'd need to provide more details about what you want to do like an example or so). Jul 11, 2019 at 13:50

The process the authors use with the Haar wavelet seems to be simply computing the low-pass/low-pass approximation of the image. Each $$2\times 2$$ block of pixels is simply replaced by their average. It boils down to low-pass filtering with a $$2\times 2$$ moving average kernel, and downsampling by 2 on rows and columns. One cannot go to $$640 \times 480$$ to $$32\times 32$$ without cropping some borders, as you can see on the man's left shoulder. Matlab functions for that purpose are dwt2 and wavedec2.

• thanks very useful for me. I tested your suggestion in MATLAB and works fine! Jul 16, 2019 at 15:26
• Good to know that it worked. You can even upvote :) Jul 16, 2019 at 16:06

yes ok thanks for the reply. Specifically, what I intend to do is an algorithm of digital image processing for use in retinal implants. Clarifying a bit my problem I know that there is a mathematical operation applicable to digital images that is called Wavelet Transform and that is in some way to compress the image can also lower its resolution through downsampling. My question is how can I from Matlab (with wavemenu GUI for example) compress an image using the Wavelet Haar transform and lower its resolution for example 640x480 to 32x32. In the following article is explained in a general way in the last step of table 1 https://www.researchgate.net/publication/323193463_Comparative_analysis_of_image_processing_algorithms_for_visual_prosthesis

• You'd better update your question than answering it with details Jul 11, 2019 at 19:04