Back to projects

Automated Coin Counting

Classical computer vision GUI that segments coin images, validates circular regions, groups coin sizes, and reports detected-vs-actual count accuracy.

ExperimentalClassical computer vision GUI / 2024-2025

Problem

Coin images vary in lighting, contrast, noise, background, and scale, so the tool needs preprocessing and validation before counting blobs.

Solution

Load an image in Tkinter, compute image statistics, apply needed preprocessing, segment with Otsu thresholding, validate circular regions, and compare counts with CSV labels.

Key Features

Tkinter GUI for uploading a coin image and viewing original/processed results side by side
Image-statistics based preprocessing for contrast, brightness, noise, dynamic range, saturation, and intensity clipping
Otsu threshold segmentation implemented in a reusable segmentation module
Conditional filtering module with mean, Gaussian, median, Laplacian, and Sobel filters
Connected-component scan that validates candidate coins by area, perimeter, circularity, and region intensity
Relative radius grouping into small, medium, and large coin buckets
CSV-backed comparison between detected and actual coin counts with an accuracy percentage
Repository assets for input, segmented output, and final detection overlay

Architecture Map

Mermaid
flowchart LR
  User["Tkinter GUI upload"] --> Loader["Pillow image load"]
  Loader --> Stats["Image statistics: brightness, contrast, saturation, range"]
  Stats --> Preprocess["Adaptive preprocessing: contrast, brightness, denoise, dynamic range"]
  Preprocess --> Segment["Otsu threshold segmentation"]
  Segment --> Filters["Conditional filters: mean, Gaussian, median, Laplacian, Sobel"]
  Filters --> Binary["Binary coin mask"]
  Binary --> Components["Connected-component scan"]
  Components --> Circles["Circle validation: area, perimeter, circularity, intensity"]
  Circles --> Sizes["Radius groups: small, medium, large"]
  Circles --> Accuracy["CSV lookup: detected count vs actual count"]
  Sizes --> UI["Original and processed panels with summary"]
  Accuracy --> UI

Coin Counting Screenshots

3 views
Representative input image from the repository dataset before segmentation and detection.
Otsu-thresholded segmentation output used to isolate coin-shaped regions from the background.
Processed detection overlay showing validated coin regions after filtering and circularity checks.