aifantry
Back to Case Studies

CurveTrace: Parametric Bézier Curve Detection for Fraunhofer IGD

How we co-developed CurveTrace for Fraunhofer IGD — a parametric Bézier curve detection engine with sub-pixel accuracy and 40% outlier tolerance, adopted in AUV vision, CAD digitisation, and handwriting recognition.

Project Duration:2 months
Industry:Information Technology
Published:May 20, 2026
Tools Used
  • C++17
  • Python
  • OpenCV
  • Eigen3
  • pybind11
  • FastAPI
  • ROS
  • NumPy
  • SciPy
Curve trace featured image

Who Fraunhofer IGD Are

The Fraunhofer Institute for Computer Graphics Research (IGD) is the world's leading applied research institution in visual computing. Founded in 1987 and operating from Darmstadt, Rostock, Kiel, Graz, and Singapore, Fraunhofer IGD employs over 200 scientists and engineers across 15 competence centres covering computer graphics, computer vision, virtual and augmented reality, and digital ocean technology.

The Rostock branch specialises in maritime visual computing: 3D visualisation, underwater computer vision, and object detection for autonomous underwater vehicles (AUVs), remotely operated vehicles (ROVs), and coastal infrastructure inspection. The institute's model sits at the intersection of frontier academic research and deployable industrial prototypes — it builds algorithms that get reused across multiple downstream projects, not papers that stop at publication.

What makes working with Fraunhofer IGD technically distinctive: the software has to meet two standards simultaneously — rigorous enough to publish at CVPR or ECCV, and practical enough to run on robotic hardware in maritime field conditions.

The Problem

The computer vision community has mature tooling for detecting straight-line primitives — Hough transforms, LSD, SOLD2. For Bézier curves specifically, the picture is different.

Classical approaches run in two stages: detect edge pixels, fit a piecewise-linear polyline, then post-hoc fit a Bézier to the polyline. The compounding approximation error in that chain — edge localisation error, then polyline quantisation, then Bézier fitting on already-approximated data — makes sub-pixel control-point accuracy structurally impossible. Every downstream application that needs the actual curve geometry is working around a fundamental limitation baked into the approach.

According to Grand View Research's Computer Vision Market Report (February 2026), the global computer vision market was valued at $21.37 billion in 2024 and is projected to grow at a CAGR of 19.6% through 2030, with industrial inspection and robotics vision as the two fastest-growing application segments. The growth is real, but the precision requirements are increasing: autonomous inspection systems need geometric measurements at tolerances that polyline-approximated curves cannot reliably hit.

Fraunhofer IGD needed direct parametric detection: an algorithm that fits Bézier control points to raw image data, tolerates significant outlier contamination (maritime imaging involves occlusion, motion blur, and poor contrast), and runs fast enough for robotic pipeline integration. The applications waiting on this capability included AUV cable and pipe tracking for seafloor inspection, CAD drawing digitisation, and handwriting analysis for historical document processing.

According to Gartner's 2025 Hype Cycle for Emerging Technologies (August 2025), edge-deployed computer vision systems have entered the Slope of Enlightenment, marking adoption driven by implementation precision rather than technology availability. The gap is no longer "can we detect it" — it is "can we measure it accurately enough for the application." CurveTrace was built for exactly that gap.

What We Built

CurveTrace is a parametric Bézier curve detection engine that detects cubic and quadratic Bézier primitives directly from 2D image data. The pipeline: edge detection → curvature-aware RANSAC hypothesis generation → Levenberg-Marquardt nonlinear refinement → curvature-continuity smoothing across adjacent segments. Implemented in C++17, with Python bindings via pybind11, a FastAPI REST wrapper, and a ROS2 node for robotic deployment.

Verified properties on the benchmark dataset:

  • Direct Bézier fitting — no polyline intermediate, no post-hoc approximation
  • Sub-pixel control-point accuracy across varying image resolutions
  • 40% outlier tolerance at medium difficulty tier (verified against 5,000+ annotated images)
  • Multi-scale coverage via Gaussian pyramid
  • Batch processing with a parallel thread pool for high-throughput pipelines

The algorithm was subsequently adopted within Fraunhofer IGD for three downstream projects: AUV cable and pipe tracking, historical handwriting recognition, and CAD digitisation.

How We Built It

Edge Detection and Pre-Stage Preparation

The pre-stage runs Canny edge detection with adaptive threshold selection — the threshold is computed per-image from the gradient histogram rather than fixed, which handles the contrast range variation in maritime imaging. Sub-pixel edge localisation refines edge positions beyond the pixel grid using gradient interpolation. This matters because RANSAC's accuracy ceiling is set by the quality of the input edge points.

