Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
bd2e0bc3
Commit
bd2e0bc3
authored
May 24, 2018
by
Davis King
Browse files
Made skeleton(), in the python API, return the given image so
you can chain calls easily.
parent
61687a8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
tools/python/src/image.cpp
tools/python/src/image.cpp
+17
-4
No files found.
tools/python/src/image.cpp
View file @
bd2e0bc3
...
@@ -603,6 +603,16 @@ numpy_image<T> py_hysteresis_threshold2 (
...
@@ -603,6 +603,16 @@ numpy_image<T> py_hysteresis_threshold2 (
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
numpy_image
<
unsigned
char
>
py_skeleton
(
numpy_image
<
unsigned
char
>&
img
)
{
skeleton
(
img
);
return
img
;
}
// ----------------------------------------------------------------------------------------
void
bind_image_classes
(
py
::
module
&
m
)
void
bind_image_classes
(
py
::
module
&
m
)
{
{
...
@@ -726,12 +736,15 @@ ensures \n\
...
@@ -726,12 +736,15 @@ ensures \n\
- all pixels in img are set to either 255 or 0.
- all pixels in img are set to either 255 or 0.
ensures
ensures
- This function computes the skeletonization of img and stores the result in
- This function computes the skeletonization of img and stores the result in
#img. That is, given a binary image, we progressively thin the binary blobs
img (i.e. it works in place and therefore modifies the supplied img). That
(composed of on_pixel values) until only a single pixel wide skeleton of the
is, given a binary image, we progressively thin the binary blobs (composed of
original blobs remains.
on_pixel values) until only a single pixel wide skeleton of the original
blobs remains.
- Doesn't change the shape or size of img.
- Doesn't change the shape or size of img.
- Returns img. Note that the returned object is the same object as the input
object.
!*/
!*/
m
.
def
(
"skeleton"
,
skeleton
<
numpy_image
<
unsigned
char
>>
,
docs
,
py
::
arg
(
"img"
));
m
.
def
(
"skeleton"
,
py_
skeleton
,
docs
,
py
::
arg
(
"img"
));
...
...
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