Types
LPRENGINE

Handle of LPREngine object

Used to handle pointer (void *) to LPREngine object

LPRPARAMS

Handle of LPRParams object

Used to handle pointer (void *) to LPRParams object

LPRRESULT

Handle of LPRResult object

Used to handle pointer (void *) to LPRResult object

LPRPLATE

Handle of LicensePlate object

Used to handle pointer (void *) to LicensePlate object

Enumerations
PLATE_TYPE

License plate type

DARK_ON_LIGHT_BKG

dark symbols on light background.

LIGHT_ON_DARK_BKG

light symbols on dark background.

Callbacks
LicensePlateDetectedCallback

Invokes by LPREngine object on license plate detection

Parameters
hEngine

Handle of LPREngine object

hPlate

Handle of LicensePlate object

Notes

LicensePlate object must be deleted using function LicensePlate_Destroy

LPREngine Functions
LPREngine_Create
LPRENGINE DTKLPRAPI LPREngine_Create(
LPRPARAMS hParams,
bool bVideo,
LicensePlateDetectedCallback plateDetectedCallback
)

Creates a new instance of the LPR engine

Parameters
hParams

Handle of LPRParams object

bVideo
bool

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

plateDetectedCallback

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

Return

Handle of LPREngine object

LPREngine_Destroy
void DTKLPRAPI LPREngine_Destroy(
LPRENGINE hEngine
)

Destroys the LPR engine instance

Parameters
hEngine

Handle of LPREngine object

LPREngine_ReadFromFile
LPRRESULT DTKLPRAPI LPREngine_ReadFromFile(
LPRENGINE hEngine,
const charfileName
)

Reads license plates from an image file (JPEG, BMP, PNG)

Parameters
hEngine

Handle of LPREngine object

fileName
const char*

Path to image file

Return

Handle of LPRResult object

Notes

LPRResult object must be deleted using function LPRResult_Destroy.

This function can be used for still image mode only.

LPREngine_ReadFromMemFile
LPRRESULT DTKLPRAPI LPREngine_ReadFromMemFile(
LPRENGINE hEngine,
voidpBuffer,
int bufferSize
)

Read license plates from image file (JPEG, BMP, PNG) contained in the memory

Parameters
hEngine

Handle of LPREngine object

pBuffer
void*

Pointer to a memory buffer containing the image file data

bufferSize
int

size of memory buffer in bytes

Return

Handle of LPRResult object

Notes

LPRResult object must be deleted using function LPRResult_Destroy.

This function can be used for still image mode only.

LPREngine_ReadFromURL
LPRRESULT DTKLPRAPI LPREngine_ReadFromURL(
LPRENGINE hEngine,
const charurl
)

Read license plates from image file (JPEG, BMP, PNG) from HTTP url

Parameters
hEngine

Handle of LPREngine object

url
const char*

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

Return

Handle of LPRResult object

Notes

LPRResult object must be deleted using function LPRResult_Destroy.

This function can be used for still image mode only.

LPREngine_ReadFromImageBuffer
LPRRESULT DTKLPRAPI LPREngine_ReadFromImageBuffer(
LPRENGINE hEngine,
voidpBuffer,
int width,
int height,
int stride,
PIXFMT pixelFormat
)

Read license plates from image buffer

Parameters
hEngine

Handle of LPREngine 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 LPRResult object

Notes

LPRResult object must be deleted using function LPRResult_Destroy.

This function can be used for still image mode only.

LPREngine_PutFrame
int DTKLPRAPI LPREngine_PutFrame(
LPRENGINE hEngine,
VIDEOFRAME hFrame,
int64 customData
)

Send video frame to engine (for video mode only)

Parameters
hEngine

Handle of LPREngine 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 LicensePlate 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

Notes

ATTENTION: this function will delete the hFrame object after processing this frame, so you DO NOT need to delete the hFrame object after calling this function.

LPREngine_PutFrameImageBuffer
int DTKLPRAPI LPREngine_PutFrameImageBuffer(
LPRENGINE 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 LPREngine 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 plate. This value will be assigned to LicensePlate 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

LPREngine_GetProcessingFPS
int DTKLPRAPI LPREngine_GetProcessingFPS(
LPRENGINE hEngine
)

Return current processing FPS (for video mode only)

Parameters
hEngine

Handle of LPREngine 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.

LPREngine_IsQueueEmpty
bool DTKLPRAPI LPREngine_IsQueueEmpty(
LPRENGINE hEngine
)

Gets the value indicating whether the LPR engine has processed all frames in queue and the queue is empty.

Parameters
hEngine

Handle of LPREngine 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 LPR Engine to finish its work and process all frames sent using LPREngine_PutFrame or LPREngine_PutFrameImageBuffer functions.

This function can be used for video mode only.

LPREngine_IsLicensed
int DTKLPRAPI LPREngine_IsLicensed(
LPRENGINE hEngine
)

Check if LPR engine is licensed

Parameters
hEngine

Handle of LPREngine 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)

LPREngine_GetSupportedCountries
int DTKLPRAPI LPREngine_GetSupportedCountries(
charbuffer,
int buff_size
)

Return list of supported countries

Parameters
buffer
char*

Pointer to string buffer which receives semi-colon delimited list of countries

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

Notes

The semi-colon delimited list returned in following format: <country code 1>|<country name 1>;<country code 2>|<country name 2>;....

Example: LV|Latvia;LT|Lithuania;EE|Estonia;.....

Country codes are 2 character code by ISO 3166-1 standard

LPREngine_GetLibraryVersion
int DTKLPRAPI LPREngine_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

LPRParams Functions
LPRParams_Create
LPRPARAMS DTKLPRAPI LPRParams_Create()

Create LPRParams object

Returns

Handle of new LPRParams object

LPRParams_Destroy
void DTKLPRAPI LPRParams_Destroy(
LPRPARAMS hParams
)

Destroy LPRParams object

Parameters
hParams

Handle of LPRParams object

LPRParams_get_MinPlateWidth
int DTKLPRAPI LPRParams_get_MinPlateWidth(
LPRPARAMS hParams
)

Gets the minimum plate width

Parameters
hParams

Handle of LPRParams object

Returns

Minimum plate width in pixels

Notes

The minimum/maximum plate width parameters are used to tell the engine the expected size of the license plates on image.

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

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

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

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

LPRParams_set_MinPlateWidth
void DTKLPRAPI LPRParams_set_MinPlateWidth(
LPRPARAMS hParams,
int minPlateWidth
)

Sets the minimum width of the plate

Parameters
hParams

Handle of LPRParams object

minPlateWidth
int

Minimum plate width in pixels

Notes

The minimum/maximum plate width parameters are used to tell the engine the expected size of the license plates on image.

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

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

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

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

LPRParams_get_MaxPlateWidth
int DTKLPRAPI LPRParams_get_MaxPlateWidth(
LPRPARAMS hParams
)

Gets the maximum plate width

Parameters
hParams

Handle of LPRParams object

Returns

Maximum plate width in pixels

Notes

The minimum/maximum plate width parameters are used to tell the engine the expected size of the license plates on image.

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

The recommended values for min/max plate width are -/+30% of real plate width. For example, if we have plate 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 plate width to get better results.

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

LPRParams_set_MaxPlateWidth
void DTKLPRAPI LPRParams_set_MaxPlateWidth(
LPRPARAMS hParams,
int maxPlateWidth
)

Sets the maximum width plate

Parameters
hParams

Handle of LPRParams object

maxPlateWidth
int

Maximum plate width in pixels

Notes

The minimum/maximum plate width parameters are used to tell the engine the expected size of the license plates on image.

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

The recommended values for min/max plate width are -/+30% of real plate wdith. For example, if we have plate 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 plate width to get better results.

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

