Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Image.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2007-2008 Anael Orlinski
3 *
4 * This file is part of Panomatic.
5 *
6 * Panomatic is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * Panomatic is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Panomatic; if not, write to the Free Software
18 * <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef __lfeat_image_h
22 #define __lfeat_image_h
23 
24 #include "KeyPoint.h"
25 #include "vigra/stdimage.hxx"
26 
27 namespace lfeat
28 {
29 
30 // forward declaration
31 class IntegralImage;
32 
34 {
35 public:
36  Image() : _width(0), _height(0), _ii(0) {};
37 
38  // Constructor from a pixel array (C style)
39  explicit Image(vigra::DImage &img);
40  // setup the integral image
41  void init(vigra::DImage &img);
42 
43  // cleanup
44  void clean();
45 
46  // Destructor
47  ~Image();
48 
49  // Accessors
50  inline double** getIntegralImage()
51  {
52  return _ii;
53  }
54  inline unsigned int getWidth()
55  {
56  return _width;
57  }
58  inline unsigned int getHeight()
59  {
60  return _height;
61  }
62 
63  // allocate and deallocate integral image pixels
64  static double** AllocateImage(unsigned int iWidth, unsigned int iHeight);
65  static void DeallocateImage(double** iImagePtr, unsigned int iHeight);
66 
67 private:
68 
69  // prepare the integral image
70  void buildIntegralImage(vigra::DImage &img);
71 
72  // image size
73  unsigned int _width;
74  unsigned int _height;
75 
76  // integral image
77  double**_ii; // Data of the integral image Like data[lines][rows]
78 };
79 
80 }
81 
82 #endif //__lfeat_image_h
83 
unsigned int getWidth()
Definition: Image.h:54
unsigned int getHeight()
Definition: Image.h:58
double ** getIntegralImage()
Definition: Image.h:50
unsigned int _width
Definition: Image.h:73
unsigned int _height
Definition: Image.h:74
double ** _ii
Definition: Image.h:77
#define LFIMPEX
Definition: hugin_shared.h:41