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
40717110
Commit
40717110
authored
Apr 02, 2013
by
Davis King
Browse files
Made separable_3x3_filter_block_grayscale() a little more general.
parent
a874c461
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
dlib/image_transforms/spatial_filtering.h
dlib/image_transforms/spatial_filtering.h
+5
-4
dlib/image_transforms/spatial_filtering_abstract.h
dlib/image_transforms/spatial_filtering_abstract.h
+5
-4
No files found.
dlib/image_transforms/spatial_filtering.h
View file @
40717110
...
...
@@ -409,6 +409,7 @@ namespace dlib
long
NR
,
long
NC
,
typename
T
,
typename
U
,
typename
in_image_type
>
inline
void
separable_3x3_filter_block_grayscale
(
...
...
@@ -416,9 +417,9 @@ namespace dlib
const
in_image_type
&
img
,
const
long
&
r
,
const
long
&
c
,
const
T
&
fe1
,
// separable filter end
const
T
&
fm
,
// separable filter middle
const
T
&
fe2
// separable filter end 2
const
U
&
fe1
,
// separable filter end
const
U
&
fm
,
// separable filter middle
const
U
&
fe2
// separable filter end 2
)
{
// make sure requires clause is not broken
...
...
@@ -477,7 +478,7 @@ namespace dlib
// make sure requires clause is not broken
DLIB_ASSERT
(
shrink_rect
(
get_rect
(
img
),
1
).
contains
(
c
,
r
)
&&
shrink_rect
(
get_rect
(
img
),
1
).
contains
(
c
+
NC
-
1
,
r
+
NR
-
1
),
"
\t
void separable_3x3_filter_block_
grayscale
()"
"
\t
void separable_3x3_filter_block_
rgb
()"
<<
"
\n\t
The sub-window doesn't fit inside the given image."
<<
"
\n\t
get_rect(img): "
<<
get_rect
(
img
)
<<
"
\n\t
(c,r): "
<<
point
(
c
,
r
)
...
...
dlib/image_transforms/spatial_filtering_abstract.h
View file @
40717110
...
...
@@ -168,6 +168,7 @@ namespace dlib
long
NR
,
long
NC
,
typename
T
,
typename
U
,
typename
in_image_type
>
inline
void
separable_3x3_filter_block_grayscale
(
...
...
@@ -175,15 +176,15 @@ namespace dlib
const
in_image_type
&
img
,
const
long
&
r
,
const
long
&
c
,
const
T
&
fe1
,
const
T
&
fm
,
const
T
&
fe2
const
U
&
fe1
,
const
U
&
fm
,
const
U
&
fe2
);
/*!
requires
- in_image_type == is an implementation of array2d/array2d_kernel_abstract.h
- pixel_traits<typename in_image_type::type> must be defined
- T should be
a
scalar type
- T
and U
should be scalar type
s
- shrink_rect(get_rect(img),1).contains(c,r)
- shrink_rect(get_rect(img),1).contains(c+NC-1,r+NR-1)
ensures
...
...
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