LPRParams_get_Countries
int DTKLPRAPI LPRParams_get_Countries(
LPRPARAMS hParams,
charbuffer,
int buff_size
)

Gets the list of countries defined for recognition

Parameters
hParams

Handle of LPRParams object

buffer
char*

Pointer to buffer which receive comma delimited string of countries list

buff_size
int

Size of buffer in bytes

Returns

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

Notes

Country codes defined in ISO 3166-1.

Example: FR,DE,ES,IT

LPRParams_set_Countries
void DTKLPRAPI LPRParams_set_Countries(
LPRPARAMS hParams,
const charcountries
)

Define countries list for recognition

Parameters
hParams

Handle of LPRParams object

countries
const char*

Comma delimited string of countries list

Notes

Country codes defined in ISO 3166-1.

Example: FR,DE,ES,IT

LPRParams_get_FormatPlateText
bool DTKLPRAPI LPRParams_get_FormatPlateText(
LPRPARAMS hParams
)

Gets the value indicating whether the LPR engine will format plate text according to specific format.

Parameters
hParams

Handle of LPRParams object

Returns

Boolean value

Notes

Default value is True.

If this parameter is set to True, then the plate text will be formatted according to detected format and may be supplemented by extra symbols like 'dash', 'space' or 'dot'.

For example: Latvian plate "AB1234" will be formated as "AB-1234", German plate "GIKM345" will be formated as "GI KM345"

LPRParams_set_FormatPlateText
void DTKLPRAPI LPRParams_set_FormatPlateText(
LPRPARAMS hParams,
bool val
)

Sets the value indicating whether the LPR engine will format plate text according to specific format.

Parameters

hParams- Handle of LPRParams object val - Boolean value

Notes

Default value is False.

If this parameter is set to True, then the plate text will be formatted according to detected format and may be supplemented by extra symbols like 'dash', 'space' or 'dot'.

For example: Latvian plate "AB1234" will be formated as "AB-1234", German plate "GIKM345" will be formated as "GI KM345"

LPRParams_get_NumThreads
int DTKLPRAPI LPRParams_get_NumThreads(
LPRPARAMS hParams
)

Gets the number of recognition threads used by LPR engine

Parameters
hParams

Handle of LPRParams object

Returns

Number of threads

Notes

Default value is 4.

This property used for video mode only

LPRParams_set_NumThreads
void DTKLPRAPI LPRParams_set_NumThreads(
LPRPARAMS hParams,
int numThreads
)

Sets the number of recognition threads used by LPR engine

Parameters
hParams

Handle of LPRParams object

numThreads
int

Number of threads

Notes

Default value is 4.

This property used for video mode only.

LPRParams_get_FPSLimit
int DTKLPRAPI LPRParams_get_FPSLimit(
LPRPARAMS hParams
)

Gets the maximum FPS which LPR engine will process

Parameters
hParams

Handle of LPRParams object

Returns

Number of frames per second (FPS)

Notes

Default value is 0 (unlimited).

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

This property used for video mode only.

LPRParams_set_FPSLimit
void DTKLPRAPI LPRParams_set_FPSLimit(
LPRPARAMS hParams,
int fps
)

Sets the maximum FPS which LPR engine will process

Parameters
hParams

Handle of LPRParams object

fps
int

number of frames per second (FPS)

Notes

Default value is 0 (unlimited).

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

This property used for video mode only.

LPRParams_get_DuplicateResultsDelay
int DTKLPRAPI LPRParams_get_DuplicateResultsDelay(
LPRPARAMS hParams
)

Gets the minimum delay between duplicated results

Parameters
hParams

Handle of LPRParams object

Returns

Number of milliseconds

Notes

Default value is 5000 (5 sec).

This property used for video mode only.

LPRParams_set_DuplicateResultsDelay
void DTKLPRAPI LPRParams_set_DuplicateResultsDelay(
LPRPARAMS hParams,
int delay
)

