#include <uniform-pyramid-maker.h>
Inheritance diagram for UniformPyramidMaker:
The discretize_factor
parameter, passed into Preprocess(), is particularly important because it can greatly affect the shape of the resulting pyramid. This parameter multiplies all of the feature values by 10^{discretize_factor}. We typically set it in such a way that the resulting features are on the order of 10^2.
It is also important to note that uniform-bin pyramids are useful only when dealing with low-dimensional data (up to about 10-dimensional). When dealing with higher-dimensional features, consider using VGPyramidMaker instead.
Public Member Functions | |
UniformPyramidMaker () | |
void | Preprocess (const PointSetList &point_sets, double finest_side_length, double side_factor, int discretize_factor, bool do_translations, bool global_translations) |
Set parameters and preprocess the pyramid settings. | |
void | Preprocess (const vector< PointRef > &points, double finest_side_length, double side_factor, int discretize_factor, bool do_translations, bool global_translations) |
Set parameters and preprocess the pyramid settings. | |
void | ReadFromStream (istream &input_stream) |
Read parameters and preprocessed data from a stream. | |
void | ReadFromFile (const char *filename) |
Read parameters and preprocessed data from a file. | |
void | WriteToStream (ostream &output_stream) const |
Write parameters and preprocessed data to a stream. | |
void | WriteToFile (const char *filename) const |
Write parameters and preprocessed data to a file. | |
int | num_levels () const |
Get the number of levels in the pyramids that will be created. | |
virtual MultiResolutionHistogram * | MakePyramid (const PointSet &ps) |
Creates a uniform pyramid from a PointSet. | |
vector< MultiResolutionHistogram * > | MakePyramids (const PointSetList &psl) |
Turn a list of PointSets into a bunch of MultiResolutionHistograms. |
void Preprocess | ( | const PointSetList & | point_sets, | |
double | finest_side_length, | |||
double | side_factor, | |||
int | discretize_factor, | |||
bool | do_translations, | |||
bool | global_translations | |||
) |
Set parameters and preprocess the pyramid settings.
finest_side_length | The length of a side of the smallest bin at the lowest level of the pyramid. | |
side_factor | The length of the side of the bin is this factor larger for bins one level above. | |
discretize_factor | Scales all of the features by a factor 10^{discretize_factor}. | |
do_translations | Determines whether to apply random shifts to the bins. | |
global_translations | Determines whether the shift should be the same across all levels or not. |
void Preprocess | ( | const vector< PointRef > & | points, | |
double | finest_side_length, | |||
double | side_factor, | |||
int | discretize_factor, | |||
bool | do_translations, | |||
bool | global_translations | |||
) |
Set parameters and preprocess the pyramid settings.
void ReadFromStream | ( | istream & | input_stream | ) |
Read parameters and preprocessed data from a stream.
Aborts if the stream is bad.
void ReadFromFile | ( | const char * | filename | ) |
void WriteToStream | ( | ostream & | output_stream | ) | const |
Write parameters and preprocessed data to a stream.
Aborts if the stream is bad.
void WriteToFile | ( | const char * | filename | ) | const |
int num_levels | ( | ) | const |
Get the number of levels in the pyramids that will be created.
Must be called after Preprocess() or ReadFromStream().
MultiResolutionHistogram * MakePyramid | ( | const PointSet & | ps | ) | [virtual] |
Creates a uniform pyramid from a PointSet.
Requires Preprocess() or ReadFromStream() to be called first. This function allocates memory on its own; it is up to the caller to free the memory. Note that the input point set should not be on the same scale as the point sets that the UniformPyramidMaker was constructed with. If you specified a nonzero discretize_factor
in the constructor, the PointSet <ps> will automatically be scaled according to that. Additionally, any translations (if you told the constructor to do so) will also be applied automatically-- you should not have to shift or scale anything in <ps> before calling MakePyramid() on it.
Implements PyramidMaker.
vector< MultiResolutionHistogram * > MakePyramids | ( | const PointSetList & | psl | ) | [inherited] |
Turn a list of PointSets into a bunch of MultiResolutionHistograms.
It is up to the caller to free the memory.