X-Boost  2.3.8
Common.h
Go to the documentation of this file.
1 /* XBoost: Ada-Boost and Friends on Haar/ICF/HOG Features, Library and ToolBox
2  *
3  * Copyright (c) 2008-2014 Paolo Medici <medici@ce.unipr.it>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20 
21 #ifndef _COMMON_TOOLS_H
22 #define _COMMON_TOOLS_H
23 
27 #include "IntegralImage.h"
28 #include <vector>
29 #include <string>
30 // #include "factory.h"
32 
34 typedef std::vector< std::pair<std::string,unsigned int *> > IntegralImagesType;
35 
37 void load_images(IntegralImagesType & out, const char *data_set, unsigned int &width, unsigned int &height);
38 
40 void load_images2(IntegralImagesType & out, const char *data_set, unsigned int &width, unsigned int &height);
41 
42 
45 bool load_image(IntegralImageData & img, IntegralImageParams & params, const char *filename, bool normalize = false);
46 
48 void add_offset(IntegralImagesType & out, const IntegralImagesType & src, long offset);
49 
51 // void compute_responses(const Classifier & c, std::vector<double> & response, const IntegralImagesType & set, long stride, bool extra_border);
52 
55 
56 
57 #endif
void load_images(IntegralImagesType &out, const char *data_set, unsigned int &width, unsigned int &height)
load a training set using a data_set file. fill the vector with (extended) integral image and return ...
a descritor based on a integral image
void add_offset(IntegralImagesType &out, const IntegralImagesType &src, long offset)
bool load_image(IntegralImageData &img, IntegralImageParams &params, const char *filename, bool normalize=false)
void load_images2(IntegralImagesType &out, const char *data_set, unsigned int &width, unsigned int &height)
load a training set using a data_set file. fill the vector with (extended) integral image and return ...
il dato IntegralImage e' pressoche' equivalente a quello di RawData < uint32_t >
Definition: IntegralImageData.h:52
std::vector< std::pair< std::string, unsigned int * > > IntegralImagesType
vector of test images
Definition: Common.h:34
void release_images(IntegralImagesType &out)
release correctly an integral image (manually... or use shared_ptr/auto_ptr)
parameters required to access to integral image and to create features
Definition: IntegralImageData.h:31