Skip to content

Signature recognition using template matching and correlation

License

Notifications You must be signed in to change notification settings

efecanxrd/Signature-Recognition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Signature Recognition

Signature recognition using template matching and correlation

Setup The Project

Download 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.