Laplacian
Measure the second spatial derivative, highlighting rapid changes in image intensity.
Flat regions and sharp transitions respond very differently.
The highlighted window straddles an intensity boundary. Flat windows have cancelling contributions.
Mint is positive; violet is negative. Dark pixels have almost no response. Keep a signed matrix depth to preserve both signs.
Magnitude makes transitions visible regardless of sign. Display normalization is applied only to this illustration.
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
Experiment at pixel level
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.
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
Select a pixel
Select a pixel
When to use it
Find fine detail, build sharpening filters, or estimate focus from high-frequency content.
How it works
- 01Estimate the second derivative along x.
- 02Estimate the second derivative along y.
- 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.