Skip to content

rc0609/coin-recognition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Coin Recognition / Computer Vision Project

About this project

Coin recognition is a challenging task in the world of Computer Vision since the patterns of coins are updating time to time. Other factors such as scaling, lighting, and rotation differences also prevents Coin recognition from being a feasible task. Our goal of this project is to create a program that detects coin, classify each coin by calculating its relative ratio to the quarter coin, and display the analysis of total count and the number of each coin, penny, dime, nickel, quarter.

Prerequisites

  • C++
  • OpenCV Library
  • Cmake (3.31.0+)

How to run this program

1. Clone the repository

git clone https://github.com/rc0609/coin-recognition.git

2. Edit your image path

After cloning the repository, you need to specify the path to the image you want to process. This step ensures the program knows where to find the input image.

1. Open coin-detection.cc file in any text editor:

2. Locate the following code in the file in line 13:

string imagePath = "C:/Users/rdire/Documents/coin-recognition/img/test_img/coin1.jpg";

3. Choose one of the test images provided in the img/test_img directory or use your own image:

Test images:

  • coins1.jpg
  • coins2.jpg
  • multiple-coin.jpg
  • coins-without-quarter.jpg

4. Update the imagePath variable with the path to your chosen image. For example:

string imagePath = "<Username>/img/test_img/coins1.jpg";

5. Save the changes to the coin-detection.cc file

2. Run the program using CmakeLists.txt

Program constraints

The program operates under the following constraints:

1. Test Image Angle

  • The test image must be taken from a top-down (overhead) perspective to ensure accurate detection and classification of coins.
  • Angled or side-view images may lead to errors in coin detection and size estimation.

2. Presence of a Quarter

  • The program classifies each coin by calculating its size relative to a quarter.
  • A test image without a quarter may result in classification errors or incomplete analysis.
  • coins-without-quarter.jpg demonstrates this error.

3. Supported Coins:

The program is designed to recognize and classify the following U.S. coins:

  • Penny
  • Nickel
  • Dime
  • Quarter

Other coins or foreign currency may not be accurately detected.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •