orientation_code — CODEMATCH code op

• Data kinds: image2d → image2d

• Call: import fullseye as fs; fs.ledger.orientation_code(image, n_codes=16, grad_thresh=0.05) (to call the implementation directly, import codematch; codematch.orientation_code(image, n_codes=16, grad_thresh=0.05); from the registry, opscodematch.get("orientation_code"))

Usage

Orientation-code image: gradient direction quantised into n_codes steps (the OCM coding).

> The detailed description below is the original text — the summary and the headings are translated.

θ = atan2(∂I/∂行, ∂I/∂列) を [0, 2π) に取り(Sobel、縁は最近傍で延長)、floor(θ / (2π/N)) を符号 0..N-1 にする。|∂I/∂列| + |∂I/∂行| <= grad_thresh の画素は無効符号 N(雑音しか無い所の向きは信用しない)。

grad_thresh は [0, 1] の明るさで測った Sobel の和の閾値。既定 0.05 は、8 ビットの量子化雑音(σ = 1/255)が作る和の平均(約 0.022)の 2 倍強。n_codes は 4 の倍数(既定 16 = 22.5° 刻み)。返りは int16 の 2 次元配列。

明るさに定数を足しても符号は 1 つも変わらない。明るさを g 倍したときは grad_thresh も g 倍すれば同じ符号になる。画像を 90° 回すと、符号は N/4 だけ巡回してずれる(np.rot90 で反時計回りなら -N/4)。

Detailed usage guide

• robust_code_matching family guide

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• (none yet)

Ops the type connects to (they accept image2d as input)

increment_sign · ocm_match · isc_match · scc_match · radial_reach_filter

Same category (code)

increment_sign


*Provenance: codematch.py — CODEMATCH operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.