Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022-027
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2022-027
2022-027
Commits
81e52a54
Commit
81e52a54
authored
Nov 13, 2022
by
Wijesundara W.M.S.G
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new file
parent
7f898536
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
0 deletions
+65
-0
Identify people who may be considered infected with high body temperature./Body Temperature Detection.py
...with high body temperature./Body Temperature Detection.py
+65
-0
No files found.
Identify people who may be considered infected with high body temperature./Body Temperature Detection.py
0 → 100644
View file @
81e52a54
import
time
,
sys
sys
.
path
.
append
(
'../'
)
# Load AMG8833
import
amg8833_i2c
import
numpy
as
np
import
matplotlib.pyplot
as
plt
from
scipy
import
interpolate
# Initialization of Sensor
t0
=
time
.
time
()
sensor
=
[]
while
(
time
.
time
()
-
t0
)
<
1
:
try
:
# AD0 = GND, addr = 0x68 | AD0 = 5V, addr = 0x69
sensor
=
amg8833_i2c
.
AMG8833
(
addr
=
0x69
)
# Start AMG8833
except
:
sensor
=
amg8833_i2c
.
AMG8833
(
addr
=
0x68
)
finally
:
pass
time
.
sleep
(
0.1
)
if
sensor
==
[]:
print
(
"No AMG8833 Found"
)
sys
.
exit
();
pix_res
=
(
8
,
8
)
# Pixel Resolution
xx
,
yy
=
(
np
.
linspace
(
0
,
pix_res
[
0
],
pix_res
[
0
]),
np
.
linspace
(
0
,
pix_res
[
1
],
pix_res
[
1
]))
zz
=
np
.
zeros
(
pix_res
)
# Zero array
pix_mult
=
8
# Resolution Multiply
interp_res
=
(
int
(
pix_mult
*
pix_res
[
0
]),
int
(
pix_mult
*
pix_res
[
1
]))
grid_x
,
grid_y
=
(
np
.
linspace
(
0
,
pix_res
[
0
],
interp_res
[
0
]),
np
.
linspace
(
0
,
pix_res
[
1
],
interp_res
[
1
]))
def
interp
(
z_var
):
f
=
interpolate
.
interp2d
(
xx
,
yy
,
z_var
,
kind
=
'cubic'
)
return
f
(
grid_x
,
grid_y
)
grid_z
=
interp
(
zz
)
plt
.
rcParams
.
update
({
'font.size'
:
16
})
fig_dims
=
(
10
,
9
)
fig
,
ax
=
plt
.
subplots
(
figsize
=
fig_dims
)
fig
.
canvas
.
set_window_title
(
'AMG8833 Thermal Output'
)
im1
=
ax
.
imshow
(
grid_z
,
vmin
=
18
,
vmax
=
37
,
cmap
=
plt
.
cm
.
RdBu_r
)
cbar
=
fig
.
colorbar
(
im1
,
fraction
=
0.0475
,
pad
=
0.03
)
cbar
.
set_label
(
'Temperature [C]'
,
labelpad
=
10
)
fig
.
canvas
.
draw
()
ax_bgnd
=
fig
.
canvas
.
copy_from_bbox
(
ax
.
bbox
)
fig
.
show
()
pix_to_read
=
64
while
True
:
status
,
pixels
=
sensor
.
read_temp
(
pix_to_read
)
if
status
:
continue
T_thermistor
=
sensor
.
read_thermistor
()
# Read Thermistor Temperature
fig
.
canvas
.
restore_region
(
ax_bgnd
)
# Restore Background
new_z
=
interp
(
np
.
reshape
(
pixels
,
pix_res
))
im1
.
set_data
(
new_z
)
ax
.
draw_artist
(
im1
)
fig
.
canvas
.
blit
(
ax
.
bbox
)
fig
.
canvas
.
flush_events
()
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment