Commit af34478b authored by Davis King's avatar Davis King

Made the spatial filtering functions filter each color channel independently

rather than converting to HSI and filtering just the I channel.  Also, the
spatially_filter_image_separable_down() routine now only allows grayscale
output images.
parent 088ab2e1
This diff is collapsed.
...@@ -46,8 +46,7 @@ namespace dlib ...@@ -46,8 +46,7 @@ namespace dlib
add_to is true then the filtered output value will be added to out_img rather than add_to is true then the filtered output value will be added to out_img rather than
overwriting the original value. overwriting the original value.
- if (pixel_traits<typename in_image_type::type>::grayscale == false) then - if (pixel_traits<typename in_image_type::type>::grayscale == false) then
- the pixel values are converted to the HSI color space and the filtering - The filter is applied to each color channel independently.
is done on the intensity channel only.
- if (use_abs == true) then - if (use_abs == true) then
- pixel values after filtering that are < 0 are converted to their absolute values. - pixel values after filtering that are < 0 are converted to their absolute values.
- Pixels close enough to the edge of in_img to not have the filter still fit - Pixels close enough to the edge of in_img to not have the filter still fit
...@@ -102,8 +101,7 @@ namespace dlib ...@@ -102,8 +101,7 @@ namespace dlib
add_to is true then the filtered output value will be added to out_img rather than add_to is true then the filtered output value will be added to out_img rather than
overwriting the original value. overwriting the original value.
- if (pixel_traits<typename in_image_type::type>::grayscale == false) then - if (pixel_traits<typename in_image_type::type>::grayscale == false) then
- the pixel values are converted to the HSI color space and the filtering - The filter is applied to each color channel independently.
is done on the intensity channel only.
- if (use_abs == true) then - if (use_abs == true) then
- pixel values after filtering that are < 0 are converted to their absolute values - pixel values after filtering that are < 0 are converted to their absolute values
- Pixels close enough to the edge of in_img to not have the filter still fit - Pixels close enough to the edge of in_img to not have the filter still fit
...@@ -139,6 +137,7 @@ namespace dlib ...@@ -139,6 +137,7 @@ namespace dlib
- out_image_type == is an implementation of array2d/array2d_kernel_abstract.h - out_image_type == is an implementation of array2d/array2d_kernel_abstract.h
- pixel_traits<typename in_image_type::type>::has_alpha == false - pixel_traits<typename in_image_type::type>::has_alpha == false
- pixel_traits<typename out_image_type::type>::has_alpha == false - pixel_traits<typename out_image_type::type>::has_alpha == false
- pixel_traits<typename out_image_type::type>::grayscale == true
- is_same_object(in_img, out_img) == false - is_same_object(in_img, out_img) == false
- T must be some scalar type - T must be some scalar type
- scale != 0 - scale != 0
...@@ -304,8 +303,7 @@ namespace dlib ...@@ -304,8 +303,7 @@ namespace dlib
- Pixel values are stored into out_img using the assign_pixel() function and therefore - Pixel values are stored into out_img using the assign_pixel() function and therefore
any applicable color space conversion or value saturation is performed. any applicable color space conversion or value saturation is performed.
- if (pixel_traits<typename in_image_type::type>::grayscale == false) then - if (pixel_traits<typename in_image_type::type>::grayscale == false) then
- the pixel values are converted to the HSI color space and the filtering - The filter is applied to each color channel independently.
is done on the intensity channel only.
- Pixels close enough to the edge of in_img to not have the filter still fit - Pixels close enough to the edge of in_img to not have the filter still fit
inside the image are set to zero. inside the image are set to zero.
- #out_img.nc() == in_img.nc() - #out_img.nc() == in_img.nc()
......
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