18.9.2 Algorithms (Matrix Smoothing)

Matrix smoothing is done by shrinking and expanding the matrix. The order of shrink/expand operations depends upon matrix dimensions: