← all work classical-computer-vision

Coin counting

[![Python 3.10+](https://img.shields.io/badge/python-3.10+-3776AB?logo=python&logoColor=white)](https://www.python.org/)

Result

SrSceneOtsu + componentsAdaptive + componentsWatershed (global seed)Watershed (local maxima)**Hough circles**
1green felt · spread out18 of 2020 of 2020 of 2020 of 20**20 of 20**
2green felt · coins touching**1 of 20****1 of 20**7 of 2016 of 20**20 of 20**
3green felt · side-lit20 of 2020 of 2020 of 2020 of 20**20 of 20**
4white paper · coins darker than the table**1 of 20****25 of 20****1 of 20****1 of 20****20 of 20**

The finding

What it does

`mermaid flowchart LR A[Photo of touching objects] --> B["Flatten the illumination
white top-hat, kernel > largest coin"] B --> C[Otsu + clean + fill holes] C --> D1[Connected components] C --> D2["Watershed, GLOBAL seed
(the tutorial)"] C --> D3["Watershed, LOCAL maxima"] A --> D4["Hough circles
(a shape prior, not a region method)"] D1 & D2 & D3 & D4 --> E[Region properties
area, centroid, equivalent diameter] E --> F1["COUNT
right or wrong, no metric choice"] E --> G[Calibrate from ONE known object] G --> F2["MILLIMETRES
as good as the reference, and no better"]

style D3 fill:#dcfce7,stroke:#16a34a style D2 fill:#fee2e2,stroke:#dc2626 style F2 fill:#fef3c7,stroke:#d97706 `

Three things this separates that a segmentation demo runs together:

---

Figures

ui_ablation.png
ui_ablation
ui_calibration.png
ui_calibration
ui_main.png
ui_main
ui_measurements.png
ui_measurements
ui_method_matrix.png
ui_method_matrix
ui_seeds.png
ui_seeds

Elsewhere

Code and full results on GitHub (code private)

Every number is read from the file the run produced. github.com/hammasbuilds · kaggle.com/muhammadhammas13