An Implementation of Fingerprint Detection with Python

Vyshnavi Madikonda
Spider R&D
Published in
3 min readJan 5, 2022

Fingerprint recognized ✅

Do you know? How do smartphones, laptops, and biometric scanners recognize your fingerprint? How does it scan very quickly? How does it work? Did u ever think of creating a fingerprint detection?

That is what this article is about! So, let’s start with the basic execution of fingerprint detection using python.

What is Fingerprint Detection?

Fingerprint Detection refers to the automated method of identifying or verifying a match between two human fingerprints.. Fingerprint Detection is one of the most well-known biometrics, and it is by far the most used biometric solution for authentication on computerized systems.

Now let’s peek at how it works.

How does it work?

Fingerprint scanners work by capturing the pattern of ridges and valleys on a finger. There are two separate stages involved in using a system. First, you have to go through a process called enrollment, where the system learns about all the people it will have to recognize. As a finger rests on the touch-capacitive surface, the device measures the charge; ridges exhibit a change in capacitance, while valleys produce practically no change at all. The sensor uses all this data to accurately map out prints. During enrollment, each person’s fingerprints are scanned, analyzed, and then stored in a coded form on a secure database. Typically it takes less than a half-second to store a person’s prints.

Once enrollment is done, the system is ready to use and this is the second stage known as verification. Anyone who wants to gain access has to put their finger on a scanner. The scanner takes their fingerprint, checks it against all the prints in the database stored during enrollment, and decides whether the person is entitled to gain access or not. The performance of minutiae extraction algorithms and other fingerprint recognition techniques relies heavily on the quality of the input fingerprint images.

Fingerprint scanners turn analog fingerprints into a digital (numerical) form that computers can store process, and compare.

How fingerprints are stored and compared?

A computer can compare fingerprints by identifying key features- a bit like drawing lines between them and then measuring the distances and angles between them. Algorithms can turn patterns like this into unique numeric codes. Comparing fingerprints is then simply a matter of comparing unique codes. If the codes match, the prints match, and the person gains access.

Now, let’s dive into the code.

Importing the necessary libraries and modules

import cv2
import numpy as np
import os

The files in the database and test file should be in the TIF format and we would like to keep it that way as they are flexible and adaptable.

Viewing the test file (fingerprint to be matched)

Matching with the database

Now we will be using SIFT ( Scale-Invariant Feature Transform) algorithm here. It is an image descriptor for image-based matching. This descriptor as well as related image descriptors are used for a large number of purposes in computer vision related to point matching between different views of a 3-D scene and view-based object recognition. So, here we shall use it to identify the key points and descriptors of both the test image and database images.

After the detection and the computation are over, we start the matching algorithm. Now we will use FlannBasedMatcher() functionality here. It contains a collection of algorithms optimized for fast nearest neighbour search in large datasets and high dimensional features. So, this interface helps us in performing a quick but efficient matching using the Cluster and Search algorithm. We shall maintain an array of such matching points.

Detecting the fingerprint matched ID

Now we use cv2.drawMatches() function to define the key point detection margin and then visualize the output after drawing the matching key points.

Conclusion:

The algorithm helps to recognize the biometrics of different human beings. It includes minutiae extraction and minutiae matching, and a similarity score is generated which tells if the fingerprints are similar. A high false rejection rate and incorrect acceptance rate tell us that the algorithm is not as efficient and is vulnerable if the images are scaled or deformed.

References:

Code: Github

Learning resources: Documentation

YouTube: OKOKPROJECTS

This article is published under Spider Research and Development Club, NIT Trichy on Web Wednesday!

--

--