Sets the minimum delay between duplicated results

Parameters
hParams

Handle of LPRParams object

delay
int

Number of milliseconds

Notes

Default value is 5000 (5 sec).

This property used for video mode only.

LPRParams_get_ResultConfirmationsCount
int DTKLPRAPI LPRParams_get_ResultConfirmationsCount(
LPRPARAMS hParams
)

Gets the minimum number of confirmations of the same plate to return the result

Parameters
hParams

Handle of LPRParams object

Returns

Number of confirmations

Notes

Default value is 3, minimum value 2.

This property used for video mode only.

LPRParams_set_ResultConfirmationsCount
void DTKLPRAPI LPRParams_set_ResultConfirmationsCount(
LPRPARAMS hParams,
int numConf
)

Sets the minimum number of confirmations of the same plate to return the result

Parameters
hParams

Handle of LPRParams object

numConf
int

Number of confirmations

Notes

Default value is 3, minimum value 2.

This property used for video mode only.

LPRParams_get_RecognitionOnMotion
bool DTKLPRAPI LPRParams_get_RecognitionOnMotion(
LPRPARAMS hParams
)

Gets the value indicating whether the LPR engine will process only zones of the moving objects

Parameters
hParams

Handle of LPRParams 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.

LPRParams_set_RecognitionOnMotion
void DTKLPRAPI LPRParams_set_RecognitionOnMotion(
LPRPARAMS hParams,
bool recOnMotion
)

Sets the value indicating whether the LPR engine will process only zones of the moving objects

Parameters

hParams- Handle of LPRParams 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.

LPRParams_get_RotateAngle
int DTKLPRAPI LPRParams_get_RotateAngle(
LPRPARAMS hParams
)

Gets the rotation angle of the image in degrees

Parameters
hParams

Handle of LPRParams 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.

LPRParams_set_RotateAngle
void DTKLPRAPI LPRParams_set_RotateAngle(
LPRPARAMS hParams,
int rotateAngle
)

Sets the rotation angle of the image in degrees

Parameters
hParams

Handle of LPRParams 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.

LPRParams_get_BurnFormatString
int DTKLPRAPI LPRParams_get_BurnFormatString(
LPRPARAMS hParams,
charformat,
int format_size
)

Gets the format string to draw on result image

Parameters
hParams

Handle of LPRParams 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

LPRParams_set_BurnFormatString
void DTKLPRAPI LPRParams_set_BurnFormatString(
LPRPARAMS hParams,
const charformat
)

Sets the format string to draw on result image

Parameters
hParams

Handle of LPRParams object

format
const char*

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

LPRParams_get_BurnPosition
int DTKLPRAPI LPRParams_get_BurnPosition(
LPRPARAMS hParams
)

Gets the position in the image to draw format string

Parameters
hParams

Handle of LPRParams 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

LPRParams_set_BurnPosition
void DTKLPRAPI LPRParams_set_BurnPosition(
LPRPARAMS hParams,
int position
)

Sets the position in the image to draw format string

Parameters
hParams

Handle of LPRParams 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

LPRParams_GetXOption
bool DTKLPRAPI LPRParams_GetXOption(
LPRPARAMS hParams,
const charoptionName,
char** val,
int val_size
)

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

Parameters
hParams

Handle of LPRParams object

optionName
const char*

Option name

val
char**

Pointer to string buffer to receive option value

val_size
int

Size of string buffer

LPRParams_SetXOption
void DTKLPRAPI LPRParams_SetXOption(
LPRPARAMS hParams,
const charoptionName,
const charval
)

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

Parameters
hParams

Handle of LPRParams object

optionName
const char*

Option name

val
const char*

String value of option

LPRParams_GetZonesCount
int DTKLPRAPI LPRParams_GetZonesCount(
LPRPARAMS hParams
)

Gets the number of recognition zones

Parameters
hParams

Handle of LPRParams object

Returns

Number of recognition zones

LPRParams_AddZone
int DTKLPRAPI LPRParams_AddZone(
LPRPARAMS hParams
)

Add new recognition zone

Parameters
hParams

Handle of LPRParams object

Returns

Index of new recognition zone

LPRParams_RemoveZone
int DTKLPRAPI LPRParams_RemoveZone(
LPRPARAMS hParams,
int zoneIndex
)

Remove recognition zone by it's index

Parameters
hParams

Handle of LPRParams object

zoneIndex
int

Zone index

Returns

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

Notes

Zone index is zero-based

LPRParams_GetZonePointsCount
int DTKLPRAPI LPRParams_GetZonePointsCount(
LPRPARAMS hParams,
int zoneIndex
)

Gets the number of polygon points that make up the zone

Parameters
hParams

Handle of LPRParams 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

LPRParams_GetZonePoint
int DTKLPRAPI LPRParams_GetZonePoint(
LPRPARAMS hParams,
int zoneIndex,
int pointIndex,
intx,
inty
)

Gets the coordinates of polygon point by it's index

Parameters
hParams

Handle of LPRParams 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

LPRParams_SetZonePoint
int DTKLPRAPI LPRParams_SetZonePoint(
LPRPARAMS hParams,
int zoneIndex,
int pointIndex,
int x,
int y
)

Sets the coordinates of polygon point by it's index

Parameters
hParams

Handle of LPRParams 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

LPRParams_AddZonePoint
int DTKLPRAPI LPRParams_AddZonePoint(
LPRPARAMS hParams,
int zoneIndex,
int x,
int y
)

Add new polygon point for recognition zone

Parameters
hParams

Handle of LPRParams object

zoneIndex
int

Zone index

x
int

X - coordinate

y
int

Y - coordinate

Returns

Zero-based index of new point on success, otherwise -1

Notes

Zone index is zero-based

LPRParams_RemoveZonePoint
int DTKLPRAPI LPRParams_RemoveZonePoint(
LPRPARAMS hParams,
int zoneIndex,
int pointIndex
)

Remove polygon point of recognition zone by it's index

Parameters
hParams

Handle of LPRParams 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

LPRParams_GetZonePointsCountF
int DTKLPRAPI LPRParams_GetZonePointsCountF(
LPRPARAMS hParams,
int zoneIndex
)

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

Parameters
hParams

Handle of LPRParams 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

LPRParams_GetZonePointF
int DTKLPRAPI LPRParams_GetZonePointF(
LPRPARAMS hParams,
int zoneIndex,
int pointIndex,
floatx,
floaty
)

Gets relative coordinates of polygon point by it's index

Parameters
hParams

Handle of LPRParams 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

LPRParams_SetZonePointF
int DTKLPRAPI LPRParams_SetZonePointF(
LPRPARAMS hParams,
int zoneIndex,
int pointIndex,
float x,
float y
)

Sets relative coordinates of polygon point by it's index

Parameters
hParams

Handle of LPRParams 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

LPRParams_AddZonePointF
int DTKLPRAPI LPRParams_AddZonePointF(
LPRPARAMS hParams,
int zoneIndex,
float x,
float y
)

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

Parameters
hParams

Handle of LPRParams 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

Zero-based index of new point 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

LPRParams_RemoveZonePointF
int DTKLPRAPI LPRParams_RemoveZonePointF(
LPRPARAMS hParams,
int zoneIndex,
int pointIndex
)

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

Parameters
hParams

Handle of LPRParams 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

LPRResult Functions
LPRResult_Destroy
void DTKLPRAPI LPRResult_Destroy(
LPRRESULT hResult
)

Destroy LPRResult object

Parameters
hResult

Handle of LPRResult object

Notes

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

LPRResult_GetPlatesCount
int DTKLPRAPI LPRResult_GetPlatesCount(
LPRRESULT hResult
)

Gets the number of LicensePlate objects containing in LPRResult object

