🍽️ Multiple Object Recognition (Plates)

Detecting repeated circular objects (plates) in images using gradient-based keypoints, clustering, and ellipse fitting.

Role

Algorithm design, porting, and deployment (solo project)

Timeline

2024 · Personal project

Tech

Python, OpenCV, DBSCAN, Gradio (originally C++ + andres-graph)

Plate detector preview with detected ellipses

TL;DR

Problem & Context

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.

Data & Inputs

The main challenges are handling overlapping plates, perspective distortion, and cluttered backgrounds that may contain edges unrelated to the plates.

Approach & Algorithm

Instead of learning from data, the algorithm relies on a combination of gradient information, geometric constraints, and clustering. The pipeline is:

Results & Qualitative Behavior

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.

Implementation

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.

Challenges & Lessons Learned

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.

Links

Live Demo on Hugging Face Spaces  ·  GitHub Repository  ·  Back to all projects