Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
FPSfirmware
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dorababu A
FPSfirmware
Commits
b7fcf872
Commit
b7fcf872
authored
2 years ago
by
Dorababu A
Browse files
Options
Downloads
Patches
Plain Diff
plot sample and get shape of np array
parent
952c655d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ReadRawData/pyScripts/Merge.py
+65
-12
65 additions, 12 deletions
ReadRawData/pyScripts/Merge.py
with
65 additions
and
12 deletions
ReadRawData/pyScripts/Merge.py
+
65
−
12
View file @
b7fcf872
...
@@ -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_sample
s
(arr1,2,1)
plot_sample
(
arr2
,
2
,
2
)
plot_sample
s
(arr2,2,2)
plot_sample
(
arr3
,
2
,
3
)
plot_sample
s
(arr3,2,3)
plot_sample
(
arr4
,
2
,
4
)
plot_sample
s
(arr4,2,4)
plot_sample
(
arr5
,
2
,
5
)
plot_sample
s
(arr5,2,5)
plot_sample
(
arr6
,
2
,
6
)
plot_sample
s
(arr6,2,6)
plot_sample
(
arr7
,
2
,
7
)
plot_sample
s
(arr7,2,7)
plot_sample
(
arr8
,
2
,
8
)
plot_sample
s
(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)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment