# Wider sharpening filter

The kernel of a sharpening filter of size 3x3 may look like $$\frac{1}{4}\begin{bmatrix} 0 & 1 - \alpha & 0\\ 1 - \alpha & 4\alpha& 1 - \alpha\\ 0 & 1 - \alpha & 0 \end{bmatrix}$$ where $$\alpha > 1$$

What is a natural extension for size $$(2n + 1)\times(2n + 1)$$?

The sum of all elements should be equal to 1, and the matrix should be symmetric.

## 2 Answers

There are two basic forms of sharpening filter:

• I - 𝛼 Laplace(I)
• k I - (k-1) smooth(I)

where I is the image, 𝛼 is a positive value, and k is a value larger than 1.

The first form is referenced by Laurent in his answer, you can use the Laplacian of Gaussian to construct it. The second one is the classical unsharp masking, and was used in photography before computers existed.

Both of these can explain the filter in the OP, as both methods do more or less the same thing. But as you scale them, they become different.

The second form is the easiest to control. It has two parameters: the size of the smoothing filter (and its shape), and the k. The larger k, the stronger the sharpening effect. The larger the smoothing, the stronger the sharpening effect as well, but it also selects for the size of the edges that are sharpened.

• Clearer than mine! Jul 24, 2022 at 11:50

A classical construction for a linear sharpening filter $$S$$ is a weighted combination of some averaging $$A$$ (potentially an identity operator, performing no averaging) augmented by a certain amount from an edge-preserving or high-pass filter $$H$$:

$$S=A+\beta H$$

Here, your pattern is a combination of some 4-connected averaging and a discretized Laplacian:

$$\frac{1}{4}\begin{bmatrix} 0 & 1 & 0\\ 1 & 0& 1 \\ 0 & 1 & 0 \end{bmatrix}+ \frac{\alpha}{4}\begin{bmatrix} 0 & -1& 0\\ -1 & 4& -1\\ 0 &-1 & 0 \end{bmatrix}$$ The first $$3\times 3$$ low-pass filter is quite uncommon to me. I don't see a natural $$(2n+1)\times(2n+1)$$ extension of it, except the same, padded by zeros. For the 4-connected Laplacian of Gaussian (LoG), I believe there are several designs, see for instance Laplacian/Laplacian of Gaussian.

Therefore, depending on what you deem "natural", you have at least one parametric recipe. For far, I sticked to symmetric n4-connected avatars, but if you are ready to go beyond, there will be literature (for instance in the works of Jan J. Koenderink)