Commit 40717110 authored by Davis King's avatar Davis King

Made separable_3x3_filter_block_grayscale() a little more general.

parent a874c461
......@@ -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)
......
......@@ -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 types
- shrink_rect(get_rect(img),1).contains(c,r)
- shrink_rect(get_rect(img),1).contains(c+NC-1,r+NR-1)
ensures
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment