Skip to content

Laplacian

Measure the second spatial derivative, highlighting rapid changes in image intensity.

Try it on your image ↓

VISUAL WALKTHROUGHEdges
REFERENCE INPUTIntensity image

Flat regions and sharp transitions respond very differently.

RESULTResponse magnitude

Magnitude makes transitions visible regardless of sign. Display normalization is applied only to this illustration.

STEP 03 / 03

Add the responses at each pixel.

Computed teaching example on a 24 × 16 image. Small kernels and simplified settings keep each change visible; use the image laboratory for native OpenCV.

Try it on an image

YOUR IMAGE · REAL OPENCV

Experiment at pixel level

Open full lab ↗

Second derivative of grayscale intensity. Inspect signed values alongside the absolute preview.

The engine loads on your first run. Your images stay in this browser.

Input448 × 320
OutputWaiting for a result

Scroll over either image to zoom at the pointer. Use the scrollbars to pan both views over the same relative area. Zoom is relative to the input; pixel coordinates belong to each image. Warps can change scene correspondence.

Pixel inspector RGBA · native values · matched scale · 9 × 9 output pixels
Hover to inspect. Click to pin a pixel.
Input
Select a pixel

Output
Select a pixel

Sample models and licenses

When to use it

Find fine detail, build sharpening filters, or estimate focus from high-frequency content.

How it works

  1. 01Estimate the second derivative along x.
  2. 02Estimate the second derivative along y.
  3. 03Add the responses at each pixel.

∇²I = Ixx + Iyy

What to tune

ksize sets derivative support; use a signed output and control smoothing before comparing images.

Where it breaks down

Noise creates a strong response too. Variance of the Laplacian depends on exposure, texture, scale and noise, not just focus.

TypeScript API

Open an entry for its exact overloads, parameter descriptions, result ownership and pinned upstream source.

All of these calls execute on the CPU. Native objects need explicit disposal. See matrices and ownership and build compatibility.