Você está na página 1de 9

Chronos SDK Introductory Manual

Version 3.0
September 2015

The information contained in this document is confidential and proprietary to Imagsa Technologies S.A.. Imagsa
Technologies S.A. submits this document with the understanding that it will be held in strict confidence and will not be
used for any purpose other than the use Imagsa Technologies S.A. products and its qualifications. No part of
the document may be circulated, quoted, or reproduced for distribution outside the Client organization without prior
written approval from Imagsa Technologies S.A.
Chronos SDK Introductory Manual Page 2/9

Chronos SDK Introductory Manual


Version 3.0
September 2015

Contents
1. INTRODUCTION ......................................................................................................................................... 3

2. CONTENTS OF THE SDK ............................................................................................................................. 5

3. A SIMPLE EXAMPLE ................................................................................................................................... 6

4. DECLARATIONS .......................................................................................................................................... 8

5. CONTROL OF CHANGES ............................................................................................................................. 9

IMAGSA TECHNOLOGIES S.A. C/Navas de Tolosa 270, 5º 5ª Tel. +34 934.869.345 www.imagsa.com
CIF: A64065055 08027 Barcelona SPAIN Fax. +34 934.856.776 info@imagsa.com
Chronos SDK Introductory Manual Page 3/9

1. INTRODUCTION
This document briefly introduces the “ChronosSDK” software development kit delivered with Chronos line of
smart cameras for traffic control applications. These smart cameras include embedded computer vision
software customized for applications as diverse as red light control, speed enforcement or access control, and
share a common communication protocol to combine these applications in a single network.

A system based on Chronos technology can include any arbitrary number of cameras in a TCP-IP network,
connected to a central control server. The server usually manages databases of detected vehicles, issues
tickets to offending drivers, handles statistics, etc.

Chronos Cameras

Terminals for Server with software to ... for traffic control


and enforcement
graphical user record vehicle images, to
interface issue tickets to drivers, etc.

Figure 1: Sample ITS architecture using ChronosRed

Chronos products use an event-driven encrypted protocol. Every vehicle detected by a camera produces a
single packet event to the server, and the server retrieves images from cameras depending on the end-user
application. This event communication was designed to maximize system scalability and minimize response
time: the size of events is a single TCP-IP packet that will get through to the server in minimal time to allow
for the fastest response time (for example, the server can warn a police car to chase an offending vehicle in
real-time), leaving image and video data transfer to non-critical or batch processes. Confidentiality and data
consistency are important requirements in many countries, so all the data transfer using the Chronos protocol
is encrypted with an asymmetrical key.

ChronosSDK includes a set of functions to help system integrators develop applications for central control
rooms. It is currently available for C++ and C# languages. Since the SDK has been developed with Microsoft
Visual studio in windows operating system, it is advised to use this software IDE to simplify it installation and

IMAGSA TECHNOLOGIES S.A. C/Navas de Tolosa 270, 5º 5ª Tel. +34 934.869.345 www.imagsa.com
CIF: A64065055 08027 Barcelona SPAIN Fax. +34 934.856.776 info@imagsa.com
Chronos SDK Introductory Manual Page 4/9

usage. To simplify the migration of the SDK to other development environments and OSs the SDK is provided
open source (FreeBSD licensing).

Figure 2: Documentation of a Chronos SDK

All the technical details of the functions available in these classes are included in the technical manual
included with the SDK, as well as sample source code to help integration. The technical manual in Doxygen
format is installed with the SDK and available in the windows programs menu.

The SDK includes a simple demo program called ChronosDemo. This simple tool demonstrates the main
functions for managing lists of vehicles and shows vehicle detection events. Every detection event includes de
detection date and hour, the measured speed and the license plate read.

Figure 3: Example of ChronosDemo

IMAGSA TECHNOLOGIES S.A. C/Navas de Tolosa 270, 5º 5ª Tel. +34 934.869.345 www.imagsa.com
CIF: A64065055 08027 Barcelona SPAIN Fax. +34 934.856.776 info@imagsa.com
Chronos SDK Introductory Manual Page 5/9

The previous figure shows an example of ChronosDemo, developed using C#. It was designed to work with
Unicode characters, allowing operation in any country in the world (i.e. it can work with Arabic characters).

As shown in the figure this simple demo shows the list of events produced by the camera and allows the user
to download images. The demo also has other windows to show live video, and to configure the main
parameters of the camera.

The overview images can be optionally customized to follow country-specific regulations with text fields like
the location of the camera, the maximum speed allowed, etc.

To ease the work of system integrators, the source files of this demo program are also included with the SDK
distribution through FreeBSD licensing.

2. CONTENTS OF THE SDK


ChronosSDK is object oriented, so all the functions available are included in classes. Following we summarize
the contents of the SDK. For more details on the last version of the SDK the user is referred to the Doxygen
documentation included.

Currently, the SDK consists of the following classes:


 imagsa::chronos::ChronosSDK provides connection to the remote devices and a set of functions to
work with events and configure the system.

 imagsa::chronos::Event is a class used to work with events.

 imagsa::chronos::Camera is a class used to manage the remote cameras used in the system.

 imagsa::chronos::DateTime is a class used to work with dates and times.

 imagsa::chronos::ColorOverview is a class used to work with color overview images.

 imagsa::VideoDecoder is a class used to decode video streams.