Sobel gradient maps run in parallel for orientation estimation, filtering edge points whose gradient direction is inconsistent with a curve's local tangent — a pre-filter that reduces the effective outlier rate before RANSAC sampling begins.

Curvature-Aware RANSAC

Standard RANSAC for Bézier detection samples three-point minimal sets randomly from the edge point cloud. The problem: Canny edge maps contain far more locally-linear segments than curved ones, even in images with prominent arcs. Uniform random sampling almost always selects minimal sets implying near-zero curvature. The hypothesis generator is statistically biased against the primitives it is supposed to find.

The fix is a curvature-prior filter on minimal set selection. Before passing any three-point set to refinement, we compute the unsigned curvature of the circumscribed arc. Sets below a curvature threshold are rejected and resampled. The threshold is adaptive — set to the 30th percentile of arc curvatures computed on 500 random three-point samples per image — making it stable across scenes with different absolute curvature scales.

This filter reduced the RANSAC iteration count required for 99% detection probability by approximately 60% on the benchmark dataset. It also removed the orientation bias introduced by earlier approaches that weighted sampling by gradient direction.

Levenberg-Marquardt Refinement

Each accepted minimal set seeds a Bézier hypothesis, which Levenberg-Marquardt refines by minimising the sum of squared perpendicular distances from inlier edge points to the fitted curve. LM was chosen over pure Gauss-Newton because the Bézier parameter space has local minima when the initial control-point estimate is poor — the LM damping parameter manages the gradient-descent-to-Gauss-Newton transition automatically.

The inlier distance threshold is derived per-image from the gradient map's estimated noise level, not fixed in pixels, tying the threshold to actual image quality.

Curvature-Continuity Constraints

For multi-segment inputs — common in CAD and handwriting — the algorithm enforces G1 continuity at junctions: tangent directions at shared endpoints are constrained to be collinear, implemented as a weighted penalty in the LM objective. The weight is tunable: higher values produce smoother multi-segment output at the cost of fitting accuracy on sharp corners.

Python, REST, and ROS Integration

The C++17 core exposes to Python via pybind11 with zero-copy NumPy array interoperability. A FastAPI REST endpoint handles JSON requests for non-Python pipeline architectures. The ROS2 node subscribes to standard camera topics and publishes detected primitives as typed BezierCurve messages — this is the integration layer used in Fraunhofer IGD's AUV vision stacks.

Benchmark Dataset

No public parametric Bézier detection benchmark existed — public datasets like Wireframe measure polyline detection, which uses incompatible metrics. We built one: 5,000+ annotated images across three difficulty tiers, generated by a calibrated synthetic renderer with controlled noise, occlusion, and contrast variation matched to maritime imaging conditions. Ground-truth control points are stored per image. Evaluation uses mAP on control-point detection and Hausdorff distance between detected and ground-truth curves.

What Made It Hard

The RANSAC Minimal Set Degeneracy

The opening describes the core problem — but the fix was not the first approach. We first tried orientation-guided sampling: weighting edge point selection probability by gradient orientation deviation from a reference direction. This reduced collinear sampling but introduced a different bias — curves at orientations that happened to align with dominant background gradients were oversampled; others were missed.

The curvature-prior approach using the circumscribed arc is orientation-agnostic. It measures the property we actually need — "is this minimal set geometrically consistent with a curved primitive?" — rather than using orientation as a proxy. The benchmark improvement (60% fewer required iterations) only emerged after switching from orientation weighting to curvature filtering. This is the kind of lesson that is obvious only after you have tried the wrong thing first.

Sub-Pixel Accuracy Under Maritime Imaging Conditions

Maritime conditions break most standard CV assumptions: low contrast between cables and seafloor sediment, partial occlusion by marine growth, and motion blur from AUV translation. Fixed Canny thresholds produce either over-detected noisy edges or under-detected gap-filled curves on this data.

The adaptive threshold handles contrast variation. For occlusion specifically, we added a gap-bridging step: if LM refinement produces an inlier set with a gap exceeding a length threshold, the algorithm projects the fitted Bézier arc through the gap and re-tests pixels along the projected path against the edge map. This recovered correct detection on approximately 15% of the benchmark images at medium difficulty — the tier that most closely matched real AUV imaging conditions.

Building a Valid Benchmark Without Any Existing Reference

The synthetic dataset calibration — ensuring generated images had noise and occlusion statistics matching real maritime imaging, without overfitting to specific test conditions — took more iteration than the algorithm itself.

The critical step was matching the gradient noise distribution of synthetic images to a sample of real Fraunhofer AUV footage. We extracted empirical noise histograms from the real footage and parameterised the synthetic renderer to match them. The renderer went through four calibration iterations before mAP on synthetic images reliably correlated with performance on the real footage validation set.

What Changed

Three downstream projects within Fraunhofer IGD adopted CurveTrace directly:

