Skip to content

The algorithm atlas

Learn by seeing94 visual guides

Start with a problem. Follow the pixels, points, or probabilities through a method. Then open its exact TypeScript interface.

Each guide includes an annotated diagram, the steps behind the result, tuning advice and failure cases. The complete API reference includes additional methods and overloads. The image laboratory runs real WASM.

Categories
Choose individual algorithms 94 selected

Uncheck an algorithm to hide it. Category filters and the search above still apply.

Filtering

Gaussian blur

Replace each pixel with a weighted average that gives nearby pixels more influence.

See how it works →
Filtering

Box filtering

Average a rectangular neighbourhood with equal weight at every position.

See how it works →
Filtering

Median filtering

Choose the middle value of a pixel neighbourhood instead of averaging its intensities.

See how it works →
Filtering

Bilateral filtering

Smooth nearby pixels only when their colours are also similar.

See how it works →
Filtering

Custom correlation kernels

Apply your own linear filter to every pixel neighbourhood.

See how it works →
Edges

Sobel derivatives

Measure image change along x or y while smoothing in the perpendicular direction.

See how it works →
Edges

Scharr derivatives

Use a specialized 3×3 derivative kernel with improved rotational symmetry.

See how it works →
Edges

Laplacian

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

See how it works →
Edges

Canny edges

Turn image gradients into thin, connected edge chains using two thresholds.

See how it works →
Segmentation

Global thresholding

Divide pixels using one intensity threshold, or choose it automatically with Otsu or the triangle method.

See how it works →
Segmentation

Adaptive thresholding

Compute a different intensity threshold for each local neighbourhood.

See how it works →
Morphology

Erosion

Shrink a bright mask by taking the minimum under a structuring element.

See how it works →
Morphology

Dilation

Expand a bright mask by taking the maximum under a structuring element.

See how it works →
Morphology

Opening, closing and morphology

Compose erosions and dilations to remove small structures or measure their boundaries.

See how it works →
Morphology

Distance transforms

For every nonzero pixel, measure the distance to the nearest zero pixel.

See how it works →
Segmentation

Connected components

Give every connected foreground region a distinct integer label.

See how it works →
Segmentation

Contour tracing

Trace the boundary of each binary region as an ordered sequence of points.

See how it works →
Shape

Polygon approximation

Replace a dense curve with fewer vertices while limiting geometric deviation.

See how it works →
Shape

Convex hulls and defects

Wrap a point set in its smallest convex boundary and measure inward deviations.

See how it works →
Shape

Image and contour moments

Summarize how a region’s mass is distributed over its coordinates.

See how it works →
Segmentation

Marker-based watershed

Grow labelled regions across an image until competing regions meet at boundaries.

See how it works →
Segmentation

GrabCut

Alternate colour-model estimation and graph cuts to separate foreground from background.

See how it works →
Geometry

Image resizing

Sample the source on a new pixel grid at a different resolution.

See how it works →
Geometry

Arbitrary remapping

Provide a source coordinate for every destination pixel.

See how it works →
Geometry

Affine transformations

Map points with a linear transform plus translation, preserving straight lines and parallelism.

See how it works →
Geometry

Homography and RANSAC

Estimate a projective mapping between two views of a plane, rejecting inconsistent point matches.

See how it works →
Geometry

Polar and log-polar warps

Re-express an image using angle and radius around a chosen centre.

See how it works →
Filtering

Gaussian and Laplacian pyramids

A Gaussian pyramid keeps smaller, blurrier copies of an image. A Laplacian pyramid keeps the detail lost between those copies, plus the smallest copy needed to rebuild the image.

See how it works →
Matching

Template matching

Slide a patch across an image and score how well it agrees at each location.

See how it works →
Matching

Phase correlation

Estimate translation from the phase relationship between two images in the frequency domain.

See how it works →
Matching

ECC alignment

Refine a warp by maximizing enhanced correlation between an image and a template.

See how it works →
Features

ORB features

Detect oriented corners across an image pyramid and describe them with compact binary tests.

See how it works →
Features

SIFT features

Detect scale-space extrema and describe local gradient distributions around them.

See how it works →
Features

AKAZE features

Find and describe features in a nonlinear scale space that preserves important boundaries.

See how it works →
Features

BRISK features

Describe scale-space keypoints using intensity comparisons on concentric sampling rings.

See how it works →
Features

FAST corners

Look for a contiguous arc of brighter or darker pixels around a candidate centre.

See how it works →
Features

Shi-Tomasi and Harris corners

Find locations whose local gradients constrain motion in both image directions.

See how it works →
Features

Maximally stable extremal regions

Find connected regions that change little over a range of intensity thresholds.

See how it works →
Matching

Brute-force descriptor matching

Compare each query descriptor with every training descriptor using a chosen distance.

See how it works →
Matching

FLANN nearest neighbours

Organize descriptors so nearest-neighbour queries can avoid an exhaustive scan.

See how it works →
Geometry

Hough line detection

Let edge pixels vote for lines in a parameter space.

See how it works →
Geometry

Hough circle detection

Use edge and gradient evidence to find circular structures.

See how it works →
Motion

Lucas-Kanade optical flow

Follow selected points by finding the small displacement that best aligns each local patch.

See how it works →
Motion

Farneback dense optical flow

Estimate a displacement vector at every pixel using local polynomial approximations.

See how it works →
Motion

DIS dense optical flow

Combine fast patch alignment with spatial propagation and dense refinement.

See how it works →
Motion

Dual TV-L1 optical flow

Estimate flow with a robust data term and a total-variation smoothness penalty.

