Types
WNRENGINE

Handle of WNREngine object

Used to handle pointer (void *) to WNREngine object

WNRPARAMS

Handle of WNRParams object

Used to handle pointer (void *) to WNRParams object

WNRRESULT

Handle of WNRResult object

Used to handle pointer (void *) to WNRResult object

WNRNUMBER

Handle of WagonNumber object

Used to handle pointer (void *) to WagonNumber object

Callbacks
WagonNumberDetectedCallback

Invokes by WNREngine object on wagon number detection

Parameters
hEngine

Handle of WNREngine object

hWagonNum

Handle of WagonNumber object

Notes

WagonNumber object must be deleted using function WagonNumber_Destroy

WNREngine Functions
WNREngine_Create
WNRENGINE DTKWNRAPI WNREngine_Create(
WNRPARAMS hParams,
bool bVideo,
WagonNumberDetectedCallback wagonNumberDetectedCallback
)

Create new WNREngine instance

Parameters
hParams

Handle of WNRParams object

bVideo
bool

If this value is true, the engine will be initialized in video mode, otherwise - in still image mode

wagonNumberDetectedCallback

WAgonNumberDetectedCallback function (for video mode), use Null for still image mode

Return

Handle of WNREngine object

WNREngine_Destroy
void DTKWNRAPI WNREngine_Destroy(
WNRENGINE hEngine
)

Destroy WNREngine instance

Parameters
hEngine

Handle of WNREngine object

WNREngine_ReadFromFile
WNRRESULT DTKWNRAPI WNREngine_ReadFromFile(
WNRENGINE hEngine,
const charfileName
)

Reads wagon numbers from image file (JPEG, BMP, PNG)

Parameters
hEngine

Handle of WNREngine object

fileName
const char*

Path to image file

Return

Handle of WNRResult object

Notes

WNRResult object must be deleted using function WNRResult_Destroy This function can be used for still image mode only.

WNREngine_ReadFromMemFile
WNRRESULT DTKWNRAPI WNREngine_ReadFromMemFile(
WNRENGINE hEngine,
voidpBuffer,
int bufferSize
)

Reads wagon numbers from image file (JPEG, BMP, PNG) contained in the memory

Parameters
hEngine

Handle of WNREngine object

pBuffer
void*

Pointer to a memory buffer containing the image file data

bufferSize
int

size of memory buffer in bytes

Return

Handle of WNRResult object

Notes

WNRResult object must be deleted using function WNRResult_Destroy This function can be used for still image mode only.

WNREngine_ReadFromURL
WNRRESULT DTKWNRAPI WNREngine_ReadFromURL(
WNRENGINE hEngine,
const charurl
)

Reads wagon numbers from image file (JPEG, BMP, PNG) from URL

Parameters
hEngine

Handle of WNREngine object

url
const char*

URL string, example: http://​domain​.com​/image​.jpg

Return

Handle of WNRResult object

Notes

WNRResult object must be deleted using function WNRResult_Destroy This function can be used for still image mode only.

WNREngine_ReadFromImageBuffer
WNRRESULT DTKWNRAPI WNREngine_ReadFromImageBuffer(
WNRENGINE hEngine,
voidpBuffer,
int width,
int height,
int stride,
PIXFMT pixelFormat
)

Reads wagon numbers from image buffer

Parameters
hEngine

Handle of WNREngine object

pBuffer
void*

Pointer to buffer of image pixels data

width
int

Width of image in pixels

height
int

Height of image in pixels

stride
int

Size of one image row in bytes

pixelFormat

Pixel format, PIXFMT enumeration

Return

Handle of WNRResult object

Notes

WNRResult object must be deleted using function WNRResult_Destroy

This function can be used for still image mode only.

WNREngine_PutFrame
int DTKWNRAPI WNREngine_PutFrame(
WNRENGINE hEngine,
VIDEOFRAME hFrame,
int64 customData
)

Send video frame to engine (for video mode only)

Parameters
hEngine

Handle of WNREngine object

hFrame

Handle of VideoFrame object

customData
int64

Custom 64 bit integer value which can be used identify frame by recognized plate. This value will be assigned to WagonNumber object.

Returns

Possible values:

0

no error

1

engine do not have valid license

2

engine have valid license but have not available channel to work

3

frame dropped due to processing queue overflow

WNREngine_PutFrameImageBuffer
int DTKWNRAPI WNREngine_PutFrameImageBuffer(
WNRENGINE hEngine,
voidpBuffer,
int width,
int height,
int stride,
PIXFMT pixelFormat,
int64 timestamp,
int64 customData
)

Send video frame to engine (for video mode only)

Parameters
hEngine

Handle of WNREngine object

pBuffer
void*

Pointer to buffer of image pixels data

width
int

Width of image in pixels

height
int

Height of image in pixels

stride
int

Size of one image row in bytes

pixelFormat

Pixel format, PIXFMT enumeration

