technical

jetbase

Interfacing to the Jet Engine
Most users purchase CitySync's Jet Application programs such as JetBase - but CitySync will supply a packaged version of the recognition engine for building into third party software.

The Jet software will free-run i.e. continuously look for vehicles and report plates - but it can also be called from an external application which can pass a still image to it.

CitySync supply a comprehensive API and can supply sample applications for our registered developers.

Most Common API Calls Used

ANPR_Open
Declaration
VB    Public Declare Sub ANPR_Open Lib "anpr" (ByVal hWnd As Long, ByVal hInstance As Long, ByVal mode As Long)

C/C++  int PASCAL ANPR_Open ( HWND hWnd, HINSTANCE hInstance, int Mode );

Calling convention
VB  Call ANPR_Open (hWnd,hInstance,mode)

C/C++  ANPR_Open (hWnd,hInstance,mode);

Description
ANPR_Open is the main initialisation point for the ANPR library. This procedure MUST be called before any other ANPR function.

Parameters
hWnd is the window handle of the applications main form or window.

hInstance is the instance handle of the application got from App.hInstance in VB or passed to WinMain in C/C++. It can also be passed as 0.

mode is currently unused


ANPR_Define
Declaration
VB  Public Declare Sub ANPR_Define Lib "anpr" (ByVal WindowID As Long,ByVal hWnd As Long, ByVal x As Long, ByVal y As Long,ByVal w As Long, ByVal h As Long, ByVal border As Long)

C/C++ int PASCAL ANPR_Define ( int TheId, HWND hwnd, int X, int Y, int W, int H, int Border );

Calling convention
VB  Call ANPR_Define (WindowID,hWnd,x,y,w,h,border)

C/C++  ANPR_Define (WindowID,hWnd,x,y,w,h,border)

Description
ANPR_Define sets up the windows and display co-ordinates for the different graphics output by ANPR.
You can declare all the display windows as the forms main hWnd and then define co-ordinates for each display relative to the form or each display can be assigned to a separate window handle. This means that you can use controls (eg - Image Control) to act as placemarkers for the graphics when designing a form in VB or use child windows in C/C++

Parameters
WindowID  is an identifier to tell the ANPR library which window you are about to define. We will talk about input channels rather than lanes since lanes are used separately as user defined tags - ie the user can assign any Lane ID to any video channel.
The window IDs start at 1000 for main video display windows and 1016 for captured plate display windows. For example,to define the main video window for channel 1, the ID is 1000. For channel 2 it is 1001, channel 3 is 1002 and so on.
Similarly, the ID for the captured plate windows for channels 1,2,3 are 1016, 1017, 1018.

hWnd  is the window handle of the form,control or window in which the graphic described by WindowID is to be placed.
If you use the hWnd of the application or form, the following x,y,w,h co-ordinates will position the display on the applications main window at those co-ordinates.
If you use the hWnd of a child window or Image Control (VB: Any control which has a .hwnd property can be used), then use x,y,w,h as follows:

In VB, pass x,y as 0,0 (the top left corner of the control) and pass w,h as the width and height of the control in pixels.

To calculate width and height in pixels use the following:

w = Control.Width / Screen.TwipsPerPixelX
h = Control.Height / Screen.TwipsPerPixelY
Using C/C++, use GetClientRect to find the dimensions of the window or control.

Note that the live video display will be reduced in size if required to fit in the space allocated but if the allocated space is bigger than the size of the picture, it will not be scaled up but will be placed in the center instead.

x,y,w,h  Define the top left position of the image in pixels (x,y) and the width and height in pixels.

border Defines an optional space around the image in pixels.


ANPR_SelectInput
Declaration
VB  Public Declare Sub ANPR_SelectInput Lib "anpr" (ByVal mode As Long, ByVal inputtype As Long)

C/C++ int PASCAL ANPR_SelectInput ( int mode, int inputtype );

Calling convention
VB  Call ANPR_SelectInput (mode,inputtype)

C/C++  ANPR_SelectInput (mode,inputtype);

Description
ANPR_SelectInput selects the type of video/image source to be used by the recognition engine. The input source can be a still BMP image file, an AVI Video for Windows movie file or live video input from the capture card.

Parameters
mode  is currently unused

inputtype Select the source
  = 0 to select BMP image file
  = 1 to select live video from capture card
  = 2 to select Video for Windows AVI clip

ANPR_Poll
Declaration
VB  Public Declare Function ANPR_Poll Lib "anpr" (ByRef channel As Long, ByVal strReturnedString As String, ByRef conf As Long, ByRef UCTTime As Long) As Long

C/C++ int PASCAL ANPR_Poll ( int *channel, char *pPlate, int *pConfidence, long *pTime );

Calling convention
VB  channel = 0
       strReturnedString = string$ (" ",255)
       conf = 0
       UCTTime = 0
       status = ANPR_Poll (channel,strReturnedString, conf,UCTTime)

C/C++ status = ANPR_Poll (&channel,strReturnedString, &conf,&UCTTime);

Description
ANPR_Poll is the main recognition function. It returns the most recent plate found and the input channel it came from.

Parameters
Note: It is important that the string passed (strReturnedString) is a valid string exisiting in memory since the strReturnedString parameter is a pointer to this string.
If a plate has been found, the parameters return the following:

channel  The channel from which the current plate is captured.

strReturnedString  The actual number plate captured.

conf  An internal confidence number.

UCTTime  The time of capture in Coordinated Universal Time (WIndows 98/NT standard). This is the number of seconds elapsed since midnight (00:00:00), January 1, 1970, coordinated universal time, according to the system clock.
In C/C++ you can use the asctime and localtime functions to convert this to ASCII format.

Returns
ANPR_Poll returns the number of characters returned in strReturnedString or 0 if no plate has been found.


ANPR_Close
Declaration
VB  Public Declare Sub ANPR_Close Lib "anpr" (ByVal hWnd As Long, ByVal mode As Long)

C/C++ void PASCAL ANPR_Close ( HWND hWnd, int mode );

Calling convention
VB  Call ANPR_Close (hWnd,mode)

C/C++  ANPR_Close (hWnd,mode);

Description
ANPR_Close is used to close and unload the ANPR library.
It is important to call this procedure when the program closes otherwise the program may not open correctly without restarting the PC.

Parameters
hWnd  is the window handle of the applications main window or form

mode  is currently unused


ANPR_Preferences
Declaration
VB  Public Declare Sub ANPR_Preferences Lib "anpr" (ByVal mode As Long)

C/C++ void PASCAL ANPR_Preferences( int mode );

Calling convention
VB  Call ANPR_Preferences (mode)

C/C++  ANPR_Preferences (mode);

Description
ANPR_Preferences brings up the standard ANPR Options dialog box, allowing the user to edit some of the ANPR settings. The full range of settings and the relative ini file entries are described elsewhere.

Parameters
mode  is currently unused


ANPR_OpenBarrier
Declaration

VB  Public Declare Sub ANPR_OpenBarrier Lib "anpr" ()

C/C++ void PASCAL ANPR_OpenBarrier( void );

Calling convention
VB  Call ANPR_OpenBarrier

C/C++  ANPR_OpenBarrier ();

Description
ANPR_OpenBarrier is used to signal an external barrier to open. This function can only be used if CitySync Ltd's 8 or 12 channel i/o card is fitted. Contact CitySync for details.

Parameters
..contact CitySync for further details.