See how it works →
Motion

MOG2 background subtraction

Learn a mixture of colour distributions at each pixel and flag observations that do not fit the background.

See how it works →
Motion

KNN background subtraction

Classify a pixel using how many nearby samples in its recent history agree with it.

See how it works →
Motion

Kalman filtering

Combine a predicted state with a noisy observation using their estimated uncertainties.

See how it works →
Motion

CSRT tracking

Track an initialized object with correlation filters weighted by channel and spatial reliability.

See how it works →
Motion

KCF tracking

Use a kernelized correlation filter to locate a learned appearance in a local search region.

See how it works →
Motion

MIL tracking

Learn an online appearance classifier from bags of nearby positive and negative samples.

See how it works →
3D vision

Camera calibration

Estimate a camera’s intrinsic parameters and lens distortion from known target geometry.

See how it works →
3D vision

Lens undistortion

Invert a calibrated lens model to map distorted observations onto an idealized camera image.

See how it works →
3D vision

Perspective-n-point pose

Estimate a camera-relative object pose from known 3D points and their 2D image observations.

See how it works →
3D vision

Fundamental and essential matrices

Constrain where a point from one camera view can appear in another.

See how it works →
3D vision

Stereo block matching

Find horizontal correspondences between rectified stereo images using local block similarity.

See how it works →
3D vision

Semi-global stereo matching

Aggregate stereo matching costs along multiple directions while penalizing disparity jumps.

See how it works →
3D vision

Triangulation

Recover a 3D point by intersecting the viewing rays implied by multiple camera observations.

See how it works →
Detection

ArUco markers

Detect square coded markers and recover their identities and ordered corners.

See how it works →
Detection

QR code detection

Locate QR structures, rectify the code and decode its payload.

See how it works →
Colour

Histogram equalization

Redistribute grayscale intensities using their cumulative histogram.

See how it works →
Colour

CLAHE local contrast

Equalize local histograms while limiting how much a concentrated bin can amplify contrast.

See how it works →
Colour

Colour-space conversion

Re-express pixels in a different channel order or colour representation.

See how it works →
Colour

Colour range masks

Keep pixels whose channel values all lie within specified lower and upper bounds.

See how it works →
Signal

Discrete Fourier transform

Represent a signal as a combination of spatial frequencies.

See how it works →
Signal

Discrete cosine transform

Express a signal using cosine basis functions with an implicit even boundary extension.

See how it works →
Photography

Non-local means denoising

Average pixels whose surrounding patches look similar, even when they are not immediate neighbours.

See how it works →
Photography

Image inpainting

Fill a masked region by propagating nearby image structure and colour into it.

See how it works →
Photography

Seamless cloning

Blend a region by solving for pixel values that fit selected image gradients and boundary conditions.

See how it works →
Photography

HDR merging and tone mapping

Combine exposure information or fuse well-exposed regions, then map the result into a displayable range.

See how it works →
Filtering

Guided filtering

Use a guidance image to decide how a local linear model should smooth another image.

See how it works →
Morphology

Skeleton thinning

Iteratively remove boundary pixels while trying to preserve the connectivity of a binary shape.

See how it works →
Segmentation

SLIC, SEEDS and LSC superpixels

Group nearby pixels into small coherent regions to reduce the cost of later reasoning.

See how it works →
Machine learning

K-means clustering

Partition feature vectors around a fixed number of learned centres.

See how it works →
Machine learning

Support vector machines

Learn a decision boundary that balances class separation against margin violations.

See how it works →
Machine learning

K-nearest-neighbour classification

Predict a sample from the labels or values of nearby training examples.

See how it works →
Machine learning

Random forests

Combine decisions from trees that split feature space into regions.

See how it works →
Machine learning

Principal component analysis

Find orthogonal directions that explain the greatest variance in centred data.

See how it works →
Deep learning

Neural-network inference

Execute a trained model by passing tensors through its computation graph.

See how it works →
Detection

Non-maximum suppression

Reduce overlapping detector proposals by retaining the most useful scored boxes.

See how it works →
Deep learning

Learned super-resolution

Use a trained network to infer a higher-resolution image from a lower-resolution input.

See how it works →
Text

Tesseract OCR

Recognize text from image regions using supplied language data and a chosen page segmentation mode.

See how it works →
Text

Text-region detection

Find candidate text regions before character recognition.

See how it works →
Similarity

Perceptual image hashes

Compress selected visual statistics into a small representation for image comparison.

See how it works →
Similarity

PSNR and SSIM quality metrics

Measure selected differences or quality cues between images, or estimate quality without a reference.

See how it works →
Detection

Visual saliency

Estimate conspicuous regions or candidate object windows from appearance or motion.

See how it works →
Segmentation

Alpha matting

Estimate fractional foreground coverage using an image and a trimap of known foreground, background and unknown pixels.

See how it works →
Colour

White balance

Estimate channel gains or mappings that reduce an image’s illumination colour cast.

See how it works →
Photography

Panorama stitching

Combine overlapping images through matching, camera estimation, warping and blending.

See how it works →
3D vision

Iterative closest point

Refine the relative pose of two 3D surfaces by alternating correspondences and alignment.

See how it works →
3D vision

Structured-light decoding

Recover projector-camera correspondences from a sequence of known projected patterns.

See how it works →
Signal

Phase unwrapping

Recover a continuous phase field from measurements wrapped into a fixed angular interval.

See how it works →
Filtering

Retina-inspired processing

Apply a bio-inspired model with separate detail/colour and motion-sensitive processing pathways.

See how it works →