blob: ac6cdae54187d302a6e7eb3a81a2423e26808a24 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
// NEURALNET.cpp : Defines the entry point for the DLL application.
//
#include "NeuralNet.h"
#include "LTKShapeRecognizer.h"
#include "NeuralNetShapeRecognizer.h"
#include "LTKException.h"
#include "LTKErrors.h"
#include "LTKOSUtilFactory.h"
#include "LTKOSUtil.h"
#ifdef _WIN32
#include <windows.h>
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
#endif
/**********************************************************************************
* AUTHOR : Saravanan R
* DATE : 23-Jan-2007
* NAME : createShapeRecoginizer
* DESCRIPTION : Creates instance of type NNShaperecongnizer and retuns of type
LTKShapeRecognizer. (Acts as a Factory Method).
* ARGUMENTS :
* RETURNS : returns an instace of type LTKShapeRecoginzer.
* NOTES :
* CHANGE HISTORY
* Author Date Description
*************************************************************************************/
int createShapeRecognizer(const LTKControlInfo& controlInfo,
LTKShapeRecognizer** ptrObj )
{
try
{
*ptrObj = new NeuralNetShapeRecognizer(controlInfo);
return SUCCESS;
}
catch(LTKException e)
{
LTKReturnError(e.getErrorCode());
}
}
/**********************************************************************************
* AUTHOR : Saravanan R
* DATE : 23-Jan-2007
* NAME : deleteShapeRecoginzer
* DESCRIPTION : Destroy the instance by taking the address as its argument.
* ARGUMENTS : Address of LTKShapeRecognizer instance.
* RETURNS : Returns 0 on Success
* NOTES :
* CHANGE HISTORY
* Author Date Description
*************************************************************************************/
int deleteShapeRecognizer(LTKShapeRecognizer *obj)
{
try
{
if (obj != NULL )
{
delete obj;
obj = NULL;
}
}
catch(LTKException e)
{
LTKReturnError(e.getErrorCode());
}
return SUCCESS;
}
/**********************************************************************************
* AUTHOR :Tarun Madan
* DATE :
* NAME :
* DESCRIPTION :
* ARGUMENTS :
* RETURNS :
* NOTES :
* CHANGE HISTROY
* Author Date Description of change
*************************************************************************************/
int getTraceGroups(LTKShapeRecognizer *obj, int shapeId,
int numberOfTraceGroups,
vector<LTKTraceGroup> &outTraceGroups)
{
int errorCode = ((NeuralNetShapeRecognizer*)obj)->getTraceGroups(shapeId,
numberOfTraceGroups, outTraceGroups);
if ( errorCode != SUCCESS )
{
LTKReturnError(errorCode);
}
return SUCCESS;
}
|