From 6c0f5980d31e449811ab00d6866992983d2f9272 Mon Sep 17 00:00:00 2001 From: Davis King Date: Thu, 29 Dec 2011 15:42:08 -0500 Subject: [PATCH] Changed code a bit to make it run faster. --- dlib/image_processing/scan_image_pyramid.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/dlib/image_processing/scan_image_pyramid.h b/dlib/image_processing/scan_image_pyramid.h index c74d6b383..c485defa8 100644 --- a/dlib/image_processing/scan_image_pyramid.h +++ b/dlib/image_processing/scan_image_pyramid.h @@ -489,17 +489,16 @@ namespace dlib for (unsigned long l = 0; l < feats.size(); ++l) { for (unsigned long i = 0; i < saliency_images.size(); ++i) - saliency_images[i].set_size(feats[l].nr(), feats[l].nc()); - - // build saliency images for pyramid level l - for (long r = 0; r < feats[l].nr(); ++r) { - for (long c = 0; c < feats[l].nc(); ++c) + saliency_images[i].set_size(feats[l].nr(), feats[l].nc()); + const unsigned long offset = feats_config.get_num_dimensions()*i; + + // build saliency images for pyramid level l + for (long r = 0; r < feats[l].nr(); ++r) { - const typename feature_extractor_type::descriptor_type& descriptor = feats[l](r,c); - for (unsigned long i = 0; i < saliency_images.size(); ++i) + for (long c = 0; c < feats[l].nc(); ++c) { - const unsigned long offset = feats_config.get_num_dimensions()*i; + const typename feature_extractor_type::descriptor_type& descriptor = feats[l](r,c); double sum = 0; for (unsigned long k = 0; k < descriptor.size(); ++k)