Parameters
hResult

Handle of LPRResult object

Returns

Number of LicensePlate objects

LPRResult_GetPlate
LPRPLATE DTKLPRAPI LPRResult_GetPlate(
LPRRESULT hResult,
int plateIndex
)

Gets the LicensePlate object from LPRResult by it's index

Parameters
hResult

Handle of LPRResult object

plateIndex
int

Index of LicensePlate object

Returns

Handle of LicensePlate object

Notes

Each LicensePlate object from LPRResult must be destroyed using LicensePlate_Destroy function

LPRResult_GetProcessingTime
int64 DTKLPRAPI LPRResult_GetProcessingTime(
LPRRESULT hResult
)

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

Parameters
hResult

Handle of LPRResult object

Returns

time in milliseconds

LicensePlate Functions
LicensePlate_Destroy
void DTKLPRAPI LicensePlate_Destroy(
LPRPLATE hPlate
)

Destroy LicensePlate object

Parameters
hPlate

Handle of LicensePlate object

Notes

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

LicensePlate_GetText
int DTKLPRAPI LicensePlate_GetText(
LPRPLATE hPlate,
chartext,
int size
)

Gets the license plate text

Parameters
hPlate

Handle of LicensePlate object

text
char*

Pointer to string buffer which receives recognized plate text

size
int

Size of string buffer

Returns

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

LicensePlate_GetCountryCode
int DTKLPRAPI LicensePlate_GetCountryCode(
LPRPLATE hPlate,
charcountryCode,
int size
)

Gets the country code of the recognized license plate

Parameters
hPlate

Handle of LicensePlate object

countryCode
char*

Pointer to string buffer which receives country code (ISO 3166-1) of recognized license plate

size
int

Size of string buffer

Returns

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

Notes

The countryCode buffer must be minimum 3 bytes in size to store 2 symbol code and null-terminator character.

LicensePlate_GetState
int DTKLPRAPI LicensePlate_GetState(
LPRPLATE hPlate,
charstate,
int size
)

Gets the state of the recognized license plate

Parameters
hPlate

Handle of LicensePlate object

state
char*

Pointer to string buffer which receives state code of recognized license plate

size
int

Size of string buffer

Returns

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

Notes

This is an optional value that can be used for specific countries where state detection is implemented, such as the United States.

The state buffer must be minimum 3 bytes in size to store 2 symbol code and null-terminator character.

LicensePlate_GetType
PLATE_TYPE DTKLPRAPI LicensePlate_GetType(
LPRPLATE hPlate
)

Gets the type of the license plate

Parameters
hPlate

Handle of LicensePlate object

Returns

One of PLATE_TYPE enumeration values

LicensePlate_GetNumRows
int DTKLPRAPI LicensePlate_GetNumRows(
LPRPLATE hPlate
)

Gets the number of text rows on license plate

Parameters
hPlate

Handle of LicensePlate object

Returns

Number of text rows on license plate.

Value 1 means single row plate, 2 means two-rows plate.

LicensePlate_GetX
int DTKLPRAPI LicensePlate_GetX(
LPRPLATE hPlate
)

Gets the X coordinate of the license plate bounding rectangle

Parameters
hPlate

Handle of LicensePlate object

Returns

X coordinate in pixels

LicensePlate_GetY
int DTKLPRAPI LicensePlate_GetY(
LPRPLATE hPlate
)

Gets the Y coordinate of license plate bounding rectangle

Parameters
hPlate

Handle of LicensePlate object

Returns

Y coordinate in pixels

LicensePlate_GetWidth
int DTKLPRAPI LicensePlate_GetWidth(
LPRPLATE hPlate
)

Gets the width of license plate bounding rectangle

Parameters
hPlate

Handle of LicensePlate object

Returns

Width in pixels

LicensePlate_GetHeight
int DTKLPRAPI LicensePlate_GetHeight(
LPRPLATE hPlate
)

