Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
larm-astro
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Inès EL HADRI
larm-astro
Commits
c16bac66
Commit
c16bac66
authored
Jan 15, 2024
by
Inès EL HADRI
💤
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tune mask vision
parent
81d63206
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
cam_vision
grp_astro/src/cam_vision
+4
-5
template.jpg
grp_astro/src/img/template.jpg
+0
-0
No files found.
grp_astro/src/cam_vision
View file @
c16bac66
...
@@ -12,10 +12,9 @@ class CameraVision(Node):
...
@@ -12,10 +12,9 @@ class CameraVision(Node):
def
__init__
(
self
,
name
=
"cam_vision"
,
timerFreq
=
1
/
60.0
):
def
__init__
(
self
,
name
=
"cam_vision"
,
timerFreq
=
1
/
60.0
):
super
()
.
__init__
(
name
)
# Create the node
super
()
.
__init__
(
name
)
# Create the node
# Initialiaze node variables
# Initialiaze node variables
self
.
_low
=
np
.
array
([
72
-
25
,
107
-
55
,
84
-
55
])
self
.
_low
=
np
.
array
([
60
-
25
,
50
,
50
])
self
.
_high
=
np
.
array
([
65
+
25
,
2
19
+
30
,
255
])
self
.
_high
=
np
.
array
([
65
+
25
,
2
55
,
255
])
self
.
_kernel
=
np
.
ones
((
5
,
5
),
np
.
uint8
)
self
.
_kernel
=
np
.
ones
((
5
,
5
),
np
.
uint8
)
self
.
_color_info
=
(
0
,
0
,
255
)
self
.
_color_info
=
(
0
,
0
,
255
)
...
@@ -107,8 +106,8 @@ class CameraVision(Node):
...
@@ -107,8 +106,8 @@ class CameraVision(Node):
(
x
,
y
),
radius
=
cv2
.
minEnclosingCircle
(
c
)
(
x
,
y
),
radius
=
cv2
.
minEnclosingCircle
(
c
)
# If we find a correct match that is big enough, we publish data
# If we find a correct match that is big enough, we publish data
if
min
(
match
,
match2
)
<
0.
2
and
radius
>
3
0
:
if
min
(
match
,
match2
)
<
0.
3
and
radius
>
30
and
y
>
2.0
/
5
*
48
0
:
print
(
f
'Match : {min(match, match2)}'
)
#
print(f'Match : {min(match, match2)}')
# Circle the bottle on the image
# Circle the bottle on the image
cv2
.
circle
(
image
,
(
int
(
x
),
int
(
y
)),
int
(
radius
),
self
.
_color_info
,
2
)
cv2
.
circle
(
image
,
(
int
(
x
),
int
(
y
)),
int
(
radius
),
self
.
_color_info
,
2
)
...
...
grp_astro/src/img/template.jpg
View replaced file @
81d63206
View file @
c16bac66
9.37 KB
|
W:
|
H:
11.6 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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