FAST (Features from Accelerated Segment Test)

FAST (Rosten & Drummond, 2006) is a corner detector designed for one thing: speed. Instead of computing image gradients and a structure tensor (Harris/Shi-Tomasi) or building a scale space (SIFT), FAST decides corner-ness with a handful of intensity comparisons on a small circle of pixels — cheap enough to run on every pixel of every frame at high frame rates, which made it the default detector for real-time SLAM front-ends (PTAM, SVO, and via ORB, the ORB-SLAM family).

The segment test

Consider a candidate pixel pp with intensity IpI_p and the 16 pixels on a Bresenham circle of radius 3 around it. Pixel pp is declared a corner if there exists a contiguous arc of at least nn pixels on that circle that are all significantly brighter or all significantly darker than pp, given a threshold tt:

xarc:Ix>Ip+torxarc:Ix<Ipt\forall x \in \text{arc}: \quad I_x > I_p + t \qquad \text{or} \qquad \forall x \in \text{arc}: \quad I_x < I_p - t

The classic choice is n=12n = 12 (FAST-12: 12 of 16 pixels), which admits a very effective high-speed test: examine only the four compass pixels (top, right, bottom, left — positions 1, 5, 9, 13). If a 12-pixel contiguous arc exists, at least three of these four must be brighter than Ip+tI_p + t or darker than IptI_p - t; if fewer than three pass, pp is rejected after just four comparisons. Since the vast majority of image pixels are not corners, this early exit dominates the average cost.

The machine-learned variant

The hand-coded compass test has two weaknesses: it does not generalize to n<12n < 12, and the fixed questioning order is not optimal for real image statistics. Rosten & Drummond therefore learned the detector: each of the 16 circle pixels is classified relative to IpI_p as brighter / darker / similar, and a decision tree (built with the ID3 algorithm, maximizing information gain) learns the pixel-query order that classifies corners with the fewest expected comparisons on training imagery. The tree is compiled into nested if-statements. This is how FAST-9 (n=9n = 9) — usually the most repeatable variant — is made practical, and it is what OpenCV’s cv::FastFeatureDetector implements.

Non-maximum suppression

The segment test fires on many adjacent pixels around a single corner. To keep one response per corner, a corner score is computed for each detection,

V=max ⁣(xSbright(IxIp)t,    xSdark(IpIx)t),V = \max\!\left( \sum_{x \in S_{\text{bright}}} (I_x - I_p) - t,\;\; \sum_{x \in S_{\text{dark}}} (I_p - I_x) - t \right),

i.e., the largest total contrast of the supporting arc, and non-maximum suppression keeps only local maxima of VV in a 3×3 neighbourhood. In SLAM front-ends, detections are additionally bucketed over an image grid so features cover the whole frame rather than clustering on one textured region.

Variants

What FAST does not give you

Why it matters for SLAM

Feature detection runs on every frame inside the tracking loop, so its cost directly bounds the achievable frame rate on embedded hardware. FAST made a full detect-describe-match pipeline real-time on CPUs — PTAM used FAST for tracking, SVO seeds its depth filters at FAST corners, VIO front-ends (VINS-Mono, MSCKF implementations) detect FAST corners and track them with KLT, and ORB (oFAST + rBRIEF) turned it into the complete feature of the ORB-SLAM family. Knowing the segment test also explains FAST’s failure modes you will observe in practice: responses on edges under noise, clustering on high-contrast texture, and sensitivity to motion blur (the circle contrast collapses when gradients smear).

Hands-on