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
62f1b9a2
Commit
62f1b9a2
authored
Mar 23, 2015
by
WillBrennan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added closing and opening operations
parent
76b4fa2e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
demo.png
demo.png
+0
-0
main.py
main.py
+4
-2
No files found.
demo.png
View replaced file @
76b4fa2e
View file @
62f1b9a2
This diff is collapsed.
Click to expand it.
main.py
View file @
62f1b9a2
...
...
@@ -67,7 +67,10 @@ class SkinDetector(object):
assert
isinstance
(
msk
,
numpy
.
ndarray
),
'msk must be a numpy array'
assert
msk
.
ndim
==
2
,
'msk must be a greyscale image'
kernel
=
cv2
.
getStructuringElement
(
cv2
.
MORPH_ELLIPSE
,
(
5
,
5
))
return
cv2
.
morphologyEx
(
msk
,
cv2
.
MORPH_CLOSE
,
kernel
)
msk
=
cv2
.
morphologyEx
(
msk
,
cv2
.
MORPH_CLOSE
,
kernel
)
kernel
=
cv2
.
getStructuringElement
(
cv2
.
MORPH_ELLIPSE
,
(
3
,
3
))
msk
=
cv2
.
morphologyEx
(
msk
,
cv2
.
MORPH_OPEN
,
kernel
,
iterations
=
2
)
return
msk
def
process
(
self
,
img
):
logger
.
debug
(
'Initialising process'
)
...
...
@@ -150,7 +153,6 @@ if __name__ == '__main__':
args
=
extended
.
get_args
()
logger
=
extended
.
get_logger
(
quite
=
args
.
quite
,
debug
=
args
.
debug
)
args
.
image_paths
=
extended
.
find_images
(
args
.
image_paths
[
0
])
print
args
.
image_paths
[
-
1
]
for
image_path
in
args
.
image_paths
:
img_col
=
cv2
.
imread
(
image_path
,
1
)
img_msk
=
process
(
img_col
,
args
=
args
)
...
...
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