Utkarsh-Deshmukh/Fingerprint-Enhancement-Python

Issue in ridge_filter function in some of the images

kapilsingla22 opened this issue · 11 comments

Hii Utkarsh,
I am running it for my palm images and for some of the images it works perfectly well but for some of the images there is an error.
Error is: index 0 is out of bounds for axis 0 with size 0
in function: __ridge_filter
In line : sigmax = 1 / unfreq[0] * self.kx
When i try to debug it i found that variable unfreq has shape as (0,).
I don't know why for some of the images it is working but for other it is not.
I am also attaching image for your reference.
One more thing i have resized my current image and after resizing it is not working and if I pass the image without resizing it is working fine. But again i did'nt get the reason can you explain and tell me how to solve it.
The following is without resizing
047_l_940_06
The following is after resizing.
047_l_940_06

Thanks
Kapil singla

working on this. trying to recreate the issue on my end.

is this the full resolution image?

I have orignal full hand image from that image i have extracted the ROI and after extracting the ROI which is the first image and then resize the image which is 2nd image

can you send me the full resolution image? I am unable to recreate this on my end.

Sorry for late reply. Here is the actual image of hand

001_l_940_01

Has the algorithm worked on this image? Thats pretty awesome, since the algorithm is meant to be used on images from fingerprint sensors. those images look much different than this one.

Not exact results but got pretty good results that can be further processed to get desired results.

Hi, I'm using method 1 as README said, but I also get error:
IndexError: index 0 is out of bounds for axis 0 with size 0
(by the way, I'm using images from https://www.kaggle.com/code/dijorajsenroy/fingerprint-feature-extraction-for-biometrics/input )

I tried to run the the algorithm on one of the images from the above link. Here are a couple of points that you can use to debug this:

  1. use the resize=True parameter. by default this is False. This needs to be done in your case, since the images are very small in resolution. my arguments look something like this:
out = enhance_Fingerprint(img, resize=True)		# enhance the fingerprint image

The output image looks like this:
image

  1. If you dont want to resize the image, then it is harder since the resolution is so small that many of the parameters reach the extrema. one of the parameter set that seemed to work for me is:
out = enhance_Fingerprint(img, ridge_segment_blksze=8, min_wave_length=2, ridge_filter_thresh=-1)

The output looks like this:
image

My recommendation is to use the resize with this parameter set:

    out = enhance_Fingerprint(img, resize=True, gradient_sigma=2, ridge_filter_thresh=-4, ridge_segment_thresh=0.3)		# enhance the fingerprint image

The output looks like this:
image

ok thanks utkarsh for your reply. I will look into that.