contour_fourier_complex — SHAPE2D descriptor op

• Data kinds: pairs → matrix

• Call: import fullseye as fs; fs.ledger.contour_fourier_complex(points, n_harmonics=None, parametrisation='index') (implementation को सीधे call करना हो तो import fourierdesc; fourierdesc.contour_fourier_complex(points, n_harmonics=None, parametrisation='index'), registry से लेना हो तो opsshape2d.get("contour_fourier_complex"))

उपयोग

बंद contour को complex Fourier series के गुणांकों में बदलता है — z(t) = Σ c_k exp(2πi k t)।

arguments:

points: (N,2) के closed contour के शीर्ष। (row, col) क्रम (fourierdesc जैसा)।

n_harmonics: रखा जाने वाला order K (|k| <= K)। None हो तो जहाँ तक दर्शाया जा सके।

parametrisation: "index" = point के index को बराबर अंतराल वाला parameter बनाना /

"arclength" = पहले arc length पर बराबर अंतराल से दोबारा sample करके फिर transform करना।

return value: (2K+1, 3) का real array (matrix)। rows [k, Re c_k, Im c_k] हैं, और k 0, 1, -1, 2, -2, … है (कम आवृत्ति से)।

★parameter चुनने का तरीका default में चुपचाप तय न करना इस op का मूल है। असमान रूप से sample किए गए contour को "index" से पढ़ने पर, जहाँ points घने हैं वहाँ अतिरिक्त समय बँट जाता है, और तस्वीर मिलती-जुलती दिखती है पर coefficients अलग होते हैं (मापन में k=3 का coefficient 47 गुना अलग था)। default "index" है (FFT का सीधा अर्थ), पर shape के वर्णन के रूप में इस्तेमाल करना हो तो "arclength" चुनें।

★★"arclength" चुनने पर op के अंदर contour दोबारा sample होता है, इसलिए लौटे coefficients दिए गए array का नहीं, बल्कि दोबारा sample किए गए contour का वर्णन करते हैं। इसलिए contour_fourier_truncation_energy की भविष्यवाणी "दोबारा sample किए गए contour के लिए" सटीक है, और caller अपने array पर error मापे तो मेल नहीं खाता (मापन: 512 points पर 1.15 का अंतर)। अपने array के लिए सटीक भविष्यवाणी चाहिए तो पहले arc length से दोबारा sample करें और फिर "index" से call करें।

★arc length resampling idempotent नहीं है: samples को chord से जोड़ा जाता है, इसलिए पहले से समान arc length वाले contour पर 1 बार और लगाने पर points अधिकतम 3.73 px खिसकते हैं (औसत 0.84 px), और लंबाई और 3.25 % सिकुड़ जाती है। दो बार न लगाएँ।

उपयोग की विस्तृत guide

• shape_description_2d family guide

संदर्भ (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 के स्रोत।

• Algorithm का मानक स्रोत (लेखक, वर्ष) और उपयोग ऊपर की family usage guide में दिए गए हैं।

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

• poc_one_stroke_epicycles — py -3.11 examples/poc_one_stroke_epicycles.py

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

contour_epicycle_chain · contour_fourier_truncation_energy

इसी category के (descriptor)

elliptic_fourier · reconstruct · invariants · normalize · descriptor_distance · fourier_smooth · from_xld · contour_epicycle_chain


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

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