دليل الذكاء الاصطناعي المرئي
وظائف المسافة الموقعة
تصف دالة المسافة الموقعة (SDF) شكلاً من خلال إعطاء مسافة لأي نقطة في الفضاء إلى أقرب سطح، مع إشارة توضح ما إذا كانت النقطة داخل الشكل أم خارجه.
استمع إلى هذا الدليلرواه الذكاء الاصطناعي · ~9 min
في هذه الصفحة10 دقائق قراءة
نظرة عامة
المساحة هي أي مكان يكون فيه القيمة صفرًا. تدفع SDFs رسومات الموجات المارّة في الوقت الحقيقي، والمسح ثلاثي الأبعاد بالكاميرا العميقة، وطرق إعادة بناء ثلاثية الأبعاد العصبية مثل DeepSDF وNeuS.
النقاط الرئيسية
- ترجع دالة المسافة الموقعة المسافة إلى أقرب سطح، وتكون سالبة بالداخل وموجبة بالخارج وفقاً لاصطلاح DeepSDF.
- سطح دالة المسافة الموقعة هو مجموعة مستواها الصفري، ويُعطي تدرجها عند السطح المتجه العمودي.
- تتبع الكروية (Sphere tracing)، الذي وصفه جون سي هارت في عام 1996، دوال المسافة الموقعة عن طريق التحرك على طول كل شعاع بمقدار قيمة المسافة.
- تجميع SDFs اثنين هو min(a, b)، بينما ينتج التقاطع والطرح حدودًا للمسافة بدلاً من المسافات الدقيقة.
- ورقة Curless وLevoy 1996 في SIGGRAPH جمعت حتى 70 مسحًا للمدى إلى حجم مسافة موقّعة مدمجة مع وزن.
- DeepSDF في 2019 تمثلت فئة كاملة من أشكال ShapeNet بشبكة عصبية واحدة بحجم 7.4 ميغابايت.
الغوص العميق
A signed distance function, usually shortened to SDF, is a rule that takes any point in space and returns one number: how far that point is from the nearest surface of a shape. The sign carries extra information. By the most common convention, used in the DeepSDF paper, points inside the shape get negative values and points outside get positive values. The surface itself is the set of points where the function equals zero, called the zero level set. A sphere of radius r centered at the origin is the simplest example: its SDF is the length of the point's position vector minus r. A point 3 units from the center of a sphere of radius 1 has a value of 2, and the center has a value of -1. Because the description is a function rather than a list of triangles, it is called an implicit representation of the surface.
An SDF can come from three places. It can be written as a formula, as shader programmers do for spheres, boxes, capsules and tori. It can be stored as samples on a 3D grid of voxels, small cubes of space, with values between grid points interpolated. Or it can be learned by a neural network that takes a 3D coordinate as input and outputs the distance. In every case the same two operations matter: evaluating the distance at a point, and finding where the value crosses zero.
Rendering an SDF directly uses a technique called sphere tracing, described by John C. Hart in The Visual Computer in 1996. A ray leaves the camera. At each step the renderer evaluates the SDF at the current point. That value is the radius of a sphere guaranteed to contain no surface, so the ray can safely jump forward by exactly that much. Steps are long in empty space and shrink as the ray approaches a surface, and the loop stops when the value falls below a small threshold. The guarantee holds when the function never overstates the true distance, a property the paper ties to the Lipschitz condition, which limits how fast the function can change. The gradient of the SDF at the hit point gives the surface normal for lighting.
Combining shapes is where SDFs become a modeling tool. Given two SDFs a and b, the union of the shapes is min(a, b), the intersection is max(a, b), and subtracting a from b is max(-a, b). Smooth versions replace min and max with blended functions controlled by a radius k, producing organic joins without seams. Inigo Quilez's widely used reference of distance functions makes an important distinction: basic primitives such as the sphere and box are exact, while subtraction, intersection, smooth blends and non-uniform scaling produce bounds, values that are never larger than the true distance but may be smaller. Bounds still render correctly with sphere tracing but need more steps, and they can break effects that rely on true distances, such as soft shadows.
SDFs also became the standard way to merge real scans. In 1996 Brian Curless and Marc Levoy presented a volumetric method at SIGGRAPH that adds each range image into a cumulative weighted signed distance function stored on a grid, then extracts the zero isosurface. They showed the result is least-squares optimal under certain assumptions, integrated up to 70 range images, and produced models of about 2.6 million triangles. The DeepSDF authors credit that work and KinectFusion (Newcombe and colleagues, 2011) as the pioneers of truncated SDF fusion, in which distances are stored only near the surface. KinectFusion applied the idea in real time with a moving Kinect depth camera.
Neural SDFs arrived in 2019. DeepSDF, from researchers at the University of Washington, MIT and Facebook Reality Labs, trained an eight-layer fully connected network with 512-unit layers to output the SDF of a shape given a 3D point and a latent code, a short vector identifying which shape. Training samples 500,000 points per ShapeNet mesh, concentrated near the surface, and clamps distances to 0.1 so capacity is spent near the surface. One network represented an entire shape category in 7.4 MB, and the paper reports state-of-the-art shape reconstruction and completion from partial, noisy scans. In 2020 Implicit Geometric Regularization (IGR) showed that a network could be fit to raw point clouds with a loss that makes the function vanish on the points and keeps its gradient at unit length. In 2021 NeuS learned SDFs from photographs by deriving a volume-rendering formulation that is unbiased to first order at the surface, and reported better Chamfer distance than IDR and NeRF on the DTU benchmark.
Compared with the alternatives, SDFs trade explicitness for convenience. Triangle meshes are what graphics hardware draws fastest, but they make topology changes and inside-outside queries awkward. Occupancy fields store only inside or outside, which loses the distance information that sphere tracing and collision tests use. Point clouds have no surface at all. Density fields such as the original NeRF render well, but the NeuS authors note that extracting high-quality surfaces from them is difficult because the representation has too few surface constraints. An SDF gives a well-defined surface, cheap inside tests, smooth normals from the gradient, and arbitrary topology, and a mesh can always be extracted with Marching Cubes when one is needed.
The limitations are concrete. A sign requires a closed shape; the DeepSDF authors note that human-made meshes are often not watertight and contain internal structures that must be cleaned before distances can be computed. Grid SDFs grow with the cube of resolution, which is why fusion systems truncate them. Neural SDFs are limited by the number of sample points and the network's capacity, and they must be evaluated many times per ray. Learned functions are not guaranteed to be true distances everywhere, which is why IGR and NeuS add an Eikonal term that pushes the gradient length toward one. Optimization can also be slow: NeuS trained each scene for 300,000 iterations, about 14 to 16 hours on a single NVIDIA RTX 2080 Ti GPU.
In practice the cost depends on the representation. Analytic SDFs cost almost nothing to store and run in real time in a fragment shader. Voxel SDFs need memory proportional to the grid size but allow constant-time lookups. Neural SDFs compress shapes well, as DeepSDF's 7.4 MB category model shows, but each query is a full network evaluation, so rendering and mesh extraction need a GPU and careful sampling.
04عملت المثال
تتبع الشعاع على كرة باستخدام SDF
عرّف المشهد على أنه كرة نصف قطرها 1 في نقطة الأصل، بحيث تكون f(p) = length(p) - 1.
ابدأ شعاعًا من o = (0, 0, -5) باتجاه d = (0, 0, 1)، مع t = 0 وحدّ إصابة يبلغ 0.001.
قيّم f عند (0, 0, -5): المسافة هي 5 - 1 = 4، لذا تقدّم t إلى 4.
قيّم f عند (0, 0, -1): المسافة هي 1 - 1 = 0، وهو أقل من الحدّ، لذا أبلغ عن إصابة عند t = 4.
احسب المتجه العادي كتدرج f مُطبّع عند نقطة الإصابة، والذي في حالة الكرة هو موضع الإصابة مقسومًا على طوله، (0, 0, -1).
كرّر الأمر مع شعاع مُزاح جانبيًا، مثل o = (0.9, 0, -5)، واحسب عدد الخطوات التي يستغرقها بينما يلمس الشعاع الكرة.
ما يظهر
إصابة على مسافة 4 مع متجه عادي يشير عائدًا نحو الكاميرا، وُجدت في تقييمين. قارنها مع تقاطع الشعاع-الكرة التحليلي، الذي يعطي نفس t = 4، ولاحظ أن الشعاع اللمّاس يحتاج إلى عدد خطوات ملحوظ أكثر لأن قيم المسافة تبقى صغيرة بالقرب من السيلويت.
التنفيذ في العالم الحقيقي
يبني فنانون المُصيّرين مشاهد كاملة من بدائيات SDF دقيقة ويجمعونها باستخدام عوامل min وmax؛ صفحة Inigo Quilez المرجعية تُدرج الصيغ وتُشير إلى العمليات التي تحافظ على دقة المسافات.
دمجت طريقة Curless وLevoy من SIGGRAPH عام 1996 ما يصل إلى 70 مسحًا ليزريًا للمسافة في حجم مسافة موقّعة تراكمي موزون واستخرجت نماذج بحوالي 2.6 مليون مثلث.
مشروع KinectFusion من Microsoft Research، الذي تأسس عام 2011، تتبّع كاميرا عمق محمولة يدويًا ودمج إطاراتها في سطح ثلاثي الأبعاد في الوقت الفعلي، مستندًا إلى دمج SDF المقطوع.
درّب DeepSDF (2019) شبكة عصبية واحدة لتمثيل آلاف نماذج كراسي ShapeNet في 7.4 ميجابايت، وهو أقل من نصف حجم شبكة voxels واحدة غير مضغوطة بحجم 512 مكعب.
يعيد NeuS (2021) بناء أسطح الكائنات من صور عادية من خلال تعلّم SDF عصبي عبر التصيير الحجمي، وتم تقييمه على 15 مشهدًا من DTU تحتوي كل منها على 49 أو 64 صورة.
مستقبل وظائف المسافة الموقعة
Research since DeepSDF in 2019 has focused on making learned SDFs more accurate, faster and easier to train from ordinary data. IGR (2020) showed that a simple Eikonal regularizer can recover smooth surfaces from raw point clouds, and NeuS (2021) showed that photographs alone, without foreground masks, can supervise a neural SDF. Open problems named or implied in these papers include thin structures, non-watertight inputs, per-scene training times measured in hours, and the cost of evaluating a network many times along each ray. In graphics practice, analytic SDFs remain a staple of shader programming, and Inigo Quilez's reference continues to document which operators preserve exact distances. In scanning, the truncated SDF fusion approach that Curless and Levoy introduced in 1996 and KinectFusion ran in real time in 2011 remains a common baseline for depth-camera reconstruction. Whether future systems favor SDFs, density fields or explicit primitives for a given task is an active research question, and published benchmark results such as Chamfer distance on DTU are the reliable way to compare them.
وضعها موضع التنفيذ
لماذا يهم
- السرعة والحجم. يمكن للذكاء الاصطناعي المرئي أتمتة مهام الفحص والكشف ووضع العلامات على نطاق واسع.
- خيارات البناء. يمكن للفرق الإبداعية إنشاء نماذج أولية للمفاهيم بشكل أسرع مع عدد أقل من المراجعات اليدوية.
- الفريق وسير العمل. يمكن أن تستخدم العمليات إشارات الصور والفيديو التي كان من الصعب معالجتها في السابق.
احترس من
- يمكن أن تصبح حقوق الصور والموافقة مخاطر قانونية إذا كان المصدر غير واضح.
- يمكن أن يختلف أداء النموذج عبر الإضاءة والتركيبة السكانية والبيئات.
- قد تمر الإيجابيات الكاذبة دون أن يلاحظها أحد ما لم تتم مراقبة عتبات الثقة.
الخطوات التالية
- تحديد معايير القبول لتكاليف الدقة والاستدعاء والخطأ.
- اختبار مع البيانات التي تتوافق مع ظروف الإنتاج الحقيقية.
- أضف مراجعة بشرية للتنبؤات منخفضة الثقة أو عالية التأثير.
- تتبع انحراف النموذج وإعادة التحقق من صحته بعد تغيير الكاميرا أو مجموعة البيانات.
المصادر ومزيد من القراءة
- The Visual Computer (Springer)تتبّع الكرات: طريقة هندسية لتتبّع الأشعة المضادة للتحجيم للأسطح الضمنية
- ACM SIGGRAPH History Archiveطريقة حجمية لبناء نماذج معقدة من صور المدى
- Microsoft Researchصفحة مشروع KinectFusion
- arXiv (Facebook Reality Labs)DeepSDF: تعلم دوال المسافة الموقعة المستمرة لتمثيل الأشكال
- arXiv (ICML 2020)التنظيم الهندسي الضمني لتعلم الأشكال
- arXiv (NeurIPS 2021)NeuS: تعلم الأسطح الضمنية العصبية عن طريق تصيير الحجم لإعادة البناء متعدد الزوايا
- Inigo Quilezدوال المسافة
استمر في الاستكشاف
رسالة إخبارية مجانية
احصل على الإحاطة اليومية لمنظمة العفو الدولية
ثلاث قصص تم التحقق منها بواسطة الذكاء الاصطناعي كل صباح من أيام الأسبوع، مكتوبة باللغة الإنجليزية البسيطة. مجاني للأبد، بدون إعلانات.
بريد إلكتروني واحد كل يوم من أيام الأسبوع. إلغاء الاشتراك بنقرة واحدة. نحن لا نبيع أو نشارك عنوانك أبدًا.
اختبر نفسك
قم بإجراء اختبار دوال المسافة الموقعة
تعليقات فورية على كل إجابة، وشهادة قابلة للمشاركة مع معرف يمكن التحقق منه بمجرد اجتياز الدورة التدريبية.
دعم تعليم الذكاء الاصطناعي المجاني. AI Understanding هي منظمة 501(c)(3) غير ربحية - لا إعلانات ولا نظام حظر الاشتراك غير المدفوع على الإطلاق. قم بالتبرع
الأسئلة المتداولة
ما هي دوال المسافة الموقعة؟
تصف دالة المسافة الموقعة (SDF) شكلاً ما من خلال إعطاء المسافة إلى أقرب سطح لأي نقطة في الفضاء، مع إشارة توضح ما إذا كانت النقطة داخل الشكل أو خارجه. يقع السطح حيثما تكون القيمة صفراً. تُستخدم دوال SDF في رسومات تتبع الأشعة في الوقت الفعلي، والمسح ثلاثي الأبعاد بكاميرات العمق، وطرق إعادة البناء العصبي ثلاثي الأبعاد مثل DeepSDF وNeuS.
ما الذي ترجعه دالة المسافة الموقعة لنقطة ثلاثية الأبعاد معينة؟
تقوم قوات الدفاع الذاتي (SDF) بتعيين أي نقطة على بعدها عن أقرب سطح؛ تشير الإشارة إلى ما إذا كانت النقطة بالداخل (سلبية) أو بالخارج (إيجابية).
أين يقع السطح الفعلي لقوات الدفاع الذاتي (SDF)؟
السطح هو مجموعة النقاط التي تكون المسافة فيها صفرًا تمامًا، وهو الحد الفاصل بين الداخل والخارج.
أين تحقق دالة المسافة الموقعة الحقيقية شرط الإيكونال ذو التدرج الأحادي؟
تمتلك دالة SDF الحقيقية مقدار تدرج يساوي واحداً حيثما تكون قابلة للاشتقاق، وهو ما ينطبق في كل مكان تقريباً؛ أما عند النقاط غير الملساء مثل المحور الأوسط، فقد يكون التدرج غير معرف.
كيف يستخدم تتبع المجال قيمة SDF؟
نظرًا لأن قوة SDF تعطي المسافة إلى أقرب سطح، يمكن للشعاع أن يتقدم بأمان بهذا المقدار دون تجاوز الهدف، ويتكرر الأمر حتى يصل إلى الصفر.
ما الذي يستخدمه DeepSDF لتمثيل شكل معين؟
يقوم DeepSDF بتشفير كل شكل كمتجه كامن منخفض الأبعاد يعمل على تهيئة شبكة تتنبأ بـ SDF، مما يتيح أشكالًا مدمجة ومستمرة.
استمر في التعلم
أدلة ذات صلة
تم اختيار المزيد من الأدلة لهذا الموضوع