timestamp
int64

Frame timestamp received from camera (optional). If you have not this value, then use -1

customData
int64

Custom 64 bit integer value which can be used identify frame by recognized wagon number. This value will be assigned to WagonNumber object.

Returns

Possible values:

0

no error

1

engine do not have valid license

2

engine have valid license but have not available channel to work

3

frame dropped due to processing queue overflow

WNREngine_GetProcessingFPS
int DTKWNRAPI WNREngine_GetProcessingFPS(
WNRENGINE hEngine
)

Return current processing FPS (for video mode only)

Parameters
hEngine

Handle of WNREngine object

Returns

Current video processing FPS. It can be less then incoming FPS from camera.

Notes

This function can be used for video mode only.

WNREngine_IsQueueEmpty
bool DTKWNRAPI WNREngine_IsQueueEmpty(
WNRENGINE hEngine
)

Gets the value indicating whether the WNR engine has processed the frame queue, and queue is empty.

Parameters
hEngine

Handle of WNREngine object

Returns
Boolean value, True

frame processing queue is empty, False - frame processing queue is not empty.

Notes

This property can be used to wait for the WNR Engine to finish its work and process all frames sent using WNREngine_PutFrameImageBuffer function.

This function can be used for video mode only.

WNREngine_IsLicensed
int DTKWNRAPI WNREngine_IsLicensed(
WNRENGINE hEngine
)

Check if WNR engine is licensed

Parameters
hEngine

Handle of WNREngine object

Returns

Returns value 0 in case the engine have valid license

Returns value 1 in case the engine do not have valid license

Returns value 2 in case the engine have valid license, but have not available channel to work

Returns value 3 in case the engine cannot validate trial license (for trial version only)

License Functions
WNREngine_ActivateLicenseOnline
int DTKWNRAPI WNREngine_ActivateLicenseOnline(
const charlicenseKey,
const charcomments
)

Activates license on-line

Parameters
licenseKey
const char*

String containing the license key

comments
const char*

String containing comments to assign to activation (optional)

Returns

0 on success, error code otherwise

Notes

The Internet connection (host: dtksoft.com port: 80) is required to perform license activation The optional comments parameter can be used to identify certain license activation, for example machine name or customer name can be used.

WNREngine_ActivateLicenseOnlineEx
int DTKWNRAPI WNREngine_ActivateLicenseOnlineEx(
const charlicenseKey,
const charcomments,
int channels,
const charsecurity_key
)

Activates license on-line (extended)

Parameters
licenseKey
const char*

String containing the license key

comments
const char*

String containing comments to assign to activation(optional)

channels
int

Number of channels

security_key
const char*

Security key

Returns

0 on success, error code otherwise

Notes

The Internet connection (host: dtksoft.com port: 80) is required to perform license activation The optional comments parameter can be used to identify certain license activation, for example machine name or customer name can be used.  This function should be used for special licenses that support activation of a certain number of channels and/or using a security key for activation.

WNREngine_GetActivationLink
int DTKWNRAPI WNREngine_GetActivationLink(
const charlicenseKey,
const charcomments,
charactivationLink,
int size
)

Returns activation link to activate the defined license key

Parameters
licenseKey
const char*

String which contain license key

comments
const char*

String which contain comments assigned to activation (optional)

activationLink
char*

Pointer to string buffer which receives activation link

size
int

Size of string buffer

Returns

Number of bytes copied to buffer. If activationLink = NULL or size = 0, then function return number of bytes required to store the result string

Notes

The Internet connection (host: dtksoft.com port: 80) is required to perform license activation The optional comments parameter can be used to identify certain license activation, for example machine name or customer name can be used.

WNREngine_GetActivationLinkEx
int DTKWNRAPI WNREngine_GetActivationLinkEx(
const charlicenseKey,
const charcomments,
int channels,
const charsecurity_key,
charactivationLink,
int size
)

Returns activation link to activate the defined license key (extended)

Parameters
licenseKey
const char*

String which contain license key

comments
const char*

String which contain comments assigned to activation (optional)

channels
int

Number of channels

security_key
const char*

Security key

activationLink
char*

Pointer to string buffer which receives activation link

size
int

Size of string buffer

Returns

Number of bytes copied to buffer. If activationLink = NULL or size = 0, then function return number of bytes required to store the result string

Notes

The Internet connection (host: dtksoft.com port: 80) is required to perform license activation

The optional comments parameter can be used to identify certain license activation, for example machine name or customer name can be used.

This function should be used for special licenses that support activation of a certain number of channels and/or using a security key for activation.

WNREngine_ActivateLicenseOffline
int DTKWNRAPI WNREngine_ActivateLicenseOffline(
const charactivationCode
)

Activates license on machine using activation code

Parameters
activationCode
const char*

String which contain activation code

Returns

0 on success, error code otherwise

Notes

