/coin_counter

Coin Counter using OpenCV

Primary LanguageJupyter Notebook

COINTADOR: A Coin Counter Brazilian Real and Dollar

This work aims to count coins in images using only the OpenCV library and Python 3.7

📚 Libraries (requirements.txt)

  • certifi==2020.6.20
  • numpy==1.19.2
  • opencv-contrib-python==4.4.0.44
  • opencv-python==4.4.0.44
  • PyYAML==5.3.1
  • wincertstore==0.2

Install the libraries needed for this work:

    { pip install -r requirements.txt }        

✔️ Run First Steps

1. Clone repository

Clone this repository from Github.

2. Detect Coins

2.1 Command to detect coins Brazilian Real:
    { python main.py -o real }
2.2 Command to detect coins Dollar:
    { python main.py -o dollar }

3. Result images

3.1 Result for Coins Brazilian Real:
    { image_result/real/ }
3.2 Result for Coins Dollar:
    { image_result/dollar/ }

📈 Step-by-Step Image Results

Coins Brazilian Real

Step 1: Read Image

InputReal

Step 2: Convert BGR Image to Grayscale

GrayReal

Step 3: Blur Image

BlurReal

Step 4: Detect circles with HoughCircles and Final Result

CirclesReal

Coins Dollar

Step 1: Read Image

InputDollar

Step 2: Convert BGR Image to Grayscale

GrayDollar

Step 3: Binary Segmentation

SegDollar

Step 4: Apply Morphological Transformations

MorphoDollar

Step 5: Detect circler with SimpleBlobDetector and Final Result

CirclesDollar