1 #ifndef _LIGHTCOLLECTOR_H
2 #define _LIGHTCOLLECTOR_H
10 * Collects lighting clues. This class apply an homography to a planar mesh and
11 * average colors within triangles. The LightMap class can use these measures
12 * to estimate a radiance map.
14 class LightCollector
{
17 LightCollector(const LightCollector
&lc
);
19 const LightCollector
&operator=(LightCollector
&lc
);
20 void copy(const LightCollector
&lc
);
22 //! Generate a regular grid given its 4 corners.
23 bool genGrid(float corners
[4][2], int nx
, int ny
);
25 void averageImage(IplImage
*im
, CvMat
*_homography
);
28 void serialize(char *buffer
);
29 void load(const char *buffer
, int size
);
33 void drawGrid(IplImage
*im
, CvMat
*_homography
);
34 void drawAvg(IplImage
*im
);
38 bool cmpWithRef(const LightCollector
&ref
, float *val
, const float *scale
=0, const float *shift
=0);
43 CvMat
*vertices
, *transformed
;