The optional comments parameter can be used to identify certain license activation, for example machine name or customer name can be used.

WNREngine_GetSystemID
int DTKWNRAPI WNREngine_GetSystemID(
charsystem_id,
int system_id_size
)

Gets the current machine/system ID

Parameters
system_id
char*

Pointer to string buffer which receives current machine ID (fingerprint)

system_id_size
int

Size of string buffer

Returns

Number of bytes copied to buffer. If system_id = NULL or system_id_size = 0, then function return number of bytes required to store the result string

WNREngine_GetActivatedLicenseInfo
void DTKWNRAPI WNREngine_GetActivatedLicenseInfo(
charlicense_key,
int license_key_max_len,
charcomments,
int comments_max_len,
intchannels,
time_t* expirationDate
)

Gets the information of the currently activated license: license key, comments, number of channels, expiration date (if applicable)

Parameters
license_key
char*

Pointer to string buffer which receives license key activated on current machine

license_key_max_len
int

Size of string buffer

comments
char*

Pointer to string buffer which receives activation comments

comments_max_len
int

Size of string buffer

channels
int*

Pointer to integer variable which receives number of channels of activated license

expirationDate
time_t*

Pointer to 64bit integer value (time_t C++ type) which receives expiration date of activated license

Notes

If expirationDate value is 0, then license does not expire.

WNREngine_GetLibraryVersion
int DTKWNRAPI WNREngine_GetLibraryVersion(
charbuffer,
int buff_size
)

Return library version

Parameters
buffer
char*

Pointer to string buffer which receives library version

buff_size
int

Size of string buffer

Returns

Number of bytes copied to buffer. If buffer = NULL or buff_size = 0, then function return number of bytes required to store the result string

WNREngine_SetNetLicenseServer
void DTKWNRAPI WNREngine_SetNetLicenseServer(
charip_addres,
int port
)

Sets information about the network license server to use for license verification.

Parameters
ip_addres
char*

IP address of the DTK license server

port
int

port number of the DTK license server, default 54300

Notes

This function enables network licensing for current process. The DTK License Server must be executed on remote or local machine.

To use local machine use ip_addres "127.0.0.1"

To disable network licensing call this function with empty ip_addres parameter.

WNRParams Functions
WNRParams_Create
WNRPARAMS DTKWNRAPI WNRParams_Create()

Creates WNRParams object instance

Returns

Handle of new WNRParams object

WNRParams_Destroy
void DTKWNRAPI WNRParams_Destroy(
WNRPARAMS hParams
)

Destroys the WNRParams object instance

Parameters
hParams

Handle of WNRParams object

WNRParams_get_MinWidth
int DTKWNRAPI WNRParams_get_MinWidth(
WNRPARAMS hParams
)

Gets minimum wagon number width

Parameters
hParams

Handle of WNRParams object

Returns

Minimum wagon number width in pixels

Notes

The minimum/maximum wagon number width parameters are used to tell the engine the expected size of the wagon number on image.

Defining a narrower interval increases recognition speed and decreases CPU resources, but negatively affects recognition accuracy.

The recommended values for min/max width are -/+30% of real wagon number width. For example, if we have wagon number 200 pixels in width, then you can define values 140/260.

If the recognition accuracy is not enough, you can try to decrease minimum width to get better results.

Default value is 80. Minimum value is 70. Maximum value is 1000.

WNRParams_set_MinWidth
void DTKWNRAPI WNRParams_set_MinWidth(
WNRPARAMS hParams,
int minWidth
)

Sets the minimum width of the wagon number

Parameters
hParams

Handle of WNRParams object

minWidth
int

Minimum width of the wagon number in pixels

Notes

The minimum/maximum wagon number width parameters are used to tell the engine the expected size of the wagon number on image.

Defining a narrower interval increases recognition speed and decreases CPU resources, but negatively affects recognition accuracy.

The recommended values for min/max width are -/+30% of real wagon number width. For example, if we have wagon number 200 pixels in width, then you can define values 140/260.

If the recognition accuracy is not enough, you can try to decrease minimum width to get better results.

Default value is 80. Minimum value is 70. Maximum value is 1000.

WNRParams_get_MaxWidth
int DTKWNRAPI WNRParams_get_MaxWidth(
WNRPARAMS hParams
)

Gets the minimum width of the wagon number

Parameters
hParams

Handle of WNRParams object

Returns

Maximum width of the wagon number in pixels

Notes

The minimum/maximum wagon number width parameters are used to tell the engine the expected size of the wagon number on image.

Defining a narrower interval increases recognition speed and decreases CPU resources, but negatively affects recognition accuracy.

The recommended values for min/max width are -/+30% of real wagon number width. For example, if we have wagon number with 200 pixels in width, then you can define values 140/260.

If the recognition accuracy is not enough, you can try to decrease minimum width to get better results.

Default value is 300. Minimum value is 70. Maximum value is 1000.

