Sub-Pixel Circle Fitting for Wafer Via-Hole Inspection
Using VisionLab's circle fitting algorithm to measure wafer via-hole roundness at sub-pixel accuracy (<0.1px) on a 100% full-inspection production line.
Background
Via-hole roundness is a critical quality metric in PCB and semiconductor wafer fabrication. A deviation in hole circularity directly correlates with electrical impedance variance and long-term reliability risk. Traditional pixel-level inspection tools report Β±1β2 px error β insufficient for holes smaller than 200 Β΅m at 4Γ magnification.
This project integrates VisionLab's FitCircle module into an existing MES-connected inspection station, replacing the legacy threshold-based AOI system.
Algorithm Pipeline
VisionLab's circle fitting follows a multi-stage robust pipeline:
Annular ROI Masking β Edge Detection (Devernay subpixel) β Sector Segmentation (24Γ15Β°) β RANSAC 3-point Fit β Least-Squares Refinement
Annular ROI
Only pixels within the ring [inner_radius, outer_radius] around the estimated hole center are processed. This eliminates background clutter and reduces computation by 60β80%.
// Approximately 8 lines to set up VisionLab plugin and call the algorithm
PluginHostLauncher* launcher =
PluginHostLauncher_Create("visionlab.exe");
PluginHostLauncher_Launch(launcher, 5000);
PluginHostHandle* host = PluginHostLauncher_GetHost(launcher);
PluginHostImage img = { frame.data, frame.cols, frame.rows, 1 };
PluginHostResult result;
PluginHost_SendAndWait(host, &img, paramsJson, &result, 3000);
RANSAC + Least-Squares
Three randomly sampled sector centroids uniquely determine a circle. The RANSAC loop runs 1000 iterations, each time counting inliers within inlier_dist pixels of the candidate circle. After convergence, all inliers are fed into a LevenbergβMarquardt least-squares refinement:
Devernay Subpixel Edge
Unlike Canny (which snaps to integer pixel coordinates), Devernay's algorithm localises edges at sub-pixel positions by fitting a 1D quadratic to the gradient profile perpendicular to the edge direction:
This is the primary contributor to the < 0.1 px centre accuracy.
Results
| Metric | Value |
|---|---|
| Centre accuracy (Ο) | < 0.1 px |
| Radius accuracy (Ο) | < 0.2 px |
| Processing time per hole | < 15 ms |
| False-reject rate | 0.08% |
| Throughput | 240 wafers / hr |
Integration
The VisionLab Plugin SDK exposes a pure-C API, so the inspection station's existing C++ controller required no framework changes. The plugin process communicates via Windows shared memory (IPC), keeping latency under 2 ms per frame transfer.