ChronosSDK contains functions to communicate with the cameras and retrieve the data generated for
vehicles. The camera detects vehicle candidates (including some false positives), and generates events
(imagsa::chronos::Event) for each one. An event is a single TCP-IP packet that includes all the
meaningful information for a given vehicle candidate. For instance, the GPS location and the hour of
the detection, the license plate reading, the speed of the vehicle, etc. Most of the communications with
the camera relate to events, which are identified by an integer value called 'eventID'. The identifier of
the last vehicle candidate detected by the camera can be retrieved from the camera with the function
imagsa::chronos::ChronosSDK::GetLatest(). Using the previous function, a remote application can
check if a new vehicle candidate has been detected, and the value can be used as eventID to retrieve
the images and videos available for that particular event. For that purpose, the developer can use
functions such as imagsa::chronos::ChronosSDK::GetOverview() for overview images, or
imagsa::chronos::ChronosSDK::GetBestPlate() for the image of the license plate selected by the OCR
embedded in the camera.

IMAGSA TECHNOLOGIES S.A. C/Navas de Tolosa 270, 5º 5ª Tel. +34 934.869.345 www.imagsa.com
CIF: A64065055 08027 Barcelona SPAIN Fax. +34 934.856.776 info@imagsa.com
Chronos SDK Introductory Manual Page 6/9

The SDK includes the following folders:


 documentation/ - contains this Doxygen documentation of the whole SDK.

 cpp/bin/ - contains some required runtime files.

 cpp/lib/ - contains the required files that must be linked in your C++ projects.

 cpp/include/ - contains the headers of the files that must be included in your C++ projects.

 net/ - contains the .NET wrapper and the required libraries to use it.

 net/demo - contains a C# demo application that uses the .NET wrapper.

3. A SIMPLE EXAMPLE
The example software code in the next page shows how to connect to a camera (IP address “127.0.0.1” must
be changesd to the IP address of the camera), wait for vehicle events and retrieve from the camera the
following data for every new event:

 The output of the OCR module

 The best image of the license plates

 An overview image of the vehicle

 A BMP package including all the information available for the vehicle

IMAGSA TECHNOLOGIES S.A. C/Navas de Tolosa 270, 5º 5ª Tel. +34 934.869.345 www.imagsa.com
CIF: A64065055 08027 Barcelona SPAIN Fax. +34 934.856.776 info@imagsa.com
Chronos SDK Introductory Manual Page 7/9

#include <chronosSDK.hpp>
#include <string>
#include <iostream>
#include <opencv2\opencv.hpp>
int main(int argc, char *argv[])
{
imagsa::chronos::ChronosSDK chronosSdk;
int result;
std::string sIpAddress = "127.0.0.1";
int dPort = 4359;
bool ssl = false;

result = chronosSdk.Connect(sIpAddress, dPort, ssl);


if (result == imagsa::chronos::SUCCESS || result == imagsa::chronos::ALREADY_CONNECTED)
{
std::cout << sIpAddress << ": Successfully connected to: " << sIpAddress << std::endl;
}

while (chronosSdk.IsConnected())
{
unsigned int eventId = 0, lastEventId = 0;
imagsa::chronos::Event event;
if (chronosSdk.GetLatest(eventId) == imagsa::chronos::SUCCESS && eventId!=lastEventId)
{
lastEventId = eventId;

char *data;
unsigned int length, width, height;

// Get event
result = chronosSdk.GetEvent(eventId, event);

// Get OCR result


std::wstring sOCR = event.getOCRresult().wsPlate;

// Get best plate


result = chronosSdk.GetBestPlate(eventId, data, &width, &height);
/* DO WHATEVER WITH THE IMAGE DATA*/
cv::Mat ROIimage = cv::Mat(height, width, CV_8UC1, data).clone();
cv::imshow("Best ROI", ROIimage);

// Get overview
result = chronosSdk.GetOverview(eventId, data, &width, &height, &length);
/* DO WHATEVER WITH THE IMAGE DATA*/
// Get BMP
result = chronosSdk.GetBMP(eventId, data, &length);
/* DO WHATEVER WITH THE IMAGE DATA*/
}
else
{
std::cout << sIpAddress << "No new event available. Waiting..." << std::endl;
cv::waitKey(500);
}
}
}

IMAGSA TECHNOLOGIES S.A. C/Navas de Tolosa 270, 5º 5ª Tel. +34 934.869.345 www.imagsa.com
CIF: A64065055 08027 Barcelona SPAIN Fax. +34 934.856.776 info@imagsa.com
Chronos SDK Introductory Manual Page 8/9

4. DECLARATIONS

The information contained in this document is confidential and proprietary to Imagsa


Technologies S.A.

Imagsa Technologies S.A. submits this document with the understanding that it will be held
in strict confidence and will not be used for any purpose other than the use of Imagsa
Technologies S.A. products and its qualifications.

No part of the document may be circulated, quoted, or reproduced for distribution


outside the Client Organization without prior written approval from Imagsa
Technologies S.A.

Imagsa Technologies S.A. assumes no responsibility for any errors which may appear in this
document or for damages resulting from the use of the information contained herein.

Imagsa Technologies S.A. reserves the right to make changes of this document without
notice.

Microsoft Windows XPe is a registered trademark of Microsoft Corporation.

Atalaya Compact meets the requirements of Council Directive 2006/95/EC for


electrical safety and complies with the following European Standards for
Electromagnetic Compatibility: EN55022A, EN55024, EN60950

IMAGSA TECHNOLOGIES S.A. C/Navas de Tolosa 270, 5º 5ª Tel. +34 934.869.345 www.imagsa.com
CIF: A64065055 08027 Barcelona SPAIN Fax. +34 934.856.776 info@imagsa.com
Chronos SDK Introductory Manual Page 9/9

5. CONTROL OF CHANGES

September 2015 First version of the manual using other Chronos and Atalaya manuals as source.

IMAGSA TECHNOLOGIES S.A. C/Navas de Tolosa 270, 5º 5ª Tel. +34 934.869.345 www.imagsa.com
CIF: A64065055 08027 Barcelona SPAIN Fax. +34 934.856.776 info@imagsa.com

Você também pode gostar