Utkarsh-Deshmukh / Fingerprint-Feature-Extraction

Extract minutiae features from fingerprint images
MIT License
144 stars 44 forks source link

Crashes for certain fingerprints #5

Closed redfast00 closed 3 years ago

redfast00 commented 3 years ago
Traceback (most recent call last):
  File "persistent.py", line 221, in get_all_features
    terminations, bifurcations = fingerprint_feature_extractor.extract_minutiae_features(enhanced, showResult=False)
  File "/home/user/ml/project/ML/venv/lib/python3.8/site-packages/fingerprint_feature_extractor/__init__.py", line 172, in extract_minutiae_features
    FeaturesTerm, FeaturesBif = feature_extractor.extractMinutiaeFeatures(img)
  File "/home/user/ml/project/ML/venv/lib/python3.8/site-packages/fingerprint_feature_extractor/__init__.py", line 136, in extractMinutiaeFeatures
    FeaturesTerm, FeaturesBif = self.__performFeatureExtraction()
  File "/home/user/ml/project/ML/venv/lib/python3.8/site-packages/fingerprint_feature_extractor/__init__.py", line 115, in __performFeatureExtraction
    angle = self.__computeAngle(block, 'Termination')
  File "/home/user/ml/project/ML/venv/lib/python3.8/site-packages/fingerprint_feature_extractor/__init__.py", line 40, in __computeAngle
    return (angle)
UnboundLocalError: local variable 'angle' referenced before assignment

redfast00 commented 3 years ago

Left654_1

Utkarsh-Deshmukh commented 3 years ago

looking into this.

Utkarsh-Deshmukh commented 3 years ago

changes are complete. Thank you for providing the image to help fix the bug. I have pushed a major rebasing of the code to write it in a class based structure so that it is easy to use.

This is also compatible to the pypi release 0.0.4 which can be found here:

you can run the "example.py" to extract the features.

I tested it on the image that you have provided and it seems to be working. Closing this issue. If it still doesn't work, please open the issue again.

redfast00 commented 3 years ago

It seems to work now, only a minor annoyance: there's a print statement left over (https://github.com/Utkarsh-Deshmukh/Fingerprint-Feature-Extraction/commit/6c821e4e9d48b1133bee6e3d9e9a0b61a0bd4bdd#diff-407f957a4348c3eab412aed8c92bdf94a353e994e967ebd19656adc564710b6cR115). I also noticed that the API changed (the Orientation of the Terminations have changed into a list of one element instead of just that one element. Has anything else changed from the API?

redfast00 commented 3 years ago

Thank you for fixing this so fast btw, really impressed :)

Utkarsh-Deshmukh commented 3 years ago

Thank you. hopefully it is working fine for you now. you can also use it as a library by doing pip install fingerprint-feature-extractor

you can check out the example.py to understand how to use the library easily.

Best Regards