WNRParams_set_MaxWidth
void DTKWNRAPI WNRParams_set_MaxWidth(
WNRPARAMS hParams,
int maxWidth
)

Sets the maximum width of the wagon number

Parameters
hParams

Handle of WNRParams object

maxWidth
int

Maximum width of the wagon number in pixels

Notes

The minimum/maximum wagon number width parameters are used to tell the engine the expected size of the wagon number on image.

Defining a narrower interval increases recognition speed and decreases CPU resources, but negatively affects recognition accuracy.

The recommended values for min/max width are -/+30% of real wagon number width. For example, if we have wagon number with 200 pixels in width, then you can define values 140/260.

If the recognition accuracy is not enough, you can try to decrease minimum width to get better results.

Default value is 300. Minimum value is 70. Maximum value is 1000.

WNRParams_get_NumThreads
int DTKWNRAPI WNRParams_get_NumThreads(
WNRPARAMS hParams
)

Gets the number of recognition threads used by WNR engine

Parameters
hParams

Handle of WNRParams object

Returns

Number of threads

Notes

Default value is 3.

This property used for video mode only

WNRParams_set_NumThreads
void DTKWNRAPI WNRParams_set_NumThreads(
WNRPARAMS hParams,
int numThreads
)

Sets the number of recognition threads used by WNR engine

Parameters
hParams

Handle of WNRParams object

numThreads
int

Number of threads

Notes

Default value is 3.

This property used for video mode only.

WNRParams_get_FPSLimit
int DTKWNRAPI WNRParams_get_FPSLimit(
WNRPARAMS hParams
)

Gets the maximum FPS that the WNR engine will handle

Parameters
hParams

Handle of WNRParams object

Returns

Number of frames per second (FPS)

Notes

Default value is 0 (unlimited).

If the defined FPS limit is reached, then WNR Engine drop incoming frames.

This property used for video mode only.

WNRParams_set_FPSLimit
void DTKWNRAPI WNRParams_set_FPSLimit(
WNRPARAMS hParams,
int fps
)

Sets the maximum FPS that the WNR engine will handle

Parameters
hParams

Handle of WNRParams object

fps
int

number of frames per second (FPS)

Notes

Default value is 0 (unlimited).

If the defined FPS limit is reached, then WNR Engine drop incoming frames.

This property used for video mode only.

WNRParams_get_RecognitionOnMotion
bool DTKWNRAPI WNRParams_get_RecognitionOnMotion(
WNRPARAMS hParams
)

Gets the value indicating whether the WNR engine will process moving objects only

Parameters
hParams

Handle of WNRParams object

Returns
Boolean value, True

do recognition moving object only, False - process full frames always

Notes

Default value is False.

This property used for video mode only.

WNRParams_set_RecognitionOnMotion
void DTKWNRAPI WNRParams_set_RecognitionOnMotion(
WNRPARAMS hParams,
bool recOnMotion
)

Sets the value indicating whether the WNR engine will process moving objects only

Parameters

hParams- Handle of WNRParams object recOnMotion - Boolean value, True - do recognition of moving object only, False - process full frames

Notes

Default value is True.

This property used for video mode only.

WNRParams_get_RotateAngle
int DTKWNRAPI WNRParams_get_RotateAngle(
WNRPARAMS hParams
)

Gets the rotation angle of the image in degrees

Parameters
hParams

Handle of WNRParams object

Returns
Rotation angle in degrees. Possible values from 0 to 359. Value 0

do not rotate image.

Notes

Default value is 0.  The input image will be rotated counterclockwise direction at defined angle (in degrees) before processing.

WNRParams_set_RotateAngle
void DTKWNRAPI WNRParams_set_RotateAngle(
WNRPARAMS hParams,
int rotateAngle
)

Sets the rotation angle of the image in degrees

Parameters
hParams

Handle of WNRParams object

rotateAngle
int

Rotation angle in degrees (0..359). Value 0 - do not rotate image.

Notes

Default value is 0.  The input image will be rotated counterclockwise direction at defined angle (in degrees) before processing.

WNRParams_get_BurnFormatString
int DTKWNRAPI WNRParams_get_BurnFormatString(
WNRPARAMS hParams,
charformat,
int format_size
)

Gets the format string to draw on result image

Parameters
hParams

Handle of WNRParams object

format
char*

Pointer to string buffer to receive format string

format_size
int

Size of string buffer

Returns

Number of bytes copied to buffer. If format = NULL or format_size = 0, then function return number of bytes required to store the result string

WNRParams_set_BurnFormatString
void DTKWNRAPI WNRParams_set_BurnFormatString(
WNRPARAMS hParams,
const charformat
)

Sets the format string to draw on result image

Parameters
hParams

Handle of WNRParams object

format
const char*

Format string, available variables: %DATETIME%, "%NUMBER%", %COUNTRY%"

WNRParams_get_BurnPosition
int DTKWNRAPI WNRParams_get_BurnPosition(
WNRPARAMS hParams
)

Gets the position on image to draw format string

Parameters
hParams

Handle of WNRParams object

Returns

Position on result image.

Notes
0

Burn format string in Left-Top corner on result image

1

Burn format string in Right-Top corner on result image

2

Burn format string in Left-Bottom corner on result image

3

Burn format string in Right-Bottom corner on result image

WNRParams_set_BurnPosition
void DTKWNRAPI WNRParams_set_BurnPosition(
WNRPARAMS hParams,
int position
)

Sets the position on image to draw format string

Parameters
hParams

Handle of WNRParams object

position
int

Position on result image

Notes
0

Burn format string in Left-Top corner on result image

1

Burn format string in Right-Top corner on result image

2

Burn format string in Left-Bottom corner on result image

3

Burn format string in Right-Bottom corner on result image

WNRParams_GetXOption
bool DTKWNRAPI WNRParams_GetXOption(
WNRPARAMS hParams,
const charoptionName,
char** val,
int val_size
)

Gets eXtra non-documented options, which can enable some custom feature

Parameters
hParams

Handle of WNRParams object

optionName
const char*

Option name

val
char**

Pointer to string buffer to receive option value

val_size
int

Size of string buffer

WNRParams_SetXOption
void DTKWNRAPI WNRParams_SetXOption(
WNRPARAMS hParams,
const charoptionName,
const charval
)

Sets eXtra non-documented options, which can enable some custom feature

Parameters
hParams

Handle of WNRParams object

optionName
const char*

Option name

val
const char*

String value of option

WNRParams_GetZonesCount
int DTKWNRAPI WNRParams_GetZonesCount(
WNRPARAMS hParams
)

Gets the number of recognition zones

Parameters
hParams

Handle of WNRParams object

Returns

Number of recognition zones

WNRParams_AddZone
int DTKWNRAPI WNRParams_AddZone(
WNRPARAMS hParams
)

Add new recognition zone

Parameters
hParams

Handle of WNRParams object

Returns

Index of new recognition zone

WNRParams_RemoveZone
int DTKWNRAPI WNRParams_RemoveZone(
WNRPARAMS hParams,
int zoneIndex
)

Remove recognition zone by it's index

Parameters
hParams

Handle of WNRParams object

zoneIndex
int

Zone index

Returns

Value 0 if recognition zone has been deleted successfully, otherwise -1

Notes

Zone index is zero-based

WNRParams_GetZonePointsCount
int DTKWNRAPI WNRParams_GetZonePointsCount(
WNRPARAMS hParams,
int zoneIndex
)

Gets the number of polygon points that make up the zone

Parameters
hParams

Handle of WNRParams object

zoneIndex
int

Zone index

Returns

Number of polygon points of recognition zone, -1 if no zone found by index

Notes

Zone index is zero-based

WNRParams_GetZonePoint
int DTKWNRAPI WNRParams_GetZonePoint(
WNRPARAMS hParams,
int zoneIndex,
int pointIndex,
intx,
inty
)

Gets the coordinates of polygon point by it's index

Parameters
hParams

Handle of WNRParams object

zoneIndex
int

Zone index

pointIndex
int

Zone index

x
int*

X - coordinate

y
int*

Y - coordinate

Returns

Value 0 on success, otherwise -1

Notes

Zone index and Point index are zero-based

WNRParams_SetZonePoint
int DTKWNRAPI WNRParams_SetZonePoint(
WNRPARAMS hParams,
int zoneIndex,
int pointIndex,
int x,
int y
)

Sets the coordinates of polygon point by it's index

Parameters
hParams

Handle of WNRParams object

zoneIndex
int

Zone index

pointIndex
int

Zone index

x
int

X - coordinate

y
int

Y - coordinate

Returns

Value 0 on success, otherwise -1

Notes

Zone index and Point index are zero-based

WNRParams_AddZonePoint
int DTKWNRAPI WNRParams_AddZonePoint(
WNRPARAMS hParams,
int zoneIndex,
int x,
int y
)

Add new polygon point for recognition zone

Parameters
hParams

Handle of WNRParams object

zoneIndex
int

Zone index

x
int

X - coordinate

y
int

Y - coordinate

Returns

Value 0 on success, otherwise -1

Notes

Zone index is zero-based

WNRParams_RemoveZonePoint
int DTKWNRAPI WNRParams_RemoveZonePoint(
WNRPARAMS hParams,
int zoneIndex,
int pointIndex
)

Remove polygon point of recognition zone by it's index

Parameters
hParams

Handle of WNRParams object

zoneIndex
int

Zone index

pointIndex
int

Point index

Returns

Value 0 on success, otherwise -1

Notes

Zone index and Point index are zero-based

WNRParams_GetZonePointsCountF
int DTKWNRAPI WNRParams_GetZonePointsCountF(
WNRPARAMS hParams,
int zoneIndex
)

