X-Boost  2.3.8
ImageUtils.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 _IMAGE_UTILS_H
22 #define _IMAGE_UTILS_H
23 
24 #include "Image.h"
25 #include "Types.h"
26 #include "IntegralImage.h"
27 
33 class ImageResampler {
37 public:
39  ~ImageResampler();
40 
41  void ImportImage(const ImageHandle & in);
42  void ExportImage(ImageHandle & out, const rect & area);
43  void ExportImage(ImageHandle & out);
44 };
45 
47 void Convert(ImageHandle & out, const ImageHandle & in);
48 
50 void Resample(ImageHandle & out, const ImageHandle & in, const rect & area);
51 
53 void BilinearResample(ImageHandle & out, const ImageHandle & in, const rect & area);
54 
56 void DrawRect(ImageHandle & out, rect r, unsigned int color);
57 
59 void DrawBox(ImageHandle & out, rect r, unsigned int color);
60 
62 void BlendBox(ImageHandle & out, rect r, unsigned int color, float factor);
63 
65 void Downsample2X(ImageHandle & out, const ImageHandle & in);
66 
68 void Downsample1_5X(ImageHandle & out, const ImageHandle & in);
69 
71 void Downsample2X(ImageHandle & out, const ImageHandle & in, const rect & area);
72 
73 #endif
Types involved in boosting.
Definition: Image.h:35
void Downsample1_5X(ImageHandle &out, const ImageHandle &in)
Downsample a factor of 1.5 the whole image.
void Downsample2X(ImageHandle &out, const ImageHandle &in)
Downsample (a factor of 2) the whole image.
void Resample(ImageHandle &out, const ImageHandle &in, const rect &area)
Crop and Resample an Image using IntegralImage algorithm.
void Convert(ImageHandle &out, const ImageHandle &in)
convert color to greyscale and viceversa
method to hold an image
void BilinearResample(ImageHandle &out, const ImageHandle &in, const rect &area)
Crop and Resample an Image using Bilinear Interpolation algorithm.
a rectangle structure
Definition: Types.h:55
void BlendBox(ImageHandle &out, rect r, unsigned int color, float factor)
Draw a Transparent Box over an image.
void DrawBox(ImageHandle &out, rect r, unsigned int color)
Draw a Box over an image.
Definition: ImageUtils.h:35
void DrawRect(ImageHandle &out, rect r, unsigned int color)
Draw a rectangle over an image.