decode_fringe — 3D structured_light op

• Data kinds: images → depth

• Call: import fullseye as fs; fs.ledger.decode_fringe(phase_shift_images, ref_phase=None, k=1.0, mask=None, min_modulation=None) -> 'np.ndarray' (implementation को सीधे call करना हो तो import fringe; fringe.decode_fringe(phase_shift_images, ref_phase=None, k=1.0, mask=None, min_modulation=None) -> 'np.ndarray', registry से लेना हो तो ops3d.get("decode_fringe"))

उपयोग

phase-shift image series को एक साथ decode करता है: wrapped → unwrap → (reference घटाकर) height।

phase_shift_images: N-step phase-shifted fringe images की sequence ((N,H,W) या length N की sequence)।

ref_phase: reference plane (height 0) की unwrapped phase। None होने पर height = k·(unwrapped)।

k: phase→height calibration constant।

mask: optional। True=valid pixel। invalid pixels NaN होते हैं।

min_modulation: optional। देने पर modulation < इस मान वाले pixels को कम भरोसेमंद मानकर invalid किया जाता है।

return value: height map (2D float)। ref_phase=None होने पर k से गुणा की गई continuous phase लौटाई जाती है। invalid pixels NaN होते हैं।

प्रक्रिया (implementation के अनुसार): wrapped_phase → confidence mask बनाना (अगर min_modulation दिया हो तो modulation(stack) >= min_modulation, अगर mask दिया हो तो उसके साथ AND) → unwrap_phase_2d(wrapped, mask=confidence mask) → ref_phase None हो तो k * unwrapped, वरना phase_to_height (k * (unwrapped - ref_phase))।

Arguments:

• phase_shift_images: (N, H, W), N >= 3, बराबर अंतराल वाले phase shifts।

• ref_phase: scalar या (H, W)। reference surface की उसी प्रक्रिया से unwrap की गई phase दें (ताकि unwrap_phase_2d का global offset दोनों में एक जैसा लिया जाए, reference के लिए भी इसी op से ref_phase=None के साथ decode किया गया result इस्तेमाल करना सबसे सुरक्षित है)।

• k: phase→height calibration constant (unit/rad)। यह synthesize_fringes के phase_gain के व्युत्क्रम के बराबर है।

• mask: (H, W) का bool, True = valid। min_modulation: modulation depth की निचली सीमा (लगभग [0, 1]; shadow और saturation वाले pixels हटाता है)।

validation (ValueError): image sequence 3-D न हो, N < 3, non-finite / mask का shape अलग हो / ref_phase का shape अलग हो / valid pixels शून्य हों। scikit-image न हो तो RuntimeError।

return value: (H, W) float64। invalid pixels NaN। unit k की unit है।

सावधानी: यह spatial unwrapping पर निर्भर है, इसलिए steps या occlusion से islands में बँटे दृश्यों में हर island में 2πm k का height offset रह सकता है। absolute height चाहिए तो रास्ता है graycode_decode → absolute_phase → triangulate_column।

पृष्ठभूमि guides (इस op के पीछे की physics और conventions)

• depth_sensors — Depth sensors — ranging के सिद्धांत, असली devices के आँकड़े, dropouts कैसे दिखते हैं

संदर्भ (sample data, साहित्य)

• Sample data catalog (DL URL / license) — 2-D के लिए skimage.data (BSD/public) + synthetic, 3-D के लिए real data sources (Stanford/PDS आदि) के DL URL।

• Operators का स्रोत और संदर्भ — इस op family के मूल research/methods के स्रोत।

चलाए जा सकने वाले उदाहरण (verified samples जो सच में यह op call करते हैं)

• structured_light — py -3.11 examples_3d/structured_light.py

वे अगले ops जिनसे type जुड़ता है (depth को input के रूप में लेते हैं)

depth_to_points · tsdf_from_depth · to_points · fuse_to_voxel · depth_to_organized_points · normals_from_depth · occlusion_edges · bearing_angle_image

इसी category के (structured_light)

wrapped_phase · unwrap_phase_2d · graycode_decode · synthesize_fringes · absolute_phase · triangulate_column


*Provenance: fringe.py — 3D operator registry. यह per-op note tools/opdocs.py md से अपने-आप generate होता है (हाथ से edit न करें)।*

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