Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-115
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
0
Merge Requests
0
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
2021-115
2021-115
Commits
800c410f
Commit
800c410f
authored
Jul 01, 2021
by
Pramodya Hettiarachchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check weather child is in proximity to the kettle is added
parent
8617aa18
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
1 deletion
+32
-1
Hazardous_object_detection/Hot_objects/hotObject-detection.py
...rdous_object_detection/Hot_objects/hotObject-detection.py
+32
-1
No files found.
Hazardous_object_detection/Hot_objects/hotObject-detection.py
View file @
800c410f
...
...
@@ -7,6 +7,7 @@ import pickle
import
time
import
cv2
import
sys
from
shapely.geometry
import
box
THRESHOLD_ITEM
=
0.5
THRESHOLD_PERSON
=
0.5
...
...
@@ -46,4 +47,34 @@ def forFrame(frame_number, output_array, outpun_count, returned_frame):
if
len
(
persons
)
>
1
:
print
(
"Person in room"
)
# Test commit
if
len
(
persons
>=
1
):
for
person
in
persons
:
# Create person with minX, minY maxX, maxY
person_box
=
box
(
person
[
0
],
person
[
3
],
person
[
1
],
person
[
2
])
x1
=
person
[
0
]
x2
=
person
[
1
]
y1
=
person
[
2
]
y2
=
person
[
3
]
# x_center = (x1+x2)/2
person_midpoint
=
((
x1
+
x2
)
/
2
,
(
y1
+
y2
)
/
2
)
# X and Y coordinates
if
kettle_count
>
0
:
# Loop each kettle
for
kettle
in
kettles
:
kettle_box
=
box
(
kettle
[
0
]
+
50
,
kettle
[
3
]
+
50
,
kettle
[
1
]
+
50
,
kettle
[
2
]
+
50
)
# Check weather child is in proximity to the kettle
k_x1
=
kettle
[
0
]
+
50
# Left
k_x2
=
kettle
[
1
]
+
50
# Right
k_y1
=
kettle
[
2
]
+
50
# Top
k_y2
=
kettle
[
3
]
+
50
# Bottom
overlap
=
False
if
kettle_box
.
intersection
(
person_box
)
!=
None
:
print
(
"Kettle - Person is in the Kettles Danger Region"
)
overlap
=
True
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