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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
segment_image.h
dlib/image_transforms/segment_image.h
+2
-5
No files found.
dlib/image_transforms/segment_image.h
View file @
9069f30a
...
@@ -125,8 +125,6 @@ namespace dlib
...
@@ -125,8 +125,6 @@ namespace dlib
// ------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------
namespace
impl
{
template
<
typename
image_view_type
>
template
<
typename
image_view_type
>
struct
uint8_or_uint16_pixels
struct
uint8_or_uint16_pixels
{
{
...
@@ -134,13 +132,12 @@ namespace dlib
...
@@ -134,13 +132,12 @@ namespace dlib
const
static
bool
value
=
is_same_type
<
pixel_type
,
uint8
>::
value
||
const
static
bool
value
=
is_same_type
<
pixel_type
,
uint8
>::
value
||
is_same_type
<
pixel_type
,
uint16
>::
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