Utkarsh-Deshmukh / Fingerprint-Enhancement-Python

Using oriented gabor filters to enhance fingerprint images
BSD 2-Clause "Simplified" License
221 stars 103 forks source link

Ridge extraction for fingerprint patches #13

Closed gowrijsuria closed 3 years ago

gowrijsuria commented 3 years ago

Hi @Utkarsh-Deshmukh,

I was trying to run your code on fingerprint patches resized to 256x256. The ridges maps aren't formed completely(might be due to pores). There is also a black border along the edges but I need the ridge map for the complete image.

I have attached the resulting ridge map below along with the original image. Could you please guide me on resolving these issues?

Original Image (96x96) 1801-019_0_1-HiScan-Live

Enhanced Ridge Map Image (256x256) enhanced_image1801-019_0_1-HiScan-Live

Thank you

Utkarsh-Deshmukh commented 3 years ago

This must be be happening due to mismatch of window size for the input image that you are providing. I have seen this behavior before. If you can provide me with the original image, i can fix it and let you know what parameters work best for your use case. Thank you

Utkarsh-Deshmukh commented 3 years ago

I see what is happening. By resizing it to 256x256, you are making the pores really huge (avoid such a large resizing). I resized the image to 128x128 and the results look very nice. Here is what my result looks like: image

Here is the code snippet that generated this result: image

By resizing the image to such a large value, all the internal filters need to be resized. Easier solution is to avoid such a large resize operation.

gowrijsuria commented 3 years ago

Thanks a lot! Is there any way to remove the extra black border on the side? For my final use case, I need to take L1 loss on the perfect ridge maps, but some content is lost at the edges.

Utkarsh-Deshmukh commented 3 years ago

The reason some content is lost at the borders in order to run the filters on the original image, we neglect the regions on the border. The easiest thing you can do is to artificially add border to your input image, enhance it and then remove the border from the output.