OCPAD: Occluded Checkerboard Pattern Detection | VitaVision
Back to atlas

OCPAD: Occluded Checkerboard Pattern Detection

7 min readIntermediateView in graph
Based on
OCPAD — Occluded Checkerboard Pattern Detector
Fürsattel, Dotenco, Placht, Balda et al. · IEEE WACV 2016
DOI ↗

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 Gd=(Vd,Ed)G_d = (V_d, E_d) of detected saddle-point corners with edges between grid-neighbour corners, and a checkerboard model graph Gm=(Vm,Em)G_m = (V_m, E_m) of known dimensions. Output: a partial, non-injective, non-surjective mapping M:VdVmM : V_d \to V_m covering as many VdV_d vertices as possible while tolerating missing and extra vertices and edges.

Algorithm

Let Gd=(Vd,Ed)G_d = (V_d, E_d) denote the candidate graph delivered by an upstream corner-graph builder, and Gm=(Vm,Em)G_m = (V_m, E_m) the checkerboard model graph. Let N=VdN = |V_d| and Nm=VmN_m = |V_m|. Let ww denote the subpixel-refinement window size of the upstream refiner, which doubles as the lower bound on corner-to-corner distance. Let BFSk(v)\mathrm{BFS}_k(v) denote the BFS neighbourhood of vv out to depth kk in GdG_d. For a candidate vVdv \in V_d, let Da(v)D_a(v) denote the BFS distance from an anchor vertex aa.

Definition
Quad density

The number of BFS3\mathrm{BFS}_3 neighbours of vv that belong to at least one 44-cycle of GdG_d:

ρ(v)  =  {uBFS3(v):uquad(Gd)},\rho(v) \;=\; \bigl|\,\{u \in \mathrm{BFS}_3(v) : u \in \mathrm{quad}(G_d)\}\,\bigr|,

where quad(Gd)={u:  4-cycle in Gd through u}\mathrm{quad}(G_d) = \{u : \exists\; \text{4-cycle in } G_d \text{ through } u\}. The anchor is a=argmaxvVdρ(v)a = \arg\max_{v \in V_d} \rho(v).

Definition
Spatial consistency

A candidate GdG_d passes the consistency check iff every edge length is at least ww and the sample standard deviation of edge lengths is smaller than the sample mean:

mineEdewσ(Ed)<μ(Ed).\min_{e \in E_d} |e| \geq w \quad\wedge\quad \sigma(|E_d|) < \mu(|E_d|).
Definition
Quad filter

The quad filter restricts VdV_d to vertices that are corners of some 44-cycle:

Vd={vVd:vquad(Gd)}.V_d' = \{\,v \in V_d : v \in \mathrm{quad}(G_d)\,\}.

Triangles and isolated edges are discarded; the surviving graph may split into several connected components.

Definition
Nearest-to-anchor subgraph

Given anchor aa, the vertices of VdV_d are totally ordered by BFS distance DaD_a. The first NiN_i in this order induce

Gi  =  Gd[{vVd:rank(Da(v))Ni}].G_i \;=\; G_d[\,\{\,v \in V_d : \mathrm{rank}(D_a(v)) \leq N_i\,\}\,].

Ties in DaD_a are broken arbitrarily but deterministically.

Definition
Binary-search update

On VF2 success or failure at iteration ii, the subgraph size updates by a halving step:

Ni  =  round ⁣(Ni1  ±  2iN),N_i \;=\; \operatorname{round}\!\left(N_{i-1} \;\pm\; 2^{-i}\,N\right),

where the sign is ++ when the previous iteration matched and - when it did not.

Procedure

Algorithm
OCPAD — occluded checkerboard pattern detection
Input: Candidate corner graph Gd=(Vd,Ed)G_d = (V_d, E_d) from an upstream builder; checkerboard model graph Gm=(Vm,Em)G_m = (V_m, E_m); upstream subpixel-window size ww.
Output: Partial mapping M:VdVmM : V_d \to V_m, or \bot if the pattern is not recoverable.
  1. Reject if Vd<0.5Vm|V_d| < 0.5\,|V_m|.
  2. Reject if GdG_d fails the spatial-consistency check.
  3. Apply the quad filter to obtain VdV_d'; restrict EdE_d accordingly.
  4. Keep only the largest connected component of (Vd,Ed)(V_d', E_d'); discard the rest.
  5. Select the anchor a=argmaxvρ(v)a = \arg\max_{v} \rho(v); compute BFS distances DaD_a over VdV_d'.
  6. Initialise N0=NN_0 = N, i=0i = 0, MM \leftarrow \bot.
  7. Repeat: build GiG_i from the NiN_i nearest-to-anchor vertices; call MiVF2(Gi,Gm)M_i \leftarrow \operatorname{VF2}(G_i, G_m); increment ii. On success, commit MMiM \leftarrow M_i and set Ni=round(Ni1+2iN)N_i = \operatorname{round}(N_{i-1} + 2^{-i} N). On failure, set Ni=round(Ni12iN)N_i = \operatorname{round}(N_{i-1} - 2^{-i} N). Stop when NiN_i stops moving.
  8. If M<Mtarget|M| < |M_{\text{target}}|, grow the match by BFS from MM's frontier: for each unassigned neighbour of a matched vertex, add it to GiG_i, re-run VF2, keep the extension iff it succeeds.
  9. Return MM.

Implementation

The binary-search driver is the algorithmic core — it treats VF2 as a black-box exact-match engine and converges NiN_i 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 GiG_i 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 NN; on fragmented inputs it degenerates to linear region-growing.
  • The 50%50\% 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

  1. 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
  2. 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
  3. 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