Gets the width of the license plate bounding rectangle

Parameters
hPlate

Handle of LicensePlate object

Returns

Width in pixels

LicensePlate_GetSymbolsCount
int DTKLPRAPI LicensePlate_GetSymbolsCount(
LPRPLATE hPlate
)

Gets the number of the license plate symbols

Parameters
hPlate

Handle of LicensePlate object

Returns

Number of symbols

LicensePlate_GetSymbolX
int DTKLPRAPI LicensePlate_GetSymbolX(
LPRPLATE hPlate,
int index
)

Gets the X coordinate of the symbol in pixels

Parameters
hPlate

Handle of LicensePlate object

index
int

index of symbol (zero-based)

Returns

X coordinate in pixels

LicensePlate_GetSymbolY
int DTKLPRAPI LicensePlate_GetSymbolY(
LPRPLATE hPlate,
int index
)

Gets the Y coordinate of the symbol in pixels

Parameters
hPlate

Handle of LicensePlate object

index
int

index of symbol (zero-based)

Returns

Y coordinate in pixels

LicensePlate_GetSymbolWidth
int DTKLPRAPI LicensePlate_GetSymbolWidth(
LPRPLATE hPlate,
int index
)

Gets the width of the symbol in pixels

Parameters
hPlate

Handle of LicensePlate object

index
int

index of symbol (zero-based)

Returns

Width in pixels

LicensePlate_GetSymbolHeight
int DTKLPRAPI LicensePlate_GetSymbolHeight(
LPRPLATE hPlate,
int index
)

Gets the height of the symbol in pixels

Parameters
hPlate

Handle of LicensePlate object

index
int

index of symbol (zero-based)

Returns

Height in pixels

LicensePlate_GetSymbol
wchar_t DTKLPRAPI LicensePlate_GetSymbol(
LPRPLATE hPlate,
int index
)

Gets the character of the license plate symbol

Parameters
hPlate

Handle of LicensePlate object

index
int

index of symbol (zero-based)

Returns

Character of symbol

LicensePlate_GetSymbolConfidence
int DTKLPRAPI LicensePlate_GetSymbolConfidence(
LPRPLATE hPlate,
int index
)

Gets the recognition confidence of the license plate symbol

Parameters
hPlate

Handle of LicensePlate object

index
int

index of symbol (zero-based)

Returns

Number of percentage from 1 to 100

LicensePlate_GetConfidence
int DTKLPRAPI LicensePlate_GetConfidence(
LPRPLATE hPlate
)

Gets the recognition confidence of the license plate

Parameters
hPlate

Handle of LicensePlate object

Returns

Number of percentage from 1 to 100

LicensePlate_GetZone
int DTKLPRAPI LicensePlate_GetZone(
LPRPLATE hPlate
)

Gets the index of the recognition zone to which the license plate belongs

Parameters
hPlate

Handle of LicensePlate 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 plate is found on the whole image.

LicensePlate_GetDirection
int DTKLPRAPI LicensePlate_GetDirection(
LPRPLATE hPlate
)

Gets the direction of movement of the license plate

Parameters
hPlate

Handle of LicensePlate object

Returns

Direction in degrees from 0..360 or -1

Notes

Value -1 means that the plate do not move

90

top to bottom direction

270

bottom to top direction

360

left to right direction

180

right to left direction

This property used for video mode only

LicensePlate_GetTimestamp
int64 DTKLPRAPI LicensePlate_GetTimestamp(
LPRPLATE hPlate
)

Gets the timestamp of the video frame in which the license plate is recognized.

Parameters
hPlate

Handle of LicensePlate object

Returns

timestamp in milliseconds

Notes

This property used for video mode only

LicensePlate_GetFrameTimestamp
int64 DTKLPRAPI LicensePlate_GetFrameTimestamp(
LPRPLATE hPlate
)

Gets the timestamp of the video frame passed to LPREngine_PutFrame or LPREngine_PutFrameImageBuffer functions

Parameters
hPlate

Handle of LicensePlate object

Returns

timestamp in milliseconds

Notes

This property used for video mode only

LicensePlate_GetDateTimeString
int DTKLPRAPI LicensePlate_GetDateTimeString(
LPRPLATE hPlate,
charbuffer,
int bufferSize
)

Gets the date/time string with milliseconds of the video frame in which the license plate is recognized.

Parameters
hPlate

Handle of LicensePlate 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

LicensePlate_GetId
int64 DTKLPRAPI LicensePlate_GetId(
LPRPLATE hPlate
)

Gets the license plate unique id

Parameters
hPlate

Handle of LicensePlate object

Returns

Unique id of the license plate

Notes

Can be used to identify previously recognized plate and update the result.

This property used for video mode only

LicensePlate_GetCustomData
int64 DTKLPRAPI LicensePlate_GetCustomData(
LPRPLATE hPlate
)

Gets custom 64-bit data that was sent as a parameter to the LPREngine_PutFrame or LPREngine_PutFrameImageBuffer functions

Parameters
hPlate

Handle of LicensePlate object

Returns

64 bit integer value

Notes

This property used for video mode only

LicensePlate_GetImageBuffer
void DTKLPRAPI LicensePlate_GetImageBuffer(
LPRPLATE hPlate,
void** pImageBuffer,
intwidth,
intheight,
intstride
)

Gets the buffer of the frame image

Parameters
hPlate

Handle of LicensePlate 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 LicensePlate_FreeImageBuffer with received pointer to free memory.

This property used for video mode only

LicensePlate_SaveImage
int DTKLPRAPI LicensePlate_SaveImage(
LPRPLATE hPlate,
const charfileName,
int param
)

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

Parameters
hPlate

Handle of LicensePlate 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

LicensePlate_GetPlateImageBuffer
void DTKLPRAPI LicensePlate_GetPlateImageBuffer(
LPRPLATE hPlate,
void** pImageBuffer,
intwidth,
intheight,
intstride
)

Gets the buffer of plate image

Parameters
hPlate

Handle of LicensePlate object

pImageBuffer
void**

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

width
int*

Pointer to integer variable which receives width of plate image

height
int*

Pointer to integer variable which receives height of plate image

stride
int*

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

Notes

You need to call LicensePlate_FreeImageBuffer with received pointer to free memory.  This property used for video mode only

LicensePlate_SavePlateImage
int DTKLPRAPI LicensePlate_SavePlateImage(
LPRPLATE hPlate,
const charfileName,
int param
)

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

Parameters
hPlate

Handle of LicensePlate 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

LicensePlate_FreeImageBuffer
void DTKLPRAPI LicensePlate_FreeImageBuffer(
voidpImageBuffer
)

Delete image buffer

Parameters
pImageBuffer
void*

Pointer to image buffer received using LicensePlate_GetImageBuffer or LicensePlate_GetPlateImageBuffer functions.

License Functions
LPREngine_ActivateLicenseOnline
int DTKLPRAPI LPREngine_ActivateLicenseOnline(
const charlicenseKey,
const charcomments
)

Activates license online

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.

LPREngine_ActivateLicenseOnlineEx
int DTKLPRAPI LPREngine_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.

LPREngine_GetActivationLink
int DTKLPRAPI LPREngine_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.

LPREngine_GetActivationLinkEx
int DTKLPRAPI LPREngine_GetActivationLinkEx(
const charlicenseKey,
const charcomments,
int channels,
const charsecurity_key,
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)

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.

LPREngine_ActivateLicenseOffline
int DTKLPRAPI LPREngine_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.

LPREngine_GetSystemID
int DTKLPRAPI LPREngine_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

LPREngine_GetActivatedLicenseInfo
void DTKLPRAPI LPREngine_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.

LPREngine_SetNetLicenseServer
void DTKLPRAPI LPREngine_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.