source: foam/trunk/experiments/src/Image.h @ 80

Revision 80, 1.6 KB checked in by dave, 11 years ago (diff)

new makefile and renamed stuff

Line 
1// Copyright (C) 2009 foam
2//
3// This program is free software; you can redistribute it and/or modify
4// it under the terms of the GNU General Public License as published by
5// the Free Software Foundation; either version 2 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11// GNU General Public License for more details.
12//
13// You should have received a copy of the GNU General Public License
14// along with this program; if not, write to the Free Software
15// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16
17#include "cv.h"
18#include <string>
19
20#ifndef IMAGE
21#define IMAGE
22
23class Image
24{
25public:
26        Image(int w, int h, int d, int c);
27        Image(const std::string &filename);
28        Image(const Image *other);
29        ~Image();
30
31        void PrintInfo();
32       
33        void Crop(int x, int y, int w, int h);
34        void Scale(int w, int h);
35
36        // Paste an image into this one
37        void Blit(const Image &image, CvPoint pos);
38       
39        // Return a sum of squared differences, for giving a similarity metric
40        float SSD(Image &other);
41       
42        // Subtract the mean - this is useful for accounting for global lighting changes
43        void SubMean();
44       
45        // Convert the image into a local binary patterns image
46        void LBP();
47       
48        // Convert to different colour spaces
49        void GRAY2RGB();
50        void RGB2GRAY();
51        void BayerGB2RGB();
52       
53        // Calculate a histogram for a given channel
54        unsigned int *Hist(int channel);
55       
56        IplImage *m_Image;
57       
58private:
59        unsigned char SafeGet2D(int y, int x, int c);
60};
61
62#endif
Note: See TracBrowser for help on using the repository browser.