# Image Restoration by Solving Constrained Least squares in Frequency Domain (Frequency Domain Filtering)

I am trying to implement the constrained least squares filtering as described in Rafael C. Gonzalez, Richard E. Woods - Digital Image Processing 3rd Edition Section 5.9. The equation (5.9-4) says that $$P \left( u, v \right)$$ is the Fourier transformation of the Laplacian filter ($$3 x 3$$). But the coordinates $$u$$, $$v$$ are the coordinates of the image which is much greater than 3x3.

How can I implement this 2D Filter in Frequency Domain?

• Could you link to the reference?
– Royi
Nov 7, 2020 at 8:43
• So it's the book Rafael Gonzalez et.al 'Digital image processing 2007, chapter 5.9 p.380 in that edition of the book Nov 7, 2020 at 18:28
• Could you post more context about the problem being solved and then I will be able to solve it for you?
– Royi
Nov 8, 2020 at 6:01
• Do you want me to solve it?
– Royi
Nov 9, 2020 at 5:06
• Hi i manage to solve it. Mainly the case is that the filter had to be shifted to the midle of the image and then padded to the size of image. In Matlab fft2(fftshift(o,d1,d2)) where d1 and d2 are dimensions of the img Nov 10, 2020 at 6:12

As you wrote in the comments, one way to do it is simple zero padding and fftshift(). Yet this might cause some artifacts.