1. AUV vision pipeline — CurveTrace runs as a ROS2 node for real-time underwater cable and pipe detection; the direct Bézier output feeds the path-following controller without a polyline conversion step, removing a source of tracking error in high-curvature cable sections 2. Historical document digitisation — the handwriting recognition pipeline uses CurveTrace to extract stroke geometry before character classification; sub-pixel control-point accuracy improved segmentation precision on overlapping handwriting versus the polyline approach it replaced 3. CAD digitisation — scanned engineering drawings processed with CurveTrace yield parametric curve primitives for CAD reconstruction; G1 continuity constraints produce cleaner multi-segment output than post-hoc fitting

The 5,000+ annotated benchmark dataset is a standalone research contribution — reused by subsequent researchers within the institute working on related geometric primitive detection problems. For computer vision work in quality control and inspection, the reusable evaluation infrastructure often has longer-term value than the algorithm it was built to benchmark.

What's Next

The CurveTrace architecture has clear extension paths in scoping or active research:

  • Deep learning hybrid — a CNN-based control-point proposal network trained on the benchmark dataset, with CurveTrace as the refinement stage; would reduce RANSAC iteration count on high-occlusion inputs and handle curves not well-represented in edge maps
  • 3D point cloud extension — Bézier surface patch detection in LiDAR and structured-light scans; the LM core generalises directly, the pre-stage needs replacing with a 3D boundary detector
  • Real-time video tracking — temporal tracking using Kalman filter prediction to warm-start RANSAC from the previous frame's detections; substantially reduces per-frame computation for AUV applications
  • CAD reverse engineering pipeline — full end-to-end conversion of scanned engineering drawings to parametric CAD format, integrating CurveTrace with a semantic layer classifying curve types by manufacturing intent

Parametric Curve Detection — Common Questions

What is the difference between parametric Bézier curve detection and standard edge detection? Standard edge detectors (Canny, Sobel) produce a binary edge pixel map or a polyline approximation. Parametric Bézier detection skips the polyline stage and fits the control-point geometry — the actual mathematical representation — directly to image data. The practical difference matters for any downstream application that needs to manipulate, measure, or reconstruct the curve: a polyline is a fixed discretisation, a Bézier parameterisation is a continuous mathematical object you can differentiate, offset, extend, or transform exactly. For path planning or CAD reconstruction, this is not an optimisation — it is a requirement.

Why use RANSAC + Levenberg-Marquardt rather than a deep learning detector for curve detection? Deep learning curve detectors have been demonstrated for constrained cases — short strokes, handwritten characters, structured line drawings. For research-grade applications requiring sub-pixel accuracy, interpretable uncertainty bounds, and deployment on resource-constrained embedded hardware without a GPU, the classical pipeline is more practical. RANSAC + LM produces accuracy bounds that can be derived formally from the noise model and runs in C++ at frame rates compatible with robotic systems. A hybrid approach — CNN proposals as RANSAC seeds — is the likely next step for high-occlusion inputs. The classical refinement stage stays either way.

How do you build a benchmark dataset for a problem type with no existing public reference data? Key steps: (1) build a synthetic renderer that produces images with physically plausible noise and occlusion for your target conditions; (2) calibrate the renderer against real data by matching empirical noise and gradient histograms — this step is consistently underestimated; (3) generate across multiple difficulty tiers so results are interpretable. "40% outlier tolerance" is a meaningful claim when you state which difficulty tier it applies to, and a meaningless one if you do not. The CurveTrace renderer went through four calibration iterations before synthetic and real-image mAP reliably correlated. If you need custom AI training data annotation infrastructure alongside algorithm development, that is a separate workstream we run concurrently.

Can CurveTrace be integrated into an existing Python or ROS computer vision pipeline? Yes — pybind11 bindings give zero-copy NumPy array interoperability from Python. The ROS2 node subscribes to standard camera topics and publishes typed BezierCurve messages. A FastAPI REST endpoint handles architectures where neither Python nor ROS is the integration layer.

The most time-consuming part of CurveTrace was not the algorithm — it was the benchmark dataset. Building valid ground truth for a problem class with no public reference data, and calibrating a synthetic renderer to real maritime imaging conditions, took more engineering effort than the Levenberg-Marquardt implementation. That is usually how research engineering goes: the infrastructure for measuring correctness is harder than the system being measured.

If you are working on a computer vision problem that requires research-grade algorithm development or geometric primitive detection for a robotic or industrial system, explore our case studies to see related work, or book a discovery call to discuss your specific problem.

Written By

Abrar A.

Founder, AIfantry | AI Engineer

Ready to achieve similar results?

Our team of AI experts is ready to help you transform your business with tailored AI solutions.

Contact Us Today