~ubuntu-branches/ubuntu/utopic/sikuli/utopic

« back to all changes in this revision

Viewing changes to .pc/no-opencv-surf-module.patch/sikuli-script/src/main/native/imgdb.h

  • Committer: Package Import Robot
  • Author(s): Gilles Filippini
  • Date: 2012-06-25 12:33:23 UTC
  • mfrom: (4.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20120625123323-p3aijrrzi3ohgste
Tags: 1.0~x~rc3.tesseract3-dfsg1-5
New patch no-opencv-surf-module.patch: 
Remove unsused portions of source code with dependency on the opencv
SURF module which isn't shipped anymore starting with opencv 2.4
because of being non-free (Closes: #678230)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2010-2011, Sikuli.org
 
3
 * Released under the MIT License.
 
4
 *
 
5
 */
 
6
 
 
7
#ifndef _IMGDB_H_
 
8
#define _IMGDB_H_
 
9
 
 
10
#include "cvgui.h"
 
11
 
 
12
class ImageRecord{
 
13
   
 
14
   
 
15
public:
 
16
   
 
17
   int id;
 
18
   int screenshot_id;
 
19
   int x;
 
20
   int y;
 
21
   int height;
 
22
   int width;
 
23
   int area;
 
24
   
 
25
   int mr;
 
26
   int mg;
 
27
   int mb;
 
28
   
 
29
   //Scalar mean;
 
30
   //Scalar std;
 
31
   
 
32
   //   static vector<ImageRecord>
 
33
   //   create_from_blobs(const Mat& src, const vector<Blob> image_blobs);
 
34
   //   
 
35
   //   static vector<ImageRecord>
 
36
   //   create_from_imagefile(const char* filename);
 
37
   
 
38
   void write(std::ostream& output_stream);
 
39
   void read(std::istream& input_stream);
 
40
   
 
41
};
 
42
 
 
43
 
 
44
 
 
45
class Database{
 
46
   
 
47
public:   
 
48
   Database();
 
49
   
 
50
   void insert(const ImageRecord& b);
 
51
   vector<ImageRecord> find(const ImageRecord& q);
 
52
   
 
53
   
 
54
   // File is broken into components, return the top match
 
55
   // of each component
 
56
   vector<ImageRecord> find(const char* filename);
 
57
   vector<ImageRecord> find(Mat image);   
 
58
   
 
59
   void insert_file(const char* filename, int screenshot_id);   
 
60
   
 
61
   
 
62
   void write(std::ostream& output_stream);
 
63
   void read(std::istream& input_stream);   
 
64
   
 
65
private:
 
66
   
 
67
   vector<ImageRecord> _image_records;
 
68
   
 
69
   vector<ImageRecord> create_image_records_from_blobs(const Mat& src, const vector<Blob> image_blobs);
 
70
   vector<ImageRecord> create_image_records_from_imagefile(const char* imagefile);
 
71
   vector<ImageRecord> create_image_records_from_image(Mat image);   
 
72
   
 
73
};
 
74
 
 
75
#endif