pixelshift op• Data kinds: rgbimage × matrix → video
• Call: import fullseye as fs; fs.ledger.pixel_shift_capture(scene, factor, shifts, pattern='RGGB', fill_factor=1.0, per_frame=False, margin=None) (to call the implementation directly, import pixelshift; pixelshift.pixel_shift_capture(scene, factor, shifts, pattern='RGGB', fill_factor=1.0, per_frame=False, margin=None); from the registry, opsoptics.get("pixel_shift_capture"))
Capture with a shifted sensor: integrate the scene exactly over the pixel aperture (a square box) and return Bayer or monochrome raw frames.
> The detailed description below is the original text — the summary and the headings are translated.
*scene*: 細かく描いたシーン。(Hs, Ws)(白黒)か (Hs, Ws, 3)(RGB)、有限の実数。1 センサ画素 = *factor* × *factor* 標本。per_frame=True なら先頭に枚数の軸 (N, Hs, Ws[, 3]) を持ち、枚ごとに違うシーン(搬送中のワーク・動く被写体)を撮る。*factor*: 1 センサ画素あたりのシーンの標本数(2〜64 の整数)。Hs・Ws はその倍数。*shifts*: (N, 2) の実際のシフト (dr, dc)[センサ画素] (pixel_shift_pattern の誤差込み)。センサが +dc 動くと、画素 (r, c) はシーンの c + dc を見る。*pattern*: "RGGB" などの Bayer(色フィルタはセンサと一緒に動く)か None(白黒。RGB のシーンなら各画素で 3 色を取る理想センサ = 真値づくり用で、返り値は (N, H, W, 3))。*fill_factor*: 画素の開口の一辺 / 画素の間隔(0 < f ≤ 1)。開口の MTF は |sinc(f · fill)|(f は cyc/px)。
*margin*: センサの (0, 0) 画素を置くシーンの升の番号 m(整数)。None なら m = ⌈max |shift|⌉(全シフトで開口がシーンの内側に残る最小の余白)。★真値(シフト 0 の理想センサ)と比べるときは、比べる相手と同じ m を明示すること —— シフト列が違うと既定の m が違い、同じ添字の画素がシーンの別の場所を指す。
画素 (r, c) の中心はシーンの座標(升の辺を整数にとる)で ((r + m + ½ + dr)·factor, (c + m + ½ + dc)·factor)。返す画像は H = Hs/factor − 2m、W = Ws/factor − 2m。積分は面積の総和表の双線形補間で行い、シーンを「升ごとに一定」とみなす限り誤差は丸めだけ(テストで 1e-12)。
返り値 (N, H, W) float64(Bayer か白黒)/ (N, H, W, 3)(pattern=None で RGB のシーン)。雑音は足さない(EMVA 1288 の雑音を足すなら呼び手で。この op は幾何と開口だけ)。
Raises ValueError: シーンの形・次元・非有限 / factor・fill_factor の範囲 / Hs・Ws が factor の倍数でない / シフトの形・大きさ / margin が負・シフトに足りない / per_frame で枚数がシフトと合わない / Bayer なのにシーンが RGB でない(Bayer は色を撮る)/ 残る画素が 8 × 8 未満。
Every optics op validates its input before computing (nothing slips through silently):
• Units are baked into the argument name — _mm / _um / _deg / _mrad. Confusing mm with µm does not crash; it yields a plausible-looking wrong answer, so the name prevents it. Nothing here guesses the unit from the magnitude.
• Strings raise ValueError — float('50') succeeds, so an unparsed configuration value would slip through as a length (measured: thin_lens('50', '200') returned a plausible 66.667 mm). bool is refused too, as the implicit promotion True == 1.
• complex / masked arrays raise ValueError (real-valued slots only; silently dropping the imaginary part or peeling off the mask is refused). NaN/Inf raises ValueError on every input.
• Division by zero and its relatives are refused by name: focal length 0, radius of curvature 0, refractive index <= 0, a fully opaque aperture (all zeros, so the normalisation is 0/0), a PSF whose sum is <= 0, a Stokes vector with S0 = 0, and an object sitting at the front focal point (the image is at infinity).
• Only two ops return a non-finite value, and both state it as a contract: depth_of_field returns far_mm = inf beyond the hyperfocal distance (that is what the hyperfocal distance means), and gaussian_beam returns wavefront_radius_mm = inf at the waist (the radius of curvature of a plane wavefront). Both also return a finite companion (far_is_infinite / curvature_per_mm). Any other silent NaN/Inf is detected internally and raises ValueError — "float64 overflowed" and "the answer is infinite" are different claims, so the first is never returned wearing the face of the second.
• Size caps: generated grids are capped by optics.MAX_GRID (4096); supplied fields/PSFs/apertures by optics.MAX_FIELD_ELEMENTS (2^24); ABCD element chains by optics.MAX_SYSTEM_ELEMENTS (1024); Zernike by MAX_ZERNIKE_TERMS (512) / MAX_ZERNIKE_ORDER (40) / MAX_ZERNIKE_BASIS (2^25). This closes, fail-closed, the paths where a small argument triggers a huge internal allocation (measured: n_max=40 × 4096² needs 108 GB).
• Physically impossible states are refused too: a Stokes vector with degree of polarisation > 1, negative transmittance, negative intensity, and invalid Zernike indices such as n-|m| odd.
• 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.
• poc_pixel_shift — py -3.11 examples/poc_pixel_shift.py
video as input)pixel_shift_merge · pixel_shift_motion_mask
pixelshift)pixel_shift_pattern · pixel_shift_merge · pixel_shift_motion_mask · false_color_metric · pixel_shift_resolution_budget
*Provenance: pixelshift.py — OPTICS 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.