alphonse
alphonse

Reputation: 61

What does padding do in 2d convolution of images?

Having two images , A and B of sizes n-by-m , k-by-l. When doing convolution via Fourier transform , it is said that we have to pad with zeros the signals. What does this exactly mean? When I get ifft2(A, B, n+k-1, m+l-1) its like padded is done? Thanks in advance

Upvotes: 0

Views: 1940

Answers (1)

hotpaw2
hotpaw2

Reputation: 70703

To zero-pad, you must increase the size of A and B until they are both n+k-1, m+l-1 (or greater) in size by adding rows and columns of zeros to these array/matrix variables. If you don't zero-pad, the convolution effect will wrap around (top-to-bottom and left-to-right) thus messing up your result (unless you actually want this circular convolution wrap-around effect).

Upvotes: 1

Related Questions