Commit b59b8419 authored by Davis King's avatar Davis King

Minor changes to avoid bugs in GCC 4.1.2 on Debian Etch

parent 365f3eed
......@@ -51,8 +51,10 @@ namespace dlib
<< "\n\t images.size(): " << images.size()
);
pyramid pyr;
const random_subset_selector<typename feature_extractor::descriptor_type>& samps =
randomly_sample_image_features(images, pyramid(), fe, num_samples);
randomly_sample_image_features(images, pyr, fe, num_samples);
if (samps.size() <= 1)
throw dlib::image_hash_construction_failure("Images too small, not able to gather enough samples to make hash");
......
......@@ -79,7 +79,7 @@ namespace dlib
// figure out what the offset values should be
for (int itr = 0; itr < offset.size(); ++itr)
{
counts.assign(std::pow(2.0,bits), 0);
counts.assign(static_cast<unsigned long>(std::pow(2.0,bits)), 0);
// count the popularity of each hash value
for (unsigned long i = 0; i < h.size(); ++i)
{
......
......@@ -44,7 +44,7 @@ namespace dlib
unsigned long num_hash_bins (
) const
{
return static_cast<unsigned long>(std::pow(2.0, offset.size()));
return static_cast<unsigned long>(std::pow(2.0, (double)offset.size()));
}
template <typename EXP>
......
......@@ -393,7 +393,9 @@ namespace
setup_grid_detection_templates(scanner, object_locations, 2, 2);
feature_extractor_type nnfe;
nnfe.set_basis(randomly_sample_image_features(images, pyramid_down(), poly_image<5>(), 80));
pyramid_down pyr_down;
poly_image<5> polyi;
nnfe.set_basis(randomly_sample_image_features(images, pyr_down, polyi, 80));
scanner.copy_configuration(nnfe);
structural_object_detection_trainer<image_scanner_type> trainer(scanner);
......
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