Skip to content
Snippets Groups Projects
Commit 6fd87610 authored by Dorababu A's avatar Dorababu A
Browse files

plot single fp sample

parent dd31d97a
No related branches found
No related tags found
No related merge requests found
......@@ -40,30 +40,54 @@ def removedot(invertThin):
return temp2
# Read fp data from the text file
# plot fp sample
def plot_sample(fp_image):
'''
plot the given sample
'''
fp_enhance_image= fingerprint_enhancer.enhance_Fingerprint(fp_image)
temps = np.loadtxt("fpData/fp_image.txt")
fp_enhance_image[fp_enhance_image == 255] =1
arr1 = np.array(temps[0]).reshape(160,160)
arr2 = np.array(temps[1]).reshape(160,160)
arr3 = np.array(temps[2]).reshape(160,160)
arr4 = np.array(temps[3]).reshape(160,160)
skeleton = skeletonize(fp_enhance_image)
skeleton = np.array(skeleton, dtype=np.uint8)
skeleton = removedot(skeleton)
fp_array1 = np.concatenate((arr1,arr2), axis=1)
fp_array2 = np.concatenate((arr3,arr4), axis=1)
plt.imshow(skeleton, 'gray')
plt.show()
fp_array = np.concatenate((fp_array1, fp_array2), axis =0)
fp_image = np.reshape(fp_array, (320,320))
# main function
if __name__ == "__main__":
fp_enhance_image= fingerprint_enhancer.enhance_Fingerprint(fp_image)
# Read fp data from the text file
fp_enhance_image[fp_enhance_image == 255] =1
temps = np.loadtxt("fpData/fp_image.txt")
# shaping array as pixels 160x160 i.e, 25600 samples
arr1 = np.array(temps[0]).reshape(160,160)
arr2 = np.array(temps[1]).reshape(160,160)
arr3 = np.array(temps[2]).reshape(160,160)
arr4 = np.array(temps[3]).reshape(160,160)
skeleton = skeletonize(fp_enhance_image)
skeleton = np.array(skeleton, dtype=np.uint8)
skeleton = removedot(skeleton)
plot_sample(arr1)
'''
fp_array1 = np.concatenate((arr1,arr2), axis=1)
fp_array2 = np.concatenate((arr3,arr4), axis=1)
plt.imshow(skeleton, 'gray')
plt.show()
fp_array = np.concatenate((fp_array1, fp_array2), axis =0)
fp_image = np.reshape(fp_array, (320,320))
fp_enhance_image= fingerprint_enhancer.enhance_Fingerprint(fp_image)
fp_enhance_image[fp_enhance_image == 255] =1
skeleton = skeletonize(fp_enhance_image)
skeleton = np.array(skeleton, dtype=np.uint8)
skeleton = removedot(skeleton)
plt.imshow(skeleton, 'gray')
plt.show()
'''
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment