DEV Community

Convolution

Convolution is a mathematical operator represented by the symbol "*". It graphically represents how the shape of one function is modified by another function. Convolution is only applicable to Linear Time Invariant Systems, which means the system's output shifts identically with a shift in input and has a linear relationship between output and input. For discrete systems, the convolution formula can be applied. An analogy to understand convolution is to consider the amount of smoke produced by burning matchsticks, where the smoke function describes the amount of smoke produced by a single matchstick and the firework function describes the number of matchsticks lit per minute. The convolution of these two functions can be calculated by sliding a window over the firework function and multiplying the corresponding values. This concept can be visualized as a 2D sliding window, where the first function is large compared to the second function. In image processing, the 2D function is known as a kernel, which is a 3x3 matrix that slides over the image to perform convolution. The kernel is flipped and multiplied with the corresponding image values to produce the output. The sum of all nodes in the kernel should be 1 to achieve the desired effect, such as blurring an image.
favicon
dev.to
dev.to
Image for the article: Convolution