Gets the number of polygon points (with relative coordinates) that make up the zone

Parameters
hParams

Handle of WNRParams object

zoneIndex
int

Zone index

Returns

Number of polygon points of recognition zone, -1 if no zone found by index

Notes

Zone index is zero-based

WNRParams_GetZonePointF
int DTKWNRAPI WNRParams_GetZonePointF(
WNRPARAMS hParams,
int zoneIndex,
int pointIndex,
floatx,
floaty
)

Gets relative coordinates of polygon point by it's index

Parameters
hParams

Handle of WNRParams object

zoneIndex
int

Zone index

pointIndex
int

Zone index

x
float*

X - relative coordinate (floating value from 0 to 1)

y
float*

Y - relative coordinate (floating value from 0 to 1)

Returns

Value 0 on success, otherwise -1

Notes

Example: image 640 x 480 pixels, relative coordinates (0.1, 0.2) means (64, 96) in pixels for our image resolution.

Using relative coordinates, you can easily change the resolution and image size without updating the coordinates of the zones.

Zone index and Point index are zero-based

WNRParams_SetZonePointF
int DTKWNRAPI WNRParams_SetZonePointF(
WNRPARAMS hParams,
int zoneIndex,
int pointIndex,
float x,
float y
)

Sets relative coordinates of polygon point by it's index

Parameters
hParams

Handle of WNRParams object

zoneIndex
int

Zone index

pointIndex
int

Zone index

x
float

X - relative coordinate (floating value from 0 to 1)

y
float

Y - relative coordinate (floating value from 0 to 1)

Returns

Value 0 on success, otherwise -1

Notes

Example: image 640 x 480 pixels, relative coordinates (0.1, 0.2) means (64, 96) in pixels for our image resolution.

Using relative coordinates, you can easily change the resolution and image size without updating the coordinates of the zones.

Zone index and Point index are zero-based

WNRParams_AddZonePointF
int DTKWNRAPI WNRParams_AddZonePointF(
WNRPARAMS hParams,
int zoneIndex,
float x,
float y
)

Add new polygon point (with relative coordinates) for recognition zone

Parameters
hParams

Handle of WNRParams object

zoneIndex
int

Zone index

x
float

X - relative coordinate (floating value from 0 to 1)

y
float

Y - relative coordinate (floating value from 0 to 1)

Returns

Value 0 on success, otherwise -1

Notes

Example: image 640 x 480 pixels, relative coordinates (0.1, 0.2) means (64, 96) in pixels for our image resolution.

Using relative coordinates, you can easily change the resolution and image size without updating the coordinates of the zones.

Zone index is zero-based

WNRParams_RemoveZonePointF
int DTKWNRAPI WNRParams_RemoveZonePointF(
WNRPARAMS hParams,
int zoneIndex,
int pointIndex
)

Remove polygon point (with relative coordinates) of recognition zone by it's index

Parameters
hParams

Handle of WNRParams object

zoneIndex
int

Zone index

pointIndex
int

Point index

Returns

Value 0 on success, otherwise -1

Notes

Zone index and Point index are zero-based

WNRResult Functions
WNRResult_Destroy
void DTKWNRAPI WNRResult_Destroy(
WNRRESULT hResult
)

Destroy WNRResult object

Parameters
hResult

Handle of WNRResult object

Notes

There is not possibility to create WNRResult object, the WNR engine only can create this object, you need to destroy it when you do not need it anymore.

WNRResult_GetWagonNumbersCount
int DTKWNRAPI WNRResult_GetWagonNumbersCount(
WNRRESULT hResult
)

Gets the number of WagonNumber objects containing in WNRResult object

Parameters
hResult

Handle of WNRResult object

Returns

Number of WagonNumber objects

WNRResult_GetWagonNumber
WNRNUMBER DTKWNRAPI WNRResult_GetWagonNumber(
WNRRESULT hResult,
int index
)

Gets the WagonNumber object from WNRResult by it's index

Parameters
hResult

Handle of WNRResult object

index
int

Index of WagonNumber object

Returns

Handle of WagonNumber object

Notes

Each WagonNumber object from WNRResult must be destroyed using WagonNumber_Destroy function

WNRResult_GetProcessingTime
int64 DTKWNRAPI WNRResult_GetProcessingTime(
WNRRESULT hResult
)

Gets the processing time (in milliseconds) without image file reading from disk and image decoding.

Parameters
hResult

Handle of WNRResult object

Returns

time in milliseconds

WagonNumber Functions
WagonNumber_Destroy
void DTKWNRAPI WagonNumber_Destroy(
WNRNUMBER hWagonNum
)

Destroys the WagonNumber object instance

Parameters
hWagonNum

Handle of WagonNumber object

Notes

There is not possibility to create WagonNumber object, the WNR engine only can create this object, you need to destroy it when you do not need it anymore.

