Detecting repeated circular objects (plates) in images using gradient-based keypoints, clustering, and ellipse fitting.
In many practical scenarios, we need to detect an unknown number of repeated objects in an image—for example, plates on a table, coins on a surface, or circular components on a production line. Deep object detectors can solve this, but they require annotated training data and heavier infrastructure.
This project takes a different route: use geometric and gradient-based cues to detect multiple plate-like objects without training a neural network. The method is inspired by multicut optimization for instance segmentation but uses clustering instead of solving a full graph partitioning problem.
The main challenges are handling overlapping plates, perspective distortion, and cluttered backgrounds that may contain edges unrelated to the plates.
Instead of learning from data, the algorithm relies on a combination of gradient information, geometric constraints, and clustering. The pipeline is:
Qualitatively, the detector identifies the correct number and location of plates in many scenarios where edges are clear and plates are not heavily occluded. The elliptical fits align well with true plate boundaries and remain stable to small perturbations.
The Gradio-based demo makes it easy to experiment: upload a new image and visually inspect which keypoints and ellipses are produced.
The porting required translating some of the graph-based logic into clustering-based logic better suited to Python’s ecosystem, without losing the core multicut-inspired idea of grouping consistent keypoints.
This project was a good exercise in geometric computer vision, unsupervised clustering, and turning a research-style algorithm into a practical tool with a friendly UI.