Result of convolving two $3\times3$ kernels

convolutionimage processing

I am new to image processing and I just read that the associative property of the convolution operation allows us to convolve multiple kernels into a single one before applying that single kernel onto the image. I am confused as to the dimension of the output kernel. If we are given an image input $f$ and 2 kernels, $g$ and $h$, the associativity law stats that we can convolve $f$ with $(g*h)$. If $g$ and $h$ are two $3\times 3$ kernels, then the output of $(g*h)$ will be $1\times 1$ kernel ? This is based on my knowledge on how convolution works in image processing.

Best Answer

If $g$ and $h$ are two $3\times 3$ kernels, then $(g*h)$ will be a $5\times 5$ kernel. In general, when convolving two signals of length $m$ and $n$, then the result will have length $m+n-1$.

So the law states that convolving $f$ with two $3\times 3$ kernels $g$ and $h$ yields the same result as convolving $f$ with the $5\times 5$ kernel $g*h$.

EDIT: There appears to be some confusion about how the result of a convolution can be larger. The image below shows how some of the entries in $g*h$ are constructed, using only a few entries of $g$ and $h$. image

Related Question