0

I am trying to get a binarized fingerprint from a thumb scan image. I have achieved to eliminate noisy background. but I'm unable to find a filter which can help me achieve this. I have following processed image.

I want to extract fingerprint details in binarised form

I want to extract fingerprint details in binarised form. I have already tried,

    ret1,th1 = cv2.threshold(gray,48,80,cv2.THRESH_BINARY)

# Otsu's thresholding
ret2,th2 = cv2.threshold(gray,0,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)

# Otsu's thresholding after Gaussian filtering
blur = cv2.GaussianBlur(gray,(5,5),0)
ret3,th3 = cv2.threshold(blur,0,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)

images = [gray, 0, th1,
          gray, 0, th2,
          gray, 0, th3]

titles = ['Original Noisy Image','Histogram','Global Thresholding (v=127)',
          'Original Noisy Image','Histogram',"Otsu's Thresholding",
          'Gaussian filtered Image','Histogram',"Otsu's Thresholding"]

for i in range(3):
    plt.subplot(3,3,i*3+1),plt.imshow(images[i*3],'gray')
    plt.title(titles[i*3]), plt.xticks([]), plt.yticks([])
    plt.subplot(3,3,i*3+2),plt.hist(images[i*3].ravel(),256)
    plt.title(titles[i*3+1]), plt.xticks([]), plt.yticks([])
    plt.subplot(3,3,i*3+3),plt.imshow(images[i*3+2],'gray')
    plt.title(titles[i*3+2]), plt.xticks([]), plt.yticks([])
plt.show()

which gave me this

enter image description here

Also, I tried Catalano-Framework and Matlab binarization, all gave me black and white images. Any help is much appreciated.

4
  • I am not sure what you want exactly. The black and white images are binary. Could you specify your question a bit more?
    – alexblae
    Jan 24, 2019 at 13:41
  • Binarizing this image with the hope to detect the ridges is virtually hopeless. Insufficient contrast.
    – user1196549
    Jan 24, 2019 at 16:10
  • Thank you @YvesDaoust. I will look at enhancing contrast to achieve binarization then. Jan 25, 2019 at 13:02
  • @alexblae, I am trying to extract fingerprint from this image above. So trying out different filter. Visibly we can see clear fingerprint but extraction seems to be little difficult. Jan 25, 2019 at 13:05

1 Answer 1

-1

I play around with your image a bit in MATLAB. and I think Canny Edge Detector will work fine in your case. Check the resulted image. Original Image Vs Canny Edge Detected

I Hope this will help you. OpenCV-Python:

import cv2
import numpy as np

img = cv2.imread('thumbs_up.png',cv2.IMREAD_GRAYSCALE)
#Adjust the Range as per application
edges = cv2.Canny(img,50,200)
cv2.imshow('Output',edges)
cv2.waitKey(0)
2
  • I checked the image you have posted. Thanks for the inputs Amar, but i don't think this is going to give me clear fingerprint. I have also tried Canny and it is giving some random line as present in your image too. Jan 25, 2019 at 12:58
  • @RimjhimAgrawal. The image or code above is for demonstration purpose only. Am pretty sure that using edge detector with some morphological operations you can achieve results. But looks like you are not ready to invest time and play around with available tools, and looking for fast and easy solution. Image processing is an tricky thing. you always will be presented with new challenge all the time.
    – Amar P.
    Jan 26, 2019 at 13:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.