summaryrefslogtreecommitdiffstats
path: root/ml/dlib/dlib/statistics/image_feature_sampling_abstract.h
blob: b51ef5423fa97c581d3373a04e38781c16455972 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright (C) 2011  Davis E. King (davis@dlib.net)
// License: Boost Software License   See LICENSE.txt for the full license.
#undef DLIB_IMAGE_FEATURE_SaMPLING_ABSTRACT_Hh_
#ifdef DLIB_IMAGE_FEATURE_SaMPLING_ABSTRACT_Hh_

#include "random_subset_selector_abstract.h"

namespace dlib
{

// ----------------------------------------------------------------------------------------

    template <
        typename image_array_type,
        typename feature_extractor_type,
        typename pyramid_type
        >
    random_subset_selector<typename feature_extractor_type::descriptor_type> randomly_sample_image_features (
        const image_array_type& images,
        const pyramid_type& pyr,
        const feature_extractor_type& fe,
        unsigned long num
    );
    /*!
        requires
            - pyramid_type == a type compatible with the image pyramid objects defined 
              in dlib/image_transforms/image_pyramid_abstract.h
            - feature_extractor_type == a local image feature extractor type such as the
              dlib::hog_image
            - image_array_type == an implementation of dlib/array/array_kernel_abstract.h
              and it must contain image objects which can be passed to pyr() and fe.load()
              and are swappable by global swap().
        ensures
            - creates an image pyramid for each image in images and performs feature
              extraction on each pyramid level.  Then selects a random subsample of at 
              most num local feature vectors and returns it.
    !*/

// ----------------------------------------------------------------------------------------

}

#endif // DLIB_IMAGE_FEATURE_SaMPLING_ABSTRACT_Hh_