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
9069f30a
Commit
9069f30a
authored
Aug 17, 2014
by
Davis King
Browse files
minor code cleanup
parent
0b5cb827
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
dlib/image_transforms/segment_image.h
dlib/image_transforms/segment_image.h
+8
-11
No files found.
dlib/image_transforms/segment_image.h
View file @
9069f30a
...
@@ -125,22 +125,19 @@ namespace dlib
...
@@ -125,22 +125,19 @@ namespace dlib
// ------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------
namespace
impl
template
<
typename
image_view_type
>
struct
uint8_or_uint16_pixels
{
{
template
<
typename
image_view_type
>
typedef
typename
image_view_type
::
pixel_type
pixel_type
;
struct
uint8_or_uint16_pixels
const
static
bool
value
=
is_same_type
<
pixel_type
,
uint8
>::
value
||
{
is_same_type
<
pixel_type
,
uint16
>::
value
;
typedef
typename
image_view_type
::
pixel_type
pixel_type
;
};
const
static
bool
value
=
is_same_type
<
pixel_type
,
uint8
>::
value
||
is_same_type
<
pixel_type
,
uint16
>::
value
;
};
}
// This is an overload of get_pixel_edges() that is optimized to segment images
// This is an overload of get_pixel_edges() that is optimized to segment images
// with 8bit or 16bit pixels very quickly. We do this by using a radix sort
// with 8bit or 16bit pixels very quickly. We do this by using a radix sort
// instead of quicksort.
// instead of quicksort.
template
<
typename
in_image_type
,
typename
T
>
template
<
typename
in_image_type
,
typename
T
>
typename
enable_if
<
impl
::
uint8_or_uint16_pixels
<
in_image_type
>
>::
type
typename
enable_if
<
uint8_or_uint16_pixels
<
in_image_type
>
>::
type
get_pixel_edges
(
get_pixel_edges
(
const
in_image_type
&
in_img
,
const
in_image_type
&
in_img
,
std
::
vector
<
segment_image_edge_data_T
<
T
>
>&
sorted_edges
std
::
vector
<
segment_image_edge_data_T
<
T
>
>&
sorted_edges
...
@@ -253,7 +250,7 @@ namespace dlib
...
@@ -253,7 +250,7 @@ namespace dlib
// This is the general purpose version of get_pixel_edges(). It handles all pixel types.
// This is the general purpose version of get_pixel_edges(). It handles all pixel types.
template
<
typename
in_image_type
,
typename
T
>
template
<
typename
in_image_type
,
typename
T
>
typename
disable_if
<
impl
::
uint8_or_uint16_pixels
<
in_image_type
>
>::
type
typename
disable_if
<
uint8_or_uint16_pixels
<
in_image_type
>
>::
type
get_pixel_edges
(
get_pixel_edges
(
const
in_image_type
&
in_img
,
const
in_image_type
&
in_img
,
std
::
vector
<
segment_image_edge_data_T
<
T
>
>&
sorted_edges
std
::
vector
<
segment_image_edge_data_T
<
T
>
>&
sorted_edges
...
...
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