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.
- C++
- OpenCV Library
- Cmake (3.31.0+)
git clone https://github.com/rc0609/coin-recognition.git
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.
string imagePath = "C:/Users/rdire/Documents/coin-recognition/img/test_img/coin1.jpg";
Test images:
coins1.jpgcoins2.jpgmultiple-coin.jpgcoins-without-quarter.jpg
string imagePath = "<Username>/img/test_img/coins1.jpg";
The program operates under the following constraints:
- 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.
- 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.jpgdemonstrates this error.
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.