From 2dd28ac0fe436c156e87bbf2369588de1d07fca3 Mon Sep 17 00:00:00 2001 From: Davis King Date: Mon, 30 May 2011 10:51:20 -0400 Subject: [PATCH] Changed hysteresis_threshold() so it properly handles signed pixel types. --- dlib/image_transforms/thresholding.h | 5 ++--- dlib/image_transforms/thresholding_abstract.h | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dlib/image_transforms/thresholding.h b/dlib/image_transforms/thresholding.h index 9ede03da0..509f59d12 100644 --- a/dlib/image_transforms/thresholding.h +++ b/dlib/image_transforms/thresholding.h @@ -173,8 +173,8 @@ namespace dlib void hysteresis_threshold ( const in_image_type& in_img, out_image_type& out_img, - unsigned long lower_thresh, - unsigned long upper_thresh + typename pixel_traits::basic_pixel_type lower_thresh, + typename pixel_traits::basic_pixel_type upper_thresh ) { COMPILE_TIME_ASSERT( pixel_traits::has_alpha == false ); @@ -198,7 +198,6 @@ namespace dlib } out_img.set_size(in_img.nr(),in_img.nc()); - assign_all_pixels(out_img,0); const long size = 50; long rstack[size]; diff --git a/dlib/image_transforms/thresholding_abstract.h b/dlib/image_transforms/thresholding_abstract.h index a61fc6277..30e7269b9 100644 --- a/dlib/image_transforms/thresholding_abstract.h +++ b/dlib/image_transforms/thresholding_abstract.h @@ -78,8 +78,8 @@ namespace dlib void hysteresis_threshold ( const in_image_type& in_img, out_image_type& out_img, - unsigned long lower_thresh, - unsigned long upper_thresh + typename pixel_traits::basic_pixel_type lower_thresh, + typename pixel_traits::basic_pixel_type upper_thresh ); /*! requires