Changed code a bit to make it run faster.

This commit is contained in:
Davis King 2011-12-29 15:42:08 -05:00
parent 6010de9b43
commit 6c0f5980d3
1 changed files with 7 additions and 8 deletions

View File

@ -489,17 +489,16 @@ namespace dlib
for (unsigned long l = 0; l < feats.size(); ++l) for (unsigned long l = 0; l < feats.size(); ++l)
{ {
for (unsigned long i = 0; i < saliency_images.size(); ++i) 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 (long c = 0; c < feats[l].nc(); ++c)
for (unsigned long i = 0; i < saliency_images.size(); ++i)
{ {
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; double sum = 0;
for (unsigned long k = 0; k < descriptor.size(); ++k) for (unsigned long k = 0; k < descriptor.size(); ++k)