Sharpening (High-Pass) Filters

Sharpening emphasizes transitions in intensity to make an image appear crisper and more detailed.

High-Pass Filters are a frequency or spatial technique that enhance sharp edges and fine details while removing or reducing broader, uniform areas.
It does this by ➀ amplifying the high-frequency components of an image — the parts where pixel intensity changes rapidly and ➁ suppressing low-frequency data (smooth gradients, large objects).

graph TD
    A[Sharpening / High-Pass Filters] --> B[Second Derivative Based]
    A --> C[Composite / Enhancement Techniques]

    B --> B1[Laplacian Filter]
    B --> B2[Laplacian of Gaussian - LoG]

    C --> C1[Unsharp Masking - USM]
    C --> C2[High-Boost Filter]

    style A fill:#4A90D9,color:#fff
    style B fill:#E8A04C,color:#fff
    style C fill:#C586C0,color:#fff
Pure High Pass filter Formula
Output=OriginalBlurred

When A=1, it is equivalent to standard Unsharp Masking.
When A>1, the original image content is additionally amplified.

1. UnSharp Masking (USM)

Spatial
The unsharp filter is a most simple sharpening technique which enhances edges (and other high intensity components in an image).
Application: It is primarily used for edge detection and image sharpening

How it works?

It works by subtracting a blurred (or "unsharp") or smoothed version of the image from the original, isolating the fine details, and scaling them to make edges
The process consists of three main steps:

  1. Blurring: A blurred (or smoothed) version of the original image is created, typically using a low-pass Gaussian filter.
  2. Detail Extraction: The blurred image is subtracted from the original image. This isolates the high-frequency details (edges and fine textures).
  3. Scaling & Addition: This extracted detail is multiplied by a scaling factor and added back to the original image
Output=Original+λ(OriginalBlurred)

where λ is the sharpening strength.

Visual Representation

ML_AI/images/UnSharp-1.png

Mathematical Example
[1001001000010010010000100100100001001001000010010010000]Original Image — Pixel Grid (I)[1001007525010010075250100100752501001007525010010075250]Gaussian Blured (Low Pass (L))[00252500025250002525000252500025250]Detail Extraction (High Pass (H=I-L))[100100150500100100150500100100150500100100150500100100150500]Final Sharpened Image (S=I+2H)
When to use?
When to avoid?
Caution

Always apply noise reduction before sharpening, not after. Sharpening first will amplify noise, and subsequent smoothing will then undo the sharpening — a destructive cycle.

2. High-Boost Filter

Spatial
Similar to UnSharp Masking (USM), High-boost filtering too is an image sharpening technique used to enhance edges and fine details while retaining the original image's smooth background. It acts like a high-pass filter (which highlights edges) but preserves the image's low-frequency components (overall shading and brightness).

How it works?

It is a generalized approach it combines the original image and its high-frequency details into a single, adjustable equation.

Output=AOriginalBlurred=(A1)Original+(OriginalBlurred)

when

When to use

When to avoid

Caution

  • If A is too large: The image can become unnatural, over-sharpened, or noisy.

3. Laplacian Filter (for Sharpening)

The Laplacian filter is a one of the main and used and fundamental tool in image processing, belonging to the high-pass filter family. While the filters like the basic Unsharp Mask, which often rely on first-order derivatives (calculating the difference between adjacent pixels), the Laplacian is a second-order derivative filter.
Instead of just asking "Is there a change in brightness here?" it asks "How fast is that rate of change changing?". Basically second-order derivative operator used to measure the rate of change in pixel intensities.

It is highly effective for identifying areas of rapid intensity transitions, making it a fundamental tool for 👉 edge detection, 👉 image blending, and 👉 blur assessment but 👎 it also makes it extremely sensitive to random image noise.

How It Works?

1. In continuous mathematics, the Laplacian of an image with pixel intensity values I(x,y) is denoted by 2I and is defined as the sum of the unmixed second partial derivatives in the x and y directions:

2I(x,y)=2Ix2+2Iy2

where

2. Spatial Domain (Convolution): Since digital images are made of a discrete grid of pixels, we have to find a discrete convolution kernel (a small matrix) that can approximate the second derivatives in the definition of the Laplacian. Two commonly used small kernels are shown below.

010141010111181111positive center (4 or 8) yields apositive response on thedarker side of a zero-crossing edge010141010111181111negative center (4 or 8) yields apositive response on the lighter side of a zero-crossing edge

3. Frequency Domain (Fourier Transform)
When performing image processing or signal analysis, you apply the Laplacian in the frequency domain using the following steps:

Usecase
The Problem of Noise

Because second-order derivatives amplify noise severely, the Laplacian filter is almost always paired with a Gaussian smoothing filter. This combination is known as the Laplacian of Gaussian (LoG). It smooths out high-frequency noise first, and then applies the Laplacian to cleanly extract the broader edges.

4. Laplacian of Gaussian (LoG)

How it works

First applies a Gaussian blur to suppress noise, then applies the Laplacian (second-order derivative) to detect regions of rapid intensity change. Zero-crossings of the Laplacian output mark edge locations.

A common 5×5 LoG kernel approximation:

00100012101216210121000100
When to use
When to avoid
Caution

LoG produces both positive and negative responses around an edge. Naively thresholding the output (e.g., looking for values > 0) will not give clean edges. You must detect zero-crossings in the output, not simply threshold the magnitude.


Questions and Answers

1. The Key Distinction between High Pass Filter and UnSharp Masking

The difference between a High Pass filter and Unsharp Masking lies entirely in what you do with the detail once you find it.

If we define the High Pass filter as H, the Original image as I, and the Blurred image as L:

What us Amplification vs. Diminishment of Central Pixel?

A sharpening kernel enhances contrast by emphasizing edges and fine details in an image. It works by applying a weighted transformation to the central pixel, highlighting differences with surrounding pixels.

Central Pixel Amplified Central Pixel Diminished
A higher central pixel value gets amplified, making edges sharper A lower central pixel value gets suppressed, reducing visibility.
- The central pixel (3) has a higher value than its neighbors (2s).

- The kernel applies a stronger positive weight (-5) to the central pixel.

- The output pixel intensifies the contrast, making the center more prominent.
- The central pixel (1) has a lower value than its neighbors (2s).

- The same sharpening kernel now reduces its impact due to the strong negative weight (-5).

- The output pixel diminishes the contrast, making the center less noticeable.
ML_AI/images/conv-9.png ML_AI/images/conv-10.png