Friday, August 2, 2019

filters - Why images need to be padded before filtering in frequency domain


In image processing books , we are told that Images need to be padded while doing filtering in the frequency domain. Why we need that zero padding ?



Answer



Multiplication in the frequency domain corresponds with circular convolution in the spatial domain. This means that without padding the image properly, results from one side of the image will wrap around to the other side of the image.


You can think of 2D filtering as a sliding window that is centered over each pixel in the image and the center output pixel is a weighted sum of the pixels in the window. With circular convolution, when the window hangs over the right edge of the image, it is actually wrapping back around to the left side of the image. This means that output pixels on the right edge of the image will be affected by pixels on the left edge, which is almost never what is actually desired.


Zero-padding allows space for this wrap-around to occur without contaminating actual output pixels.



No comments:

Post a Comment

digital communications - Understanding the Matched Filter

I have a question about matched filtering. Does the matched filter maximise the SNR at the moment of decision only? As far as I understand, ...