If nothing else, this means you don't have to worry when you apply several passes with an unsharp mask to a breathtakingly detailed planetary image: the image you produce does not depend on which convolution you apply first.
Associativity. This property means that you can build up large kernels from small ones, or you can apply small kernels in succession to produce the same destination as applying a large one. Kernels are convolved with each other in much the same way that a kernel is convolved with an image. The following pseudocode creates a new kernel, k3 (), from two small one, kl () and k2 ():
FOR y = -ry TO ry FOR x = -rx TO rx FOR j = -rj TO rj FOR i = -ri TO ri k3(x+i,y+j) =
NEXT i NEXT j NEXT x NEXT y
In the sections that follow, you will see the associativety property used to create a large kernel from two small ones. If an image were convolved with each of the small kernels in turn, the destination would be the same as convolving the image with the resulting large kernel. You may find it helpful to try to visualize the kernels. The numbers for the pair below represent a donut shape and an averaging kernel. The destination, as you might expect, is a fuzzy donut shape:
Was this article helpful?