r2_inner_circle — 2D region op

• Data kinds: region → region

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

• HALCON equivalent: inner_circle (the HALCON reference is a useful guide to its meaning and parameters)

r2_inner_circle: 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):

▸ r2_inner_circle: knob a sweep (docs site)

*Knob b does not change the output (measured: identical at 0.1 / 0.5 / 0.9).*

Stages (the ops that come before → this op, left to right):

▸ r2_inner_circle: stages (docs site)

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

▸ r2_inner_circle: other inputs (docs site)

Usage

Largest inscribed circle drawn as a mask (a scales drawn radius; a=0.5=exact).

Draws the largest inscribed circle of the region as a mask. The input is turned into a foreground mask with > 0.5; scipy.ndimage.distance_transform_edt gives the distance from each foreground pixel to the nearest background pixel, and the pixel giving its maximum r0 is taken as the centre (cy, cx) (if there are several maxima, the first pixel in row-major order). The radius drawn is r = r0 * (0.6 + 0.8*a): 0.6 times at a=0, r0 as is at a=0.5, 1.4 times at a=1 (a is clipped to [0,1]; 0.5 if non-finite). b is unused.

The return value is a float64 0/1 mask of the same shape as the input (disc (y-cy)^2+(x-cx)^2 <= r^2). All zeros if there is no foreground. Coordinates are (row, col).

Note: r0 is "the distance to the centre of a background pixel", so even at a=0.5 the drawn disc may stick out of the region's edge by about 1 pixel (measured: 2 outside pixels for a 10x20 rectangle, and for a disc of radius 7, 12 outside pixels). If you want it strictly inside, lower a a little. Even when the region consists of several connected components, there is only 1 inscribed circle (that of the thickest component). A 3-dimensional array (H,W,C) is flattened to (H, W*C), so do not pass colour images. Upstream use threshold or select_largest; the paired circumscribed circle is r2_smallest_circle (the ratio of the two radii is a rough measure of roundness).

Detailed usage guide

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

threshold 0.50 0.50
r2_inner_circle 0.50 0.50

▸ Load this pipeline  ·  Load & run

Runnable examples (verified samples that actually call this op)

• gallery2d_region — py -3.11 examples/gallery2d_region.py

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

identity · reg_erode · reg_dilate · reg_open · reg_close · fill_holes · select_largest · remove_small

Same category (region)

reg_erode · reg_dilate · reg_open · reg_close · fill_holes · select_largest · remove_small · invert_region


*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.