ACT-CV - Machine Vision for Cognitive Modeling
ACT-CV.i
Go to the documentation of this file.
1 // -*- mode: c++; indent-tabs-mode: nil; c-basic-offset: 4; coding: iso-8859-1; -*-
2 
3 /*
4 ACT-CV - Machine Vision for Cognitive Modeling
5 Copyright (c) 2010 Marc Halbruegge
6 
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11 
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21 
22 #ifndef __ACT_CV_I
23 #define __ACT_CV_I
24 
33 
35 struct Line {
36  int end1x;
37  int end1y;
38  int end2x;
39  int end2y;
40 };
41 
44  int x;
45  int y;
47  int width;
48  int height;
50  const char *name;
53  ObjectPosition(int xpos, int ypos, int w, int h, const char *n)
54  : x(xpos), y(ypos), width(w), height(h), name(n) {}
55 };
56 
57 
58 #ifndef _WINDOWS
59 
61 void SelectSource(video_source vs);
63 void SelectFileBasedSource(const char *filenameOrURL, video_source vs);
65 void ReleaseSource();
66 
68 void ActCvInit();
70 void ActCvDeInit();
71 
73 void WaitForNextFrame();
74 
80 void SetMatchDefFile(const char *s);
81 
82 // ----------------------------------------------------------------
83 // where does it look and click?
84 
86 void UpdateAttendedLoc(int x, int y);
87 void MoveMouseTo(int x, int y);
88 void MouseClick(int button);
89 void PressKey(int key);
90 
91 // ----------------------------------------------------------------
92 // line recognition
93 
104 int FindFirstLine();
106 int FindNextLine(int handle, struct Line *line);
108 void LineFindFinish(int handle);
109 
120 int FindFirstMatch();
122 int FindNextMatch(int handle, struct ObjectPosition *pos);
124 void MatchFindFinish(int handle);
125 
127 int FindFirstText();
129 int FindNextText(int handle, struct ObjectPosition *pos);
131 void TextFindFinish(int handle);
132 
133 #else
134 
135 __declspec(dllexport) void SelectSource(video_source vs);
136 __declspec(dllexport) void SelectFileBasedSource(const char *filenameOrURL, video_source vs);
137 __declspec(dllexport) void ReleaseSource();
138 __declspec(dllexport) void ActCvInit();
139 __declspec(dllexport) void ActCvDeInit();
140 __declspec(dllexport) void WaitForNextFrame();
141 __declspec(dllexport) void AddRecognition(cv_algorithm a);
142 __declspec(dllexport) void RemoveRecognition(cv_algorithm a);
143 __declspec(dllexport) void SetMatchDefFile(const char *s);
144 __declspec(dllexport) void UpdateAttendedLoc(int x, int y);
145 __declspec(dllexport) void MoveMouseTo(int x, int y);
146 __declspec(dllexport) void MouseClick(int button);
147 __declspec(dllexport) void PressKey(int key);
148 __declspec(dllexport) int FindFirstLine();
149 __declspec(dllexport) int FindNextLine(int handle, struct Line *line);
150 __declspec(dllexport) void LineFindFinish(int handle);
151 __declspec(dllexport) int FindFirstMatch();
152 __declspec(dllexport) int FindNextMatch(int handle, struct ObjectPosition *pos);
153 __declspec(dllexport) void MatchFindFinish(int handle);
154 __declspec(dllexport) int FindFirstText();
155 __declspec(dllexport) int FindNextText(int handle, struct ObjectPosition *pos);
156 __declspec(dllexport) void TextFindFinish(int handle);
157 #endif // _WINDOWS
158 
159 #endif


ACT-CV - Machine Vision for Cognitive Modeling
© 2015 Marc Halbruegge (actcvlibrary@googlemail.com)