Use Case

Shape Centroid Algorithm for Real-Time Industrial Vision

When only position data is needed, sending full images to a PC wastes time and bandwidth. Our customized camera solution preloads the Shape Centroid Finder algorithm in its FPGA, delivering real-time centroid coordinates at the sensor level. This eliminates round-trip latency and maintains stability under challenging lighting and perspective conditions.

Real-time circle matrix detection using the Shape Centroid Finder. The algorithm runs inside the camera, providing instant centroid coordinates for AR surgical alignment without external processing.
Real-time circle matrix detection using the Shape Centroid Finder. The algorithm runs inside the camera, providing instant centroid coordinates for AR surgical alignment without external processing.

Where the Shape Centroid Finder earns its keep

Precision positioning is central to every inspection and robotic system. In most vision-guided tasks, the controller doesn’t need a full image. It only needs the object’s precise location. The Shape Centroid Algorithm converts complex visual data into deterministic, sub-pixel, low-latency coordinates that remain stable under real-world distortions, providing the most actionable input for any vision-based control system.

Shape Centroid Finder helps to compute per-ball centroids in dense arrays to verify presence, pitch, and skew at line speed.

Semicon & electronics- alignment

All vision tasks start with alignment. Shape Centroid Finder computes per-ball centroids in dense arrays, enabling precise alignment, pitch measurement, and presence verification at line speed.
AR glasses for sugical operations benefits from camera features such as shape centroid finder to do accurate spacial positining

Augmented reality- spatial positioning

The Shape Centroid Finder delivers accurate spatial coordinates that keep the virtual overlay aligned between the surgical knife and the patient’s lesion area.
Intensity-weighted centroids per cell enable rapid counting, density metrics, and motion tracks.

Life sciences- cell counting & motility

Intensity-weighted centroids per cell or sperm head enable rapid counting, density metrics, and motion tracks.

Solving engineering challenges in a production-grade centroid

Running a shape centroid finder on an industrial PC is easy for demonstrations but difficult to achieve production-grade reliability. Embedding the algorithm inside the camera’s FPGA adds real value. It removes noise sensitivity, OS jitter, and data overhead, giving system engineers repeatable sub-pixel results with deterministic timing.

Center of mass for common geometric shapes: circle, rectangle, triangle, and square. In machine vision, these shapes often serve as fiducial marks or alignment targets, where precise centroid detection ensures accurate registration and motion alignment.
Center of mass for common geometric shapes: circle, rectangle, triangle, and square. In machine vision, these shapes often serve as fiducial marks or alignment targets, where precise centroid detection ensures accurate registration and motion alignment.

Sub-pixel accuracy and robustness in factory condition

At first glance, the centroid formula looks simple, but in practice, achieving sub-pixel accuracy that is repeatable and robust is difficult because:

  • Noise and lighting variations distort intensity weights, especially near ROI edges.

  • Thresholding and segmentation strongly affect which pixels enter the calculation.

  • Non-Gaussian spots or overlapping blobs, distorts the intensity distribution.

  • Camera response nonlinearity and 8-bit quantization can shift weighted averages.

To address these issues require careful filtering, adaptive thresholding and local fitting and all these will add compute cost and latency. Hardware-based centroid computation inside the camera executes the same logic every frame, eliminating these variations and ensuring consistent results.


How the shape centroid finder algorithm finds the true center
How the shape centroid finder algorithm finds the true center

Deterministic timing and simplified integration

PC-based centroid processing suffers from OS jitter, bandwidth limits, and complex synchronization, making real-time alignment and control unreliable.

With the Shape Centroid Finder embedded in the camera’s FPGA, centroid data is computed and timestamped at the source, achieving microsecond-level determinism. Only compact coordinate data, typically (x, y, θ, quality), is transmitted. , reducing host load and ensuring stable, scalable performance.

This hardware-level integration eliminates software dependencies and maintenance overhead, delivering consistent, real-time operation across production environments.

Interested? Discuss your needs with us


Many customers don’t realize how much more they can do with the camera itself. Take the Shape Centroid Finder as an example — many users buy industrial cameras just to capture images and depend entirely on external software for centroid calculation. With the Shape Centroid Finder built in, our cameras output ready-to-use coordinates directly, eliminating PC-side processing. By understanding the application in detail, we help customers unlock and maximize the camera’s built-in capability for greater efficiency and value.
Enso Tseng
Enso Tseng
System Analysis | R&D

Beyond finding the centroid: comprehensive shape feature analysis

In addition to precise centroid coordinates, the same on-camera processing can extract advanced geometric features such as aspect ratio, roundness, area, and perimeter. These parameters provide deeper insight into object shape and quality, enabling inspection tasks like solder ball uniformity, nozzle wear detection, or particle classification.

Once these feature values are generated, the camera can further analyze and count how many objects fall within or outside defined tolerances. With these analytics computed directly in the FPGA, engineers gain instant, actionable shape data without added latency or host processing.

Why partner with Basler

  • Smart vision at the sensor level – Basler integrates the Shape Centroid Finder directly into the camera’s FPGA, turning each device into a smart, deterministic vision sensor for real-time positioning and control.

  • Proven industrial reliability – Basler’s camera hardware and firmware are designed for consistent, repeatable performance over years of operation, ensuring stable results and minimal maintenance in production environments.

  • Partnership beyond hardware – Basler’s technical experts work closely with engineers on optical setup, synchronization, and algorithm tuning, helping customers optimize precision, throughput, and scalability across diverse inspection lines.


Contact us for this custom vision solution!

Our experts are happy to advise you on your individual vision project.