2 Copyright 2005, 2006 Computer Vision Lab,
3 Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland.
4 Modified by Damian Stewart <damian@frey.co.nz> 2009-2010;
5 modifications Copyright 2009, 2010 Damian Stewart <damian@frey.co.nz>.
7 Distributed under the terms of the GNU General Public License v3.
9 This file is part of The Artvertiser.
11 The Artvertiser is free software: you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 The Artvertiser is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU Lesser General Public License
22 along with The Artvertiser. If not, see <http://www.gnu.org/licenses/>.
26 #ifndef _LIGHTCOLLECTOR_H
27 #define _LIGHTCOLLECTOR_H
35 * Collects lighting clues. This class apply an homography to a planar mesh and
36 * average colors within triangles. The LightMap class can use these measures
37 * to estimate a radiance map.
39 class LightCollector
{
42 LightCollector(const LightCollector
&lc
);
44 const LightCollector
&operator=(LightCollector
&lc
);
45 void copy(const LightCollector
&lc
);
47 //! Generate a regular grid given its 4 corners.
48 bool genGrid(float corners
[4][2], int nx
, int ny
);
50 void averageImage(IplImage
*im
, CvMat
*_homography
);
53 void serialize(char *buffer
);
54 void load(const char *buffer
, int size
);
58 void drawGrid(IplImage
*im
, CvMat
*_homography
);
59 void drawAvg(IplImage
*im
);
63 bool cmpWithRef(const LightCollector
&ref
, float *val
, const float *scale
=0, const float *shift
=0);
68 CvMat
*vertices
, *transformed
;