IntegralImage.h
Go to the documentation of this file.
1 /*
2  * This file is part of ALVAR, A Library for Virtual and Augmented Reality.
3  *
4  * Copyright 2007-2012 VTT Technical Research Centre of Finland
5  *
6  * Contact: VTT Augmented Reality Team <alvar.info@vtt.fi>
7  * <http://www.vtt.fi/multimedia/alvar.html>
8  *
9  * ALVAR is free software; you can redistribute it and/or modify it under the
10  * terms of the GNU Lesser General Public License as published by the Free
11  * Software Foundation; either version 2.1 of the License, or (at your option)
12  * any later version.
13  *
14  * This library is distributed in the hope that it will be useful, but WITHOUT
15  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
17  * for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with ALVAR; if not, see
21  * <http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html>.
22  */
23 
24 #ifndef INTEGRAL_IMAGE_H
25 #define INTEGRAL_IMAGE_H
26 
34 #include "Alvar.h"
35 #include <cxcore.h>
36 #include <cv.h>
37 
38 namespace alvar {
39 
56 protected:
57  int index;
58  int step;
60  int estep;
61  int next_step;
62  int res;
63  int steps;
64  void update_next_step();
65 public:
70  IntIndex(int _res, int _steps);
73  int operator=(int v);
75  int next();
77  int get() const;
79  int get_next_step() const;
81  int end() const;
82 };
83 
84 
101  IplImage *sum;
102 public:
103  IntegralImage();
104  ~IntegralImage();
108  void Update(IplImage *gray);
113  double GetSum(CvRect &rect, int *count=0);
115  double GetAve(CvRect &rect);
124  void GetSubimage(const CvRect &rect, IplImage *sub);
125 };
126 
137 protected:
138  IplImage *normalx;
139  IplImage *normaly;
142  // Calculate point normals for 4-pixel intersection
143  // as described in Donahue1992
144  void CalculatePointNormals(IplImage *gray);
145 public:
147  ~IntegralGradient();
151  void Update(IplImage *gray);
157  void GetGradient(CvRect &rect, double *dirx, double *diry, int *count=0);
162  void GetAveGradient(CvRect &rect, double *dirx, double *diry);
163 };
164 
165 } // namespace alvar
166 
167 #endif
Main ALVAR namespace.
Definition: Alvar.h:174
Class for calculating "evenly spaced" integer indices for data sequence.
Definition: IntegralImage.h:55
IntegralImage is used for calculating rectangular image sums and averages rapidly ...
cv::Mat gray
IntegralGradient is used for calculating rectangular image gradients rapidly
#define ALVAR_EXPORT
Definition: Alvar.h:168
This file defines library export definitions, version numbers and build information.


ar_track_alvar
Author(s): Scott Niekum
autogenerated on Mon Jun 10 2019 12:47:04