WagonNumber_GetText
int DTKWNRAPI WagonNumber_GetText(
WNRNUMBER hWagonNum,
chartext,
int textSize
)

Gets the wagon number text

Parameters
hWagonNum

Handle of WagonNumber object

text
char*

Pointer to string buffer which receives recognized wagon number text

textSize
int

Size of string buffer

Returns

Number of bytes copied to string buffer. If text = NULL or textSize = 0, then function return required number of bytes required to store the result string

WagonNumber_GetType
int DTKWNRAPI WagonNumber_GetType(
WNRNUMBER hWagonNum
)

Gets the type of the wagon number

Parameters
hWagonNum

Handle of WagonNumber object

Returns
0

dark symbols on light background

1

light symbols on dark background

WagonNumber_GetX
int DTKWNRAPI WagonNumber_GetX(
WNRNUMBER hWagonNum
)

Gets the X coordinate of wagon number bounding rectangle

Parameters
hWagonNum

Handle of WagonNumber object

Returns

X coordinate in pixels

WagonNumber_GetY
int DTKWNRAPI WagonNumber_GetY(
WNRNUMBER hWagonNum
)

Gets the Y coordinate of wagon number bounding rectangle

Parameters
hWagonNum

Handle of WagonNumber object

Returns

Y coordinate in pixels

WagonNumber_GetWidth
int DTKWNRAPI WagonNumber_GetWidth(
WNRNUMBER hWagonNum
)

Gets the width of wagon number bounding rectangle

Parameters
hWagonNum

Handle of WagonNumber object

Returns

Width in pixels

WagonNumber_GetHeight
int DTKWNRAPI WagonNumber_GetHeight(
WNRNUMBER hWagonNum
)

Gets width of wagon number bounding rectangle

Parameters
hWagonNum

Handle of WagonNumber object

Returns

Width in pixels

WagonNumber_GetSymbolsCount
int DTKWNRAPI WagonNumber_GetSymbolsCount(
WNRNUMBER hWagonNum
)

Gets number of wagon number symbols

Parameters
hWagonNum

Handle of WagonNumber object

Returns

Number of symbols

WagonNumber_GetSymbolX
int DTKWNRAPI WagonNumber_GetSymbolX(
WNRNUMBER hWagonNum,
int index
)

Gets the X coordinate of symbol in pixels

Parameters
hWagonNum

Handle of WagonNumber object

index
int

index of symbol (zero-based)

Returns

X coordinate in pixels

WagonNumber_GetSymbolY
int DTKWNRAPI WagonNumber_GetSymbolY(
WNRNUMBER hWagonNum,
int index
)

Gets the Y coordinate of symbol in pixels

Parameters
hWagonNum

Handle of WagonNumber object

index
int

index of symbol (zero-based)

Returns

Y coordinate in pixels

WagonNumber_GetSymbolWidth
int DTKWNRAPI WagonNumber_GetSymbolWidth(
WNRNUMBER hWagonNum,
int index
)

Gets the width of symbol in pixels

Parameters
hWagonNum

Handle of WagonNumber object

index
int

index of symbol (zero-based)

Returns

Width in pixels

WagonNumber_GetSymbolHeight
int DTKWNRAPI WagonNumber_GetSymbolHeight(
WNRNUMBER hWagonNum,
int index
)

Gets the height of symbol in pixels

Parameters
hWagonNum

Handle of WagonNumber object

index
int

index of symbol (zero-based)

Returns

Height in pixels

WagonNumber_GetSymbol
wchar_t DTKWNRAPI WagonNumber_GetSymbol(
WNRNUMBER hWagonNum,
int index
)

Gets the symbol character

Parameters
hWagonNum

Handle of WagonNumber object

index
int

index of symbol (zero-based)

Returns

Character of symbol

WagonNumber_GetSymbolConfidence
int DTKWNRAPI WagonNumber_GetSymbolConfidence(
WNRNUMBER hWagonNum,
int index
)

Gets the recognition confidence of wagon number symbol

Parameters
hWagonNum

Handle of WagonNumber object

index
int

index of symbol (zero-based)

Returns

Number of percentage from 1 to 100

WagonNumber_GetConfidence
int DTKWNRAPI WagonNumber_GetConfidence(
WNRNUMBER hWagonNum
)

Gets the recognition confidence of wagon number

Parameters
hWagonNum

Handle of WagonNumber object

Returns

Number of percentage from 1 to 100

WagonNumber_GetZone
int DTKWNRAPI WagonNumber_GetZone(
WNRNUMBER hWagonNum
)

Gets the recognition zone index to which the wagon number belongs

Parameters
hWagonNum

Handle of WagonNumber object

Returns

Index of recognition zone

Notes

The index is one-based. If the index is 0, it means that the zones are not defined and the number is found on the whole image.

WagonNumber_GetTimestamp
int64 DTKWNRAPI WagonNumber_GetTimestamp(
WNRNUMBER hWagonNum
)

