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
b3178059
Commit
b3178059
authored
May 13, 2018
by
Davis King
Browse files
Added overload of hysteresis_threshold() that uses partition_pixels()
to select thresholds.
parent
e340f1cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
0 deletions
+39
-0
dlib/image_transforms/thresholding.h
dlib/image_transforms/thresholding.h
+16
-0
dlib/image_transforms/thresholding_abstract.h
dlib/image_transforms/thresholding_abstract.h
+23
-0
No files found.
dlib/image_transforms/thresholding.h
View file @
b3178059
...
...
@@ -691,6 +691,22 @@ namespace dlib
}
}
template
<
typename
in_image_type
,
typename
out_image_type
>
void
hysteresis_threshold
(
const
in_image_type
&
in_img
,
out_image_type
&
out_img
)
{
using
basic_pixel_type
=
typename
pixel_traits
<
typename
image_traits
<
in_image_type
>::
pixel_type
>::
basic_pixel_type
;
basic_pixel_type
t1
,
t2
;
partition_pixels
(
in_img
,
t1
,
t2
);
hysteresis_threshold
(
in_img
,
out_img
,
t1
,
t2
);
}
// ----------------------------------------------------------------------------------------
}
...
...
dlib/image_transforms/thresholding_abstract.h
View file @
b3178059
...
...
@@ -167,6 +167,29 @@ namespace dlib
- #out_img.nr() == in_img.nr()
!*/
template
<
typename
in_image_type
,
typename
out_image_type
>
void
hysteresis_threshold
(
const
in_image_type
&
in_img
,
out_image_type
&
out_img
);
/*!
requires
- in_image_type == an image object that implements the interface defined in
dlib/image_processing/generic_image.h
- out_image_type == an image object that implements the interface defined in
dlib/image_processing/generic_image.h
- pixel_traits<typename image_traits<out_image_type>::pixel_type>::grayscale == true
- pixel_traits<typename image_traits<in_image_type>::pixel_type>::has_alpha == false
- pixel_traits<typename image_traits<out_image_type>::pixel_type>::has_alpha == false
- is_same_object(in_img, out_img) == false
ensures
- performs: hysteresis_threshold(in_img, out_img, t1, t2) where the thresholds
are first obtained by calling partition_pixels(in_img, t1, t2).
!*/
// ----------------------------------------------------------------------------------------
}
...
...
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