xdog — 2D edges op

• Data kinds: image → image

• Call: fullseye.apply(img, "xdog", a=0.5, b=0.5) (the 2-D model is one image plus two scalar knobs a,b∈[0,1])

xdog: input → output

*The figure is the actual output on a synthetic 128×128 input. Left: input, right: output. Point clouds are drawn as a top-down scatter (brightness = z), 1-D series as a line plot, volumes as the maximum-intensity projection along z, videos as the middle frame, complex images as magnitude; return values that are not pictures are shown as the values themselves.*

Sweeping knob a (0.1 / 0.5 / 0.9, the other knob at its default):

▸ xdog: knob a sweep (docs site)

Sweeping knob b (0.1 / 0.5 / 0.9, the other knob at its default):

▸ xdog: knob b sweep (docs site)

On other images (synthetic scene / photo / coins. Top row: inputs, bottom row: their outputs. Knobs at default):

▸ xdog: other inputs (docs site)

*The 4th column is a colour (H,W,3) input. This op handles colour without crossing channels (it does not convolve the colour channel as a third spatial axis).*

Usage

XDoG (extended difference of Gaussians; Winnemoller, Kyprianidis and Olsen 2012): line-art / ink-drawing stylisation.

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

D = G_sigma - tau * G_(k sigma) を作り(G はガウシアンのぼかし)、ソフト閾値 T(u) = 1 (u >= eps)、1 + tanh(phi (u - eps)) (u < eps) を通す。出力は 0〜1 で、紙の白(1)の上に、縁の暗い側だけが黒(0)に沈む。tau = 1 なら D は通常の DoG、phi を無限大にすると閾値は D >= eps の二値(DoG の符号)になる。

a がぼかしの幅 sigma = 0.5 + 2.5a(0.5〜3.0)を、b が閾値の位置 eps = 0.1b(0〜0.1)を振る。sigma は線の太さと拾う縁の大きさ、eps を上げると平坦部も黒く沈み(tau < 1 のとき明るい平坦部の D は (1 - tau) x 明るさ で、最大 0.02)、墨を塗ったような絵になる。残りは固定: k = 1.6、tau = 0.98、phi = 50(D の振れは縁で ±0.1 前後なので、遷移幅は約 0.02)。

端の扱い: 端の画素を複製する(最近傍)。

適用条件: (1) 出力は入力の明るさの階調を捨てる(ほぼ二値)。計測には使わず見せ方のための op。(2) tau を 1 にしない既定では、真っ白な平坦部は D = 0.02 で eps を 0.02 超に上げると黒くなる。(3) 雑音の多い画像は sigma を上げないと雑音が線になる。

Detailed usage guide

• gallery2d_edges 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.

Try it in Studio

The program below has been verified to run (same input as the figure). In Studio's help this block becomes buttons that load and run it on the spot.

xdog 0.40 0.50

▸ Load this pipeline  ·  Load & run

Runnable examples (verified samples that actually call this op)

• gallery2d_edges — py -3.11 examples/gallery2d_edges.py

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

identity · gaussian · mean_box · bilateral · kuwahara · unsharp · median · min_filter

Same category (edges)

sobel_mag · prewitt_mag · roberts_mag · dog · edge_transition_width · grad_dir · log · corner_response


*Provenance: ops.py — 2D 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.