Goal
Recover a correspondence between a detected corner graph and a checkerboard model graph when the pattern is partially occluded, leaves the field of view, or contains spurious edges from background clutter. Input: a candidate graph of detected saddle-point corners with edges between grid-neighbour corners, and a checkerboard model graph of known dimensions. Output: a partial, non-injective, non-surjective mapping covering as many vertices as possible while tolerating missing and extra vertices and edges.
Algorithm
Let denote the candidate graph delivered by an upstream corner-graph builder, and the checkerboard model graph. Let and . Let denote the subpixel-refinement window size of the upstream refiner, which doubles as the lower bound on corner-to-corner distance. Let denote the BFS neighbourhood of out to depth in . For a candidate , let denote the BFS distance from an anchor vertex .
The number of neighbours of that belong to at least one -cycle of :
where . The anchor is .
A candidate passes the consistency check iff every edge length is at least and the sample standard deviation of edge lengths is smaller than the sample mean:
The quad filter restricts to vertices that are corners of some -cycle:
Triangles and isolated edges are discarded; the surviving graph may split into several connected components.
Given anchor , the vertices of are totally ordered by BFS distance . The first in this order induce
Ties in are broken arbitrarily but deterministically.
On VF2 success or failure at iteration , the subgraph size updates by a halving step:
where the sign is when the previous iteration matched and when it did not.
Procedure
- Reject if .
- Reject if fails the spatial-consistency check.
- Apply the quad filter to obtain ; restrict accordingly.
- Keep only the largest connected component of ; discard the rest.
- Select the anchor ; compute BFS distances over .
- Initialise , , .
- Repeat: build from the nearest-to-anchor vertices; call ; increment . On success, commit and set . On failure, set . Stop when stops moving.
- If , grow the match by BFS from 's frontier: for each unassigned neighbour of a matched vertex, add it to , re-run VF2, keep the extension iff it succeeds.
- Return .
Implementation
The binary-search driver is the algorithmic core — it treats VF2 as a black-box exact-match engine and converges by halving.
type VertexId = u32;
type Mapping = Vec<(VertexId, VertexId)>;
fn ocpad_match(
g_d: &Graph, g_m: &Graph,
anchor: VertexId, order: &[VertexId],
vf2: &dyn Fn(&Graph, &Graph) -> Option<Mapping>,
) -> Option<Mapping> {
let n = order.len();
let mut n_prev = n;
let mut n_i = n;
let mut best: Option<Mapping> = None;
for i in 1.. {
let g_i = g_d.induce(&order[..n_i]);
let step = ((n as f64) * 2f64.powi(-(i as i32))).round() as isize;
match vf2(&g_i, g_m) {
Some(m) => {
best = Some(m);
n_prev = n_i;
n_i = (n_i as isize + step).clamp(0, n as isize) as usize;
}
None => {
n_i = (n_i as isize - step).clamp(0, n as isize) as usize;
}
}
if n_i >= n_prev && best.is_some() { break; }
if step == 0 { break; }
}
best
}
Region growing runs after this converges: for each unassigned neighbour of a matched vertex, the caller extends by one vertex and re-runs VF2, committing the extension only on a valid mapping.
Remarks
- The algorithm consumes a corner graph and produces only a mapping; it does not detect corners, refine subpixel locations, or estimate intrinsics. Those stages live in the upstream detector and the downstream calibration solver.
- Runtime is dominated by the inner VF2 calls. Because the checkerboard graph is strongly connected, the binary search usually converges in a number of iterations logarithmic in ; on fragmented inputs it degenerates to linear region-growing.
- The vertex threshold and the spatial-consistency check are pre-filters that reject garbage before VF2 runs. They do not help a valid partial pattern — they cheapen the rejection of wrong candidates.
- The quad filter excises every triangle and isolated edge, which removes most background clutter before matching. A spurious diagonal inside an otherwise valid quad is tolerated downstream by the error-tolerant driver.
- Failure modes: candidates with fewer than half the model vertices are dropped at step 1; genuine patterns with ambiguous anchor placement (no clear quad-density maximum, e.g. a uniform fragment) yield slower, less reliable matches; multiple disconnected components of the candidate graph are resolved by keeping only the largest, which drops real corners on the smaller side.
- VF2 can be swapped for any exact subgraph-isomorphism routine; the binary-search driver and the region-growing step are independent of the matcher.
- Compared with GP enhancement (Hillen 2023): OCPAD is combinatorial — it matches the detected corner graph against the model graph by exact subgraph isomorphism and requires no training. The GP method is regression — it learns the board-to-pixel map from a partial allocated set and predicts missing corners by interpolation/extrapolation, requiring at least a partial board fragment as training data but extending naturally beyond the image border. The two are complementary: OCPAD recovers a partial visible subgraph; GP enhancement fills in occluded or out-of-frame corners with smooth refinement.
References
- P. Fürsattel, S. Dotenco, S. Placht, M. Balda, A. Maier, C. Riess. OCPAD — Occluded Checkerboard Pattern Detector. IEEE WACV, 2016. DOI: 10.1109/WACV.2016.7477565
- S. Placht, P. Fürsattel, E. A. Mengue, H. Hofmann, C. Schaller, M. Balda, E. Angelopoulou. ROCHADE: Robust Checkerboard Advanced Detection for Camera Calibration. ECCV, 2014. DOI: 10.1007/978-3-319-10593-2_50
- L. P. Cordella, P. Foggia, C. Sansone, M. Vento. A (Sub)Graph Isomorphism Algorithm for Matching Large Graphs. IEEE TPAMI, 2004. DOI: 10.1109/TPAMI.2004.75