OCR_RTC  0.5.0
 全て クラス ファイル 関数 変数
OCR.h
説明を見る。
1 // -*- C++ -*-
10 #ifndef OCR_H
11 #define OCR_H
12 
13 #include <rtm/Manager.h>
14 #include <rtm/DataFlowComponentBase.h>
15 #include <rtm/CorbaPort.h>
16 #include <rtm/DataInPort.h>
17 #include <rtm/DataOutPort.h>
18 #include <rtm/idl/BasicDataTypeSkel.h>
19 #include <rtm/idl/ExtendedDataTypesSkel.h>
20 #include <rtm/idl/InterfaceDataTypesSkel.h>
21 
22 #include <opencv2/core/core.hpp>
23 #include <opencv2/highgui/highgui.hpp>
24 #include <opencv2/imgproc/imgproc_c.h>
25 #include <opencv2/imgproc/imgproc.hpp>
26 
27 #include "SubFunction.h"
28 
29 // Service implementation headers
30 // <rtc-template block="service_impl_h">
31 
32 // </rtc-template>
33 
34 // Service Consumer stub headers
35 // <rtc-template block="consumer_stub_h">
36 #include "InterfaceDataTypesStub.h"
37 #include "BasicDataTypeStub.h"
38 
39 // </rtc-template>
40 
41 using namespace RTC;
42 
48 class OCR
49  : public RTC::DataFlowComponentBase
50 {
51  public:
56  OCR(RTC::Manager* manager);
57 
61  ~OCR();
62 
63  // <rtc-template block="public_attribute">
64 
65  // </rtc-template>
66 
67  // <rtc-template block="public_operation">
68 
69  // </rtc-template>
70 
71  /***
72  *
73  * The initialize action (on CREATED->ALIVE transition)
74  * formaer rtc_init_entry()
75  *
76  * @return RTC::ReturnCode_t
77  *
78  *
79  */
80  virtual RTC::ReturnCode_t onInitialize();
81 
82  /***
83  *
84  * The finalize action (on ALIVE->END transition)
85  * formaer rtc_exiting_entry()
86  *
87  * @return RTC::ReturnCode_t
88  *
89  *
90  */
91  // virtual RTC::ReturnCode_t onFinalize();
92 
93  /***
94  *
95  * The startup action when ExecutionContext startup
96  * former rtc_starting_entry()
97  *
98  * @param ec_id target ExecutionContext Id
99  *
100  * @return RTC::ReturnCode_t
101  *
102  *
103  */
104  // virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id);
105 
106  /***
107  *
108  * The shutdown action when ExecutionContext stop
109  * former rtc_stopping_entry()
110  *
111  * @param ec_id target ExecutionContext Id
112  *
113  * @return RTC::ReturnCode_t
114  *
115  *
116  */
117  // virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id);
118 
119  /***
120  *
121  * The activated action (Active state entry action)
122  * former rtc_active_entry()
123  *
124  * @param ec_id target ExecutionContext Id
125  *
126  * @return RTC::ReturnCode_t
127  *
128  *
129  */
130  virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
131 
132  /***
133  *
134  * The deactivated action (Active state exit action)
135  * former rtc_active_exit()
136  *
137  * @param ec_id target ExecutionContext Id
138  *
139  * @return RTC::ReturnCode_t
140  *
141  *
142  */
143  virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
144 
145  /***
146  *
147  * The execution action that is invoked periodically
148  * former rtc_active_do()
149  *
150  * @param ec_id target ExecutionContext Id
151  *
152  * @return RTC::ReturnCode_t
153  *
154  *
155  */
156  virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
157 
158  /***
159  *
160  * The aborting action when main logic error occurred.
161  * former rtc_aborting_entry()
162  *
163  * @param ec_id target ExecutionContext Id
164  *
165  * @return RTC::ReturnCode_t
166  *
167  *
168  */
169  // virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id);
170 
171  /***
172  *
173  * The error action in ERROR state
174  * former rtc_error_do()
175  *
176  * @param ec_id target ExecutionContext Id
177  *
178  * @return RTC::ReturnCode_t
179  *
180  *
181  */
182  // virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id);
183 
184  /***
185  *
186  * The reset action that is invoked resetting
187  * This is same but different the former rtc_init_entry()
188  *
189  * @param ec_id target ExecutionContext Id
190  *
191  * @return RTC::ReturnCode_t
192  *
193  *
194  */
195  // virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id);
196 
197  /***
198  *
199  * The state update action that is invoked after onExecute() action
200  * no corresponding operation exists in OpenRTm-aist-0.2.0
201  *
202  * @param ec_id target ExecutionContext Id
203  *
204  * @return RTC::ReturnCode_t
205  *
206  *
207  */
208  // virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id);
209 
210  /***
211  *
212  * The action that is invoked when execution context's rate is changed
213  * no corresponding operation exists in OpenRTm-aist-0.2.0
214  *
215  * @param ec_id target ExecutionContext Id
216  *
217  * @return RTC::ReturnCode_t
218  *
219  *
220  */
221  // virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id);
222 
223 
224  protected:
225  // <rtc-template block="protected_attribute">
226 
227  // </rtc-template>
228 
229  // <rtc-template block="protected_operation">
230 
231  // </rtc-template>
232 
233  // DataInPort declaration
234  // <rtc-template block="inport_declare">
235  CameraImage m_image;
238  InPort<CameraImage> m_imageIn;
239 
240  // </rtc-template>
241 
242 
243  // DataOutPort declaration
244  // <rtc-template block="outport_declare">
245  TimedStringSeq m_wordList;
248  OutPort<TimedStringSeq> m_wordListOut;
249  TimedString m_string;
252  OutPort<TimedString> m_stringOut;
253 
254  // </rtc-template>
255 
256  // CORBA Port declaration
257  // <rtc-template block="corbaport_declare">
258 
259  // </rtc-template>
260 
261  // Service declaration
262  // <rtc-template block="service_declare">
263 
264  // </rtc-template>
265 
266  // Consumer declaration
267  // <rtc-template block="consumer_declare">
268 
269  // </rtc-template>
270 
271  private:
272  std::string file_path;
273  std::string input_type;
274  std::string languages;
275  std::string tmp_directory_path;
276  IplImage* m_imageBuff;
277 
278  // <rtc-template block="private_attribute">
279 
280  // </rtc-template>
281 
282  // <rtc-template block="private_operation">
283 
284  // </rtc-template>
285 
286 };
287 
288 
289 extern "C"
290 {
291  DLL_EXPORT void OCRInit(RTC::Manager* manager);
292 };
293 
294 #endif // OCR_H