Commit 2a9c8923 authored by Davis King's avatar Davis King

Fixed a compile time error that prevented auto_threshold_image() from being

used.
parent 9b9afc01
...@@ -87,11 +87,10 @@ namespace dlib ...@@ -87,11 +87,10 @@ namespace dlib
COMPILE_TIME_ASSERT(pixel_traits<typename image_traits<out_image_type>::pixel_type>::grayscale); COMPILE_TIME_ASSERT(pixel_traits<typename image_traits<out_image_type>::pixel_type>::grayscale);
const_image_view<in_image_type> in_img(in_img_);
image_view<out_image_type> out_img(out_img_); image_view<out_image_type> out_img(out_img_);
// if there isn't any input image then don't do anything // if there isn't any input image then don't do anything
if (in_img.size() == 0) if (image_size(in_img_) == 0)
{ {
out_img.clear(); out_img.clear();
return; return;
...@@ -100,7 +99,9 @@ namespace dlib ...@@ -100,7 +99,9 @@ namespace dlib
unsigned long thresh; unsigned long thresh;
// find the threshold we should use // find the threshold we should use
matrix<unsigned long,1> hist; matrix<unsigned long,1> hist;
get_histogram(in_img,hist); get_histogram(in_img_,hist);
const_image_view<in_image_type> in_img(in_img_);
// Start our two means (a and b) out at the ends of the histogram // Start our two means (a and b) out at the ends of the histogram
long a = 0; long a = 0;
......
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