Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
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
钟尚武
dlib
Commits
9069f30a
Commit
9069f30a
authored
Aug 17, 2014
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor code cleanup
parent
0b5cb827
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
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
// ------------------------------------------------------------------------------------
namespace
impl
template
<
typename
image_view_type
>
struct
uint8_or_uint16_pixels
{
template
<
typename
image_view_type
>
struct
uint8_or_uint16_pixels
{
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
;
};
}
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
// with 8bit or 16bit pixels very quickly. We do this by using a radix sort
// instead of quicksort.
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
(
const
in_image_type
&
in_img
,
std
::
vector
<
segment_image_edge_data_T
<
T
>
>&
sorted_edges
...
...
@@ -253,7 +250,7 @@ namespace dlib
// This is the general purpose version of get_pixel_edges(). It handles all pixel types.
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
(
const
in_image_type
&
in_img
,
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