Computer VisionAuthor:

Turkish Currency Recognition with OpenCV

A desktop application that classifies Turkish coins and banknotes from image features and presents the result through a PyQt5 interface.

PythonOpenCVNumPyPyQt5
Turkish Currency Recognition with OpenCV

About the Project

This desktop application recognizes Turkish coins or a banknote from an uploaded photograph and reports its monetary value. Coins and banknotes follow separate image-processing pipelines, while a PyQt5 interface brings file selection, recognition mode, and visual output together.

Goal

The project explores how currency denominations can be distinguished with classical computer-vision techniques and how detected coin values can be accumulated automatically.

How It Works

  • Coin images are smoothed with a median filter, converted to grayscale, and thresholded.
  • Contours are extracted and small regions are discarded. Image moments provide the center coordinates of each remaining coin.
  • Contour areas are mapped to configured denomination ranges, from 5 kuruş to 1 TL. Labels are drawn on the image and values are added to a running total.
  • Banknote images are converted to HSV. A mask is generated for each configured denomination range, and the mask with the largest number of matching pixels determines the result.
  • interface.py sends the selected file to the appropriate recognizer and renders the processed image in the Qt window.

Technologies

  • Python: application flow and classification rules.
  • OpenCV: filtering, thresholding, contour analysis, HSV masking, and annotations.
  • NumPy: color boundaries and contour result handling.
  • PyQt5: desktop interface with file selection and image preview.

Project Structure

  • interface.py: UI and coordination of both recognition modes.
  • madeni_para_tanimlama.py: contour-area coin classification.
  • banknot_tanimlama.py: HSV-mask banknote classification.

Technical Highlights

  • Dedicated pipelines for coins and banknotes
  • Center detection through contour moments
  • Comparison of multiple denomination-specific HSV masks
  • Automatic accumulation of detected coin values

Technical Notes

Classification uses fixed area and color thresholds. This keeps the implementation transparent and fast in controlled scenes, but changes in scale, lighting, or background require recalibration.

Source Code

View the project on GitHub.