Gets the timestamp of the video frame where the wagon number recognized

Parameters
hWagonNum

Handle of WagonNumber object

Returns

Timestamp in milliseconds

Notes

This property used for video mode only

WagonNumber_GetFrameTimestamp
int64 DTKWNRAPI WagonNumber_GetFrameTimestamp(
WNRNUMBER hWagonNum
)

Gets the timestamp of the video frame that was passed to PutFrameImageBuffer function

Parameters
hWagonNum

Handle of WagonNumber object

Returns

Timestamp in milliseconds

Notes

This property used for video mode only

WagonNumber_GetDateTimeString
int DTKWNRAPI WagonNumber_GetDateTimeString(
WNRNUMBER hWagonNum,
charbuffer,
int bufferSize
)

Gets the date/time string with milliseconds of the video frame where the wagon number recognized

Parameters
hWagonNum

Handle of WagonNumber object

buffer
char*

Pointer to string buffer which will receive date/time string

bufferSize
int

Size of the string buffer in bytes

Returns

Number of bytes copied to buffer. If buffer = NULL or bufferSize = 0, then function return required number of bytes required to store the result string

Notes

Returns data/time string of the video frame in format "yyyy-dd-mm hh:mm:ss.fff"

This property used for video mode only

WagonNumber_GetCustomData
int64 DTKWNRAPI WagonNumber_GetCustomData(
WNRNUMBER hWagonNum
)

Gets custom 64 bit data which has been sent as parameter of WNREngine_PutFrameImageBuffer function

Parameters
hWagonNum

Handle of WagonNumber object

Returns

64 bit integer value

Notes

This property used for video mode only

WagonNumber_GetImageBuffer
void DTKWNRAPI WagonNumber_GetImageBuffer(
WNRNUMBER hWagonNum,
void** pImageBuffer,
intwidth,
intheight,
intstride
)

Get frame image buffer

Parameters
hWagonNum

Handle of WagonNumber object

pImageBuffer
void**

Pointer to a pointer which receives the image buffer containing pixel data of the frame image in RGB24 format.

width
int*

Pointer to integer variable which receives width of frame image

height
int*

Pointer to integer variable which receives height of frame image

stride
int*

Pointer to integer variable which receives size of one image row in bytes

Notes

You need to call WagonNumber_FreeImageBuffer with received pointer to free memory.

This property used for video mode only

WagonNumber_SaveImage
int DTKWNRAPI WagonNumber_SaveImage(
WNRNUMBER hWagonNum,
const charfileName,
int param
)

Saves frame image to file (BMP, JPG, PNG)

Parameters
hWagonNum

Handle of WagonNumber object

fileName
const char*

image file name

param
int

compression/quality parameter (see Notes)

Notes

If image format is JPG then 'param' value means JPEG quality, value from 0 to 100

If image format is PNG then 'param' value means PNG compression, value from 0 to 9

If image format is BMP then 'param' value not used.

If 'param' value is set to -1, then default values will be used: 95 for JPEG, 6 for PNG

This property used for video mode only

WagonNumber_GetWagonNumberImageBuffer
void DTKWNRAPI WagonNumber_GetWagonNumberImageBuffer(
WNRNUMBER hWagonNum,
void** pImageBuffer,
intwidth,
intheight,
intstride
)

Gets the image buffer of the wagon number

Parameters
hWagonNum

Handle of WagonNumber object

pImageBuffer
void**

Pointer to a pointer which receives the image buffer containing pixel data of the wagon number image in RGB24 format.

width
int*

Pointer to integer variable which receives width of wagon number image

height
int*

Pointer to integer variable which receives height of wagon number image

stride
int*

Pointer to integer variable which receives size of one image row in bytes

Notes

You need to call WagonNumber_FreeImageBuffer with received pointer to free memory.

This property used for video mode only

WagonNumber_SaveWagonNumberImage
int DTKWNRAPI WagonNumber_SaveWagonNumberImage(
WNRNUMBER hWagonNum,
const charfileName,
int param
)

Saves the image of the wagon number to file (BMP, JPG, PNG)

Parameters
hWagonNum

Handle of WagonNumber object

fileName
const char*

image file name

param
int

compression/quality parameter (see Notes)

Notes

If image format is JPG then 'param' value means JPEG quality, value from 0 to 100 If image format is PNG then 'param' value means PNG compression, value from 0 to 9 If image format is BMP then 'param' value not used.

If 'param' value is set to -1, then default values will be used: 95 for JPEG, 6 for PNG

This property used for video mode only

WagonNumber_FreeImageBuffer
void DTKWNRAPI WagonNumber_FreeImageBuffer(
voidpImageBuffer
)

Delete image buffer

Parameters
pImageBuffer
void*

Pointer to image buffer received using WagonNumber_GetImageBuffer or WagonNumber_GetWagonNumberImageBuffer functions.