https://github.com/efecanxrd/signature-recognition
Signature recognition using template matching and correlation
https://github.com/efecanxrd/signature-recognition
opencv signature signature-detection signature-recognition signature-validation signature-verification signatures template-matching
Last synced: 3 months ago
JSON representation
Signature recognition using template matching and correlation
- Host: GitHub
- URL: https://github.com/efecanxrd/signature-recognition
- Owner: efecanxrd
- License: mit
- Created: 2023-08-09T18:14:29.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-11T11:05:16.000Z (almost 2 years ago)
- Last Synced: 2025-01-15T11:50:00.098Z (5 months ago)
- Topics: opencv, signature, signature-detection, signature-recognition, signature-validation, signature-verification, signatures, template-matching
- Language: Python
- Homepage:
- Size: 147 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Signature Recognition
Signature recognition using template matching and correlation
![]()
Setup The Project
Download Dataset
https://www.kaggle.com/datasets/robinreni/signature-verification-dataset
Install the libraries with pip
pip install tkinter opencv-python pandas numpy Pillow
How this is working?
Uses the template matching technique in OpenCV to match the signature in an image with the signatures from the dataset.
First loads the image and converts it to grayscale using the cv2.imread and cv2.cvtColor functions. Next, we set a correlation value for template matching.As searches for the signature, it iterates over the folders in the dataset and loads each signature image. The code implements template matching using the cv2.matchTemplate function and checks if a match is found using the correlation value.
This function shifts the template image over the source image and calculates a similarity measure between the template and each region of the source image. The similarity measure used in this case is cv2.TM_CCOEFF_NORMED.The result of template matching is a 2D array of similarity values. The code uses the np.where function to find all locations in this sequence where the similarity value is greater than or equal to the correlation value.
![]()