Is spatial convolution a 2D representation of temporal convolution?

38 Views Asked by At

I was looking into convolution and I've worked with temporal (time-domain) convolutions previously. You essentially study how the kernel function modifies or alters the shape of the second function across the defined domain. This is mathematically represented as follows: $$ f * g = \int_{-\infty}^{\infty}{f(t-\tau)g(\tau).d\tau} $$ I came across spatial convolution, as used in image processing and other domains, and I couldn't wrap my head around how a spatial convolution could be physically defined. My question is as follows: are spatial convolutions simply a 2D representation of temporal convolutions?

I've found the following visual definition of temporal convolution to be useful: flip the kernel about the vertical axis i.e., mirror it horizontally, and then slide it across the domain in which the second function is defined and measure the area bounded between both functions.

I tried to apply a similar analogy to spatial convolutions. Consider a 2D matrix representing a spatial dataset. To perform spatial convolution:

  1. What would be the equivalent horizontal mirror - Do I transpose the elements of the kernel matrix or is it some other operation?
  2. When I slide the kernel matrix across the second function, do I move sequentially across the entire second matrix, shifting column by column, row after row?
  3. In this analogy, would spatial convolution be the cross product of the kernel matrix and the portion of the second matrix over which the kernel is being superimposed?

I've tried listing these questions down based on how I've tried explaining spatial convolution with this visual analogy. I'd appreciate it if you could help me in answering these queries or provide a better graphical analogy for spatial convolution.

Cheers!