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

plot sample and get shape of np array

parent 952c655d
No related branches found
No related tags found
No related merge requests found
...@@ -40,8 +40,53 @@ def removedot(invertThin): ...@@ -40,8 +40,53 @@ def removedot(invertThin):
return temp2 return temp2
# plot fp sample # plot fp sample
def plot_sample(fp_image, x, y): def plot_sample(fp_image):
'''
plot the given sample
'''
print(fp_image)
print(fp_image.shape)
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()
# extract sub array
def extract_sample(arry):
'''
plot the given sample
'''
fp_sample = arry[0:32:1,0:32:1]
print(fp_sample)
fp_image = np.reshape(fp_sample, (32,32))
print(fp_image.shape)
# fp_image = np.array(fp_sample).reshape(32,32)
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()
# plot fp samples
def plot_samples(fp_image, x, y):
''' '''
plot the given sample plot the given sample
''' '''
...@@ -64,7 +109,7 @@ if __name__ == "__main__": ...@@ -64,7 +109,7 @@ if __name__ == "__main__":
# Read fp data from the text file # Read fp data from the text file
temps = np.loadtxt("fpData/fp_image.txt") temps = np.loadtxt("fpData/fp_image.txt")
print(temps) # print(temps)
# shaping array as pixels 160x160 i.e, 25600 samples # shaping array as pixels 160x160 i.e, 25600 samples
arr1 = np.array(temps[0]).reshape(160,160) arr1 = np.array(temps[0]).reshape(160,160)
...@@ -77,20 +122,28 @@ if __name__ == "__main__": ...@@ -77,20 +122,28 @@ if __name__ == "__main__":
arr7 = np.array(temps[6]).reshape(160,160) arr7 = np.array(temps[6]).reshape(160,160)
arr8 = np.array(temps[7]).reshape(160,160) arr8 = np.array(temps[7]).reshape(160,160)
plot_sample(arr1)
# extract_sample(arr1)
'''
# plot samples # plot samples
plot_sample(arr1,2,1) plot_samples(arr1,2,1)
plot_sample(arr2,2,2) plot_samples(arr2,2,2)
plot_sample(arr3,2,3) plot_samples(arr3,2,3)
plot_sample(arr4,2,4) plot_samples(arr4,2,4)
plot_sample(arr5,2,5) plot_samples(arr5,2,5)
plot_sample(arr6,2,6) plot_samples(arr6,2,6)
plot_sample(arr7,2,7) plot_samples(arr7,2,7)
plot_sample(arr8,2,8) plot_samples(arr8,2,8)
plt.show() plt.show()
'''
# Merging all samples to single array
''' '''
fp_array1 = np.concatenate((arr1,arr2), axis=1) fp_array1 = np.concatenate((arr1,arr2), axis=1)
fp_array2 = np.concatenate((arr3,arr4), axis=1) fp_array2 = np.concatenate((arr3,arr4), axis=1)
......
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