Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
skin_detector
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
人工智能
skin_detector
Commits
d0650a50
Commit
d0650a50
authored
Sep 21, 2017
by
Will Brennan
Committed by
GitHub
Sep 21, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9 from parth1993/patch-1
Issue resolved "Error in main.py"
parents
ff6a95d7
7048069e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
skin_detector.py
skin_detector/skin_detector.py
+3
-1
No files found.
skin_detector/skin_detector.py
View file @
d0650a50
...
...
@@ -42,8 +42,10 @@ def get_rgb_mask(img, debug=False):
mask_a
=
cv2
.
inRange
(
img
,
lower_thresh
,
upper_thresh
)
mask_b
=
255
*
((
img
[:,
:,
2
]
-
img
[:,
:,
1
])
/
20
)
mask_c
=
255
*
((
numpy
.
max
(
img
,
axis
=
2
)
-
numpy
.
min
(
img
,
axis
=
2
))
/
20
)
# msk_rgb = cv2.bitwise_and(mask_c, cv2.bitwise_and(mask_a, mask_b))
mask_d
=
numpy
.
bitwise_and
(
numpy
.
uint64
(
mask_a
),
numpy
.
uint64
(
mask_b
))
msk_rgb
=
numpy
.
bitwise_and
(
numpy
.
uint64
(
mask_c
),
numpy
.
uint64
(
mask_d
))
msk_rgb
=
cv2
.
bitwise_and
(
mask_c
,
cv2
.
bitwise_and
(
mask_a
,
mask_b
))
msk_rgb
[
msk_rgb
<
128
]
=
0
msk_rgb
[
msk_rgb
>=
128
]
=
1
...
...
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