SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf ·...

27

Transcript of SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf ·...

Page 1: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented
Page 2: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

SmartCAM Reference Manual

Versions: CFreeFlow 1.6.1.8 - CFServer 1.6.2.0

Document version: 12.06.21

Table of Contents

A Basic FreeFlow Architecture...............................................................................................................................................................................3 CFreeFlow Introduction ..........................................................................................................................................................................................4 The Stages of CFreeFlow.........................................................................................................................................................................................6

Camera Stage........................................................................................................................................................................................................6 The role of the Stage....................................................................................................................................................................................6 Setting up the Stage ....................................................................................................................................................................................6 Parameters.......................................................................................................................................................................................................7

Image Selection Stage.......................................................................................................................................................................................8 The role of the Stage....................................................................................................................................................................................8 Setting up the Stage ....................................................................................................................................................................................8 Parameters.................................................................................................................................................................................................... 10

License Plate Recognition Stage................................................................................................................................................................. 12 The role of the Stage................................................................................................................................................................................. 12 Setting up the Stage ................................................................................................................................................................................. 12

Miscellaneous Features ........................................................................................................................................................................................ 15 Hardware Watchdog ....................................................................................................................................................................................... 15

Usage.............................................................................................................................................................................................................. 15 Video Stream...................................................................................................................................................................................................... 15

Usage.............................................................................................................................................................................................................. 15 Parameters.................................................................................................................................................................................................... 15

Notifier ................................................................................................................................................................................................................. 16 Usage.............................................................................................................................................................................................................. 16 Parameters.................................................................................................................................................................................................... 16

Image Titling ...................................................................................................................................................................................................... 16 Usage.............................................................................................................................................................................................................. 16 Parameters.................................................................................................................................................................................................... 17

Status Variables ................................................................................................................................................................................................. 18 Parameters.................................................................................................................................................................................................... 18

Results ........................................................................................................................................................................................................................ 19 Logging................................................................................................................................................................................................................ 21

Parameters.................................................................................................................................................................................................... 22 Frequently Asked Questions............................................................................................................................................................................... 23

Configurations................................................................................................................................................................................................... 23 Emulation............................................................................................................................................................................................................ 23 Triggers ................................................................................................................................................................................................................ 24

CFServer Introduction .......................................................................................................................................................................................... 25 Usage of CFServer...................................................................................................................................................................................... 25 Parameters.................................................................................................................................................................................................... 26 Commands ................................................................................................................................................................................................... 26 Examples ....................................................................................................................................................................................................... 26

Contact Information .............................................................................................................................................................................................. 27

Page 2/27 SmartCAM Reference Manual

Page 3: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

A Basic FreeFlow Architecture

A Basic FreeFlow Architecture (BFA) consists of three phases:

Image Capture

The images are captured in this phase. An image source can be for example:

analog or digital video stream (e.g. FXVD4 or FXCAMd)

backup storage device (HDD, DVD etc.)

custom image source (e.g. software supplying images through a FIFO)

Image Processing

The processing of the captured images may include selecting those images which are of special interest (e.g. contain motion or correspond to a trigger event), license plate recognition (LPR), post-LPR ranking and cropping, etc.

Data Storage/Transmission

The methods used for of storing and/or transmitting recognition results depend on the actual system requirements. A few possibilities are listed below. The results may be stored:

locally

in image and text files

in buffers allocated in memory

in a local data base (e.g. MySQL, SQLite)

using custom storing software

using a network resource such as

remote SQL server

FTP server or a network drive

NOTE: Since FxCAMd cameras generate high network traffic, it is strongly recommended to install them on dedicated networks only.

The CFreeFlow module implements a complete BFA, which uses: – an FXCAMd as an image source – motion detection and/or triggering, license plate recognition and post-LPR ranking for image selection – software buffers for storing ARH also supplies a supplementary implementation for the third phase: CFServer, which contains a local SQL database combined with a web interface to query results.

Page 3/27 SmartCAM Reference Manual

Page 4: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

CFreeFlow Introduction

CFreeFlow (CFF) is a module which implements the connections between ARH products such as FXCAMd cameras, CARMEN® ANPR engine etc. as a complete BFA. CFF also contains various algorithms which complete it to a really powerful BFA system.

Page 4/27 SmartCAM Reference Manual

Page 5: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

Though CFF was designed and implemented to offer a great deal of flexibility both uses and abuses are possible. For example, it can be really ineffective (though possible) to use the MJPEG stream (supplied as a plug-in) as an image stream then run LPR on all images. The module's source code is not open source, however, on behalf of ARH all questions regarding implementation details are welcome.

As shown in Fig. 2., CFF implements a complete BFA from image capturing to image storage. All you need to do is (besides setting up parameters) to start the module, then periodically query the results, which will contain an image and the data extracted from it (e.g. capture time, license plate number, etc.).

CFF can be fine-tuned by setting the values of its parameters corresponding to your special needs. The parameters are organized in a tree – each parameter has its path. For example: "default/cff/camera/id" defines a parameter describing the identifier of the camera. For more information on parameter storage see GX Reference Manual.

The values of the parameters are stored in two special XML files (gxsd.dat and cffsys.ini) whence they are read when the module is started.

With CFF, a simple BFA can be implemented in less than 20 lines of source code.

Page 5/27 SmartCAM Reference Manual

Page 6: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

The Stages of CFreeFlow

The following sections detail the roles, setup possibilities and parameters of the stages of CFF.

From now on, the path of the parameters will be specified relatively to ".../cff/". That is: instead of e.g. "default/cff/camera/id" only "camera/id" will be given.

Camera Stage

The role of the Stage

This stage is the source of the images to be processed. There are two image sources available, one is an FXCAMd device identified with an IP address or an USB ID (FXCAMU*), the other is a camera emulator which supplies images from HDD to the module.

Setting up the Stage

The configuration of the stage includes specifying the image source. It is usually an FXCAMd device. In this case the "camera/id" is a property group in gxsd.dat, where the properties of the FXCAMd camera are located. The FXCAMd Reference Manual contains further information about the device.

The captured images can be flipped vertically by "camera/flip_img". This feature is useful in case of upside-down mounted cameras.

Using the emulator (for instance with pre-captured images or for test purposes) set "camera/id" to "FXCAMX".

The emulator reads images from HDD, from the directory supplied in "emu/path". These images are "played back" with a frame rate corresponding to "emu/timediff", in microseconds. (That is a value of e.g. 16667 corresponds to 60 fps.) The images are sorted according to their file names.

Further processing is identical to that of the FXCAMd device. Some basic properties of the images must be supplied as parameters, such as if the image is color or grayscale, the size of the image, etc. To play back the images in reverse order set the parameter "emu/reverse" to 1.

Page 6/27 SmartCAM Reference Manual

Page 7: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

Parameters

[Path] [Default Value] [Description]

camera/id fxCamera default(*)

Camera property group or FXCAMX for camera emulation

camera/flip_img 0 Flip image (for cameras mounted upside down)

emu/reverse 0 Play back the images in reverse order

emu/xsize 752 Horizontal size of the image

emu/ysize 480 Vertical size of the image

emu/color 0 Color image

emu/timediff 20000 (50 fps) Time between sequential images (microseconds)

emu/path - Image source path for input images

emu/rewind 0 Rewind fxs stream

Page 7/27 SmartCAM Reference Manual

Page 8: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

Image Selection Stage

The role of the Stage

This stage selects from the multitude of images those, which may be possibly suitable for license plate recognition.

There are four different configurations for this stage:

- the above decision can be based on motion detection, or

- on external trigger event, or

- on an external trigger event combined with motion detection, or

- the module does not decide at all, but forwards all images

In the first case, a software motion detector (CMMD) decides which images contain motion and compiles a sequence of images corresponding to the same object.

In the second and third cases, an external (hardware or software) event triggers image forwarding. You can use motion detection (EXTTRIG), as a result of which triggered images will be forwarded only if they contain moving objects, or you can base the decision solely on the trigger (EXTTRIGONLY).

To skip this stage completely and forward all images captured, insert a null stage (NULLMD) here instead of the above two solutions.

Setting up the Stage

The appropriate configuration can be set by setting "motdet/type" to CMMD, EXTTRIG, EXTTRIGONLY or NULLMD corresponding to the different configurations described above.

The motion detector is able to slice up the sequence of moving images according to the objects passing by, so that one slice will contain images corresponding to the same object.

The limitation of the number of images in one slice (that is, of one object) can be set with "motdet/max_objix".

It is possible to exclude image regions from motion detection. This is good practice for example if there is a tree on the side of the road, blown by the wind – thus generating constant motion in the image. By using image masking, motions in this region can be ignored in the following way: In a B&W image, pixels of regions to be included in motion detection have to be set to 0xFF and pixels of the regions to be excluded have to be set to 0x0.

The path of the mask image should be given in "motdet/image_masking"; the feature should be enabled by setting "motdet/image_masking" to 1. The image will be resized to suit the camera's native resolution.

Page 8/27 SmartCAM Reference Manual

Page 9: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

Forwarding some images even if no motion is detected can be done with the setting "motdet/no_motion_timeoutms", which returns images regularly with the given timeout, even if no movement occurs. This feature is disabled by setting the parameter to 0.

An external trigger source can be used in a number of ways. The simplest way is to send a trigger event directly to the module, by calling a simple module function. For detailed description check the sample programs.

You can also use the GPIO port of the FXCAMd for triggering. For more information check the corresponding chapter in the FXCAMd Reference Manual.

If for some reason the above mentioned triggering methods are not suitable for you, or you have a device that can supply speed and/or length data communicating for example on through UART, then a plug-in can be implemented for the trigger device which means implementing a few simple functions (such as for example SendTrigger()) and compiling an so/dll. CFF will communicate with the device through this well defined interface. For details of the plug-in specifications please contact ARH Support Team.

Once the plug-in is available, set its path with "trigger/plugin", and enable it with "trigger/use_plugin". If the plugin uses the UART of the device (camera UART, or the UART of the SmartCamera PC) then the name of the port has to be specified where the trigger device is connected to ("trigger/interface"). This can be either "CAMERA", if the device is connected directly to the serial port of the camera, or the interface name, e.g. "/dev/ttyS0" under Linux or "COM1" in Windows.

The images will be forwarded in a time window relative to the timestamp of the trigger event, thus it may be fine tuned which images should be returned. This window is the trigger timestamp plus “trigger/wnd_plus_ms” and minus "trigger/wnd_minus_ms". For defining a time offset between the trigger and the corresponding image (for example if the trigger and the radar are not aiming at exactly the same spot) use "trigger/offset". If some pre-trigger images are missed because they are no more available when the trigger event arrives, the size of the image buffer may be increased with "trigger/delay_length". This length should be easily calculated from the frame rate and length of time interval of the missing images.

The filtering of triggered images for motion can be enabled or disabled. In case of enabling "trigger/md_filters_triggd", only those triggered images will be forwarded which contain motion. (This is an obsolete parameter, use EXTTRIG and EXTTRIGONLY instead.)

If the trigger device and the plug-in can provide information regarding to the direction and speed of the vehicle, further filtering can be enabled with "trigger/direction" (forwards only objects moving to the given direction) and "trigger/speeding_only" (returns objects with speeds exceeding the speed limit). By entering zero (0) in the respective property both can be disabled. In "trigger/direction" 1 represents oncoming while 2 represents receding traffic.

Speed limits can be set for 5 vehicle classes. Each vehicle class may be assigned a name with "classes/class$$/name", such as for example "motorcycle". If the trigger device is able to differentiate vehicle classes it will return a number representing the object's class (for example the length of the object). The limits relative to this number for the different classes can be set with "classes/class$$/range_min" and "classes/class$$/range_max". The speed limit of the class can be given in "classes/class$$/speed_limit". ($$ should be substituted with {01,02,03,04,05}.)

Set "motdet/type" to NULLMD in order to disable image filtering.

Page 9/27 SmartCAM Reference Manual

Page 10: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

Parameters

[Path] [Default Value] [Description]

motdet/ret_first_n 0 Forwards only the first n images of the motion

motdet/max_objix 0 (Unlimited)

Maximal number of images considered as one object

motdet/type CMMD Type of image selection (CMMD - Software MD, EXTTRIG - external trigger, NULLMD -no MD)

motdet/no_motion_timeoutms 0 (Disabled)Even with no motion returns image regularly (See above at "Setting up the Stage")

motdet/image_masking 0 (Disabled) Use a mask image to exclude regions from motion detection

motdet/mask_image_path . Path to mask image

trigger/offset 0 Time offset between the trigger and the corresponding image

trigger/plugin . Path to trigger plugin

trigger/use_plugin 0 (Disabled) Use a trigger plugin

trigger/interface - The port the trigger is connected to (e.g. CAMERA - camera panel, /dev/ttyS0 - serial port 0)

trigger/delay_length 1 Number of images buffered to enable forwarding pretrigger images

trigger/direction 1 Return given direction vehicles (See above at "Setting up the Stage")

trigger/speeding_only 0 Return speeding vehicles only (See above at "Setting up the Stage")

trigger/wnd_plus_ms 500 Upper limit of time window for forwarding images

trigger/wnd_minus_ms -500 Lower limit of time window for forwarding images

trigger/md_filters_triggd 1 Filter triggered events according to the result of motion detection

classes/class$$/speed_limit 0 Speed limit for class $$=01...05

classes/class$$/range_min 0 Category value minimum

classes/class$$/range_max 0 Category value maximum

Page 10/27 SmartCAM Reference Manual

Page 11: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

classes/class$$/name 0 Name of the vehicle class

gpio/in_active_edge 0 Trigger IN active edge *

gpio/in_nsamples 10 Number of identical samples required to accept *

gpio/in_sampleratehz 100 Sample rate *

gpio/out_active_level 0 Trigger OUT active level *

* For more information see the “Triggering the GP I/O pin” section of the FXCAMd Reference Manual.

Page 11/27 SmartCAM Reference Manual

Page 12: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

License Plate Recognition Stage

The role of the Stage

The license plate recognition (LPR) stage extracts license plate (LP) information from the image, selects and sorts images according to the extracted LP information, while returning problematic images (if there is any) from which no LP information was extractable.

Setting up the Stage

This stage receives slices of the image stream from the previous stage, which (at best) contain images of the same object, but may contain images of two or more vehicles.

The stage will receive typically 5 – 20 images per object, depending on the length of the vehicle, frame rate, etc. For example, in case of a vehicle following the previous one at a very short distance, motion detection may perceive this situation as one long object passing, instead of two separate objects. In this case, CFF will try to return both license plates.

Some kind of strategy must be applied per object to decide whether to return one, two or more plates, and which should these be.

Example: two vehicles are approaching with a very short following distance, with license plates respectively ABC 123 and DEF 456. The motion detector (e.g. a radar device) perceives them as one single object approaching at 100 km/h (62 mph). CFF captures 13 images and reads the following license plates:

#01 B123 #06 AB012 #11 0EF456

#02 ABCI23 #07 BF45 #12 OEF456

#03 ABC123 #08 EF456 #13 0EF456

#04 ABC123 #09 DEF456

#05 ABC123 #10 DEF456

Of course, the error rates of ARH ANPR engines are much lower but we have to consider various factors corrupting accuracy (e.g. partly captured license plates of objects entering and leaving the field of view, contaminated or faded plates, burned out image etc.).

In this case we must return two plates: ABC 123 and DEF 456. The strategy and the parameters to customize it are described below.

If two LPs are read from images that have close timestamps (in time units closer than "recognize/min_lp_dt" ms), then – in a highway situation – the object is very unlikely to be two vehicles. One of the plates is more likely a dummy (toy) license plate, like DADDY01, which must be thrown away. No two results closer to each other than this value will ever be returned.

If it is enabled, the module also considers LPs too close to the edge of the image as weaker. This proximity can be defined with "recognize/lp_pos_limit" in terms of the height of the LP.

Page 12/27 SmartCAM Reference Manual

Page 13: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

To limit the time of a slice processing set "recognize/put_timeoutms".

If two slices supply the same result in "recognize/duplicate_timeout" ms-s then the module will discard the latter to avoid duplicates.

Strings which describe the preferred license plate syntaxes (e.g. in the format "LLLDDD" – three letters followed by three digits) can be defined. At maximum 8 such strings can be defined.

In the above example, since there are two of both 0EF456 and DEF456, but DEF456 fits the syntax LLLDDD, DEF456 will be returned.

The number of defined strings can be set with "recognize/syntax/syntax_cnt". The definition of each syntax has to be placed in "recognize/syntax/syntax$$/", where $$=[00,01,...,07]. The syntax string should be defined in "recognize/syntax/syntax$$/syntax", for the details of the wildcards accepted see the table below. To disable this feature simply set "recognize/syntax/syntax_cnt" to 0.

Weights can also be assigned to each syntax according to the importance of license plates of the given syntax. In this way, a license plate with a higher weight never gets thrown away if it differs in only one character and the result count equals for the two license plates. This weight can be set with "recognize/syntax/syntax$$/syntax_w".

Wildcard accepted characters: L Letters (A,B,...,Z) D Digits (0,...,9)

Switching to a faster LPR engine is possible depending on the load of the computer. If LPR processing goes smoothly, a slower but more accurate engine ("recognize/anpr0") can be used. If the LPR processing lags behind image capturing, the module switches to a faster engine ("recognize/anpr1"). To use this feature, the two engines should be set up accordingly (one slow but more precise, one very fast). The module can also be set in order to stop processing further images of the current slice upon finding some (e.g. 3) identical results. This feature can be disabled by setting "recognize/max_lpcnt" to 0. The threshold number of identical result should be specified in "recognize/max_lpcnt".

When using more ANPR engines, switch to the “quick” engine occurs when there are more then “recognize/quick_limit” license plates are waiting to be processed.

Moving objects from which no LP information was extractable may also be returned, by setting "recognize/umo_check" to enabled. If it is possible to have more LPs in one image, the "recognize/max_plates" can be set, which is a limit on the number of LPs can be searched for in one image. Note that this increases the processing time of one image.

Page 13/27 SmartCAM Reference Manual

Page 14: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

Parameters

[Path] [Default Value]

[Description]

recognize/enabled 1 Enables LPR

recognize/anpr0 ”default” Slow but more precise ANPR engine

recognize/anpr1 ”default” Fast but less precise ANPR engine

recognize/max_plates 1 Max. number of plates searched for in one image

recognize/put_timeoutms 0 (Disabled) A result is returned if processing tries to take longer than this value

recognize/duplicate_timeout 5000 Timeout of the above. At least 5 seconds should elapse for acceptance of the same LP again

recognize/min_lp_dt 0 (Disabled) Minimal following distance (ms)

recognize/lp_pos_limit 0 (Disabled) Minimal distance from the edge of the image (LP height)

recognize/max_lpcnt 5 If n identical LPs are recognized no further images of the slice will be LP processed

recognize/umo_check 1 Return images with no license plate

recognize/syntax/syntax_cnt 0 The number of defined syntax strings

recognize/syntax/syntax$$/syntax - The $$th syntax definition string

recognize/syntax/syntax$$/syntax_w - The weight of the $$th syntax definition string

recognize/quick_limit 5 Number plate limit to switch to the “quick” engine

Page 14/27 SmartCAM Reference Manual

Page 15: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

Miscellaneous Features

Hardware Watchdog

Usage

A built-in hardware watchdog reboots the Smart Camera in case of the software might happen to hang and stops triggering the watchdog.

Video Stream Usage

Video stream provides a live image from the incoming frames in a form of a streamable video with a certain reduction ("vstream/image_type") and FPS ("vstream/fps"). Currently, there is only one plug-in available which emits an mjpeg stream on an http server ("vstream/plugin").

Parameters

[Path] [Default Value] [Description]

vstream/enabled 0 Enable stream

vstream/image_type 1 Ratio of image resizing (0 - complete image, 1 - half, 2 - quarter etc.)

vstream/fps 10

Number of streamed frames per second. It depends on the frame rate of the camera. If too high, it reduces performance.

vstream/show_mask 0 Display motion detection mask on video stream.

vstream/plugin - The path of the plug-in which generates the video stream.

Page 15/27 SmartCAM Reference Manual

Page 16: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

Notifier

Usage

The module can use a plug-in to notify a receiver of one of its inner events (e.g. if a new result is available, a trigger event was captured, etc.). To write such a plug-in, please contact ARH Support Team. One demo plug-in is available, which connects to a UDP or a TCP server and sends a message to these servers if such an event occurs.

Parameters

[Path] [Default Value] [Description]

notify/enable 0 (Disabled) Enable notifier

notify/plugin - Plug-in path

Image Titling

Usage

This feature offers the possibility to write object information directly in the image (e.g. writing the time of capturing, license plate and the speed of the object in the image). A format string can be specified to use as a template in formatting the title.

The following wildcards may be used:

[Format] [Description]

$y - year (4 digit)

$r - year (2 digit)

$o - month (2 digit)

$d - day (2 digit)

$h - hour (2 digit)

$m - minute (2 digit)

$s - second (2 digit)

$$ - $ (1 character)

$E - device ID ("title/ID")

$G - device coordinates ("title/location")

$c - category number (as returned by the trigger device)

$C - category string ("classes/class$$/name")

$x - speed (Km/h)

$X - speed (2 decimal places)

Page 16/27 SmartCAM Reference Manual

Page 17: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

$i - direction

$p - license plate

$t - capture time

$Ts - trigger start (milliseconds)

$Tt - trigger time stamp

$Te - trigger end (milliseconds)

$Tx - image time relative to trigger start

$k - insert a column break

For example, to print the above example's data in one line:

"Time: $y-$o-$d $h:$m:$s, LP: '$p', Speed: $x Km/h"

Image titling can be enabled by "title/enable". Up to eight such strings can be specified, which will be printed in "title/nlines" lines. Each string is defined at "title/title_string$$" in different line ($$ should be substituted with {00,01,02,03,04,05,06,07}).

Parameters

[Path] [Default Value]

[Description]

title/enable 0 enable image titling

title/nlines 0 number of lines to be printed

title/ID - string describing the ID of the device

title/location - string describing the location of the device

title/direction_string$$ - string describing the observed directions

$$={00,01,02}

title/title_string$$ - template strings $$={00,01,02,03,04,05,06,07}

Page 17/27 SmartCAM Reference Manual

Page 18: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

Status Variables

In the CFF module there are parameters which are output parameters only – it means that they cannot be changed from the application.

If the connection between the module and the FXCAMd device breaks, the module tries to reconnect automatically. The time of the last reconnection ("camera/last_reconnect_time") and the total number of the reconnection attempts ("camera/reconnect_count") can be queried for diagnostic purposes.

If the above mentioned attempts exceed a certain value, triggering a hardware reset may resolve this otherwise possibly irrecoverable error.

The timing of the module is optimized. However, it may happen – depending on the hardware the module runs on – that some images get skipped, because they do not get processed in lack of time. The number of these images can be queried with "camera/skipframe_count".

The total number of captured images can be queried with "capture/frame_counter".

Parameters

[Path] [Default Value] [Description]

camera/last_reconnect_time - The time the camera reconnected last time.

camera/reconnect_count - The number of times the camera has reconnected.

camera/skipframe_count - The total number of skipped images.

camera/connected - Indicates whether the camera is connected or not.

Page 18/27 SmartCAM Reference Manual

Page 19: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

Results

Results are returned in one object (gxVariant), in a tree structure. Elements of the result may be queried using a path (similar to the parameter path described above) in the tree.

There are two levels of the results:

Basic which contains only the most important values only, and

Extended which contains all available values.

For the detailed description on how to query a value please check the examples.

Depending on the actual configuration the following data may be available in the result:

[Query string]

[Basic

/Extended] [Type] [Description]

root The root variant

capture

normal_image Basic gxIMAGE Normal sized image

small_image Extended gxIMAGE Small image

frametimems Basic gxu64 Capture time in ms since the epoch (1970-01-01, 0:00)

frameindex Extended gxu16 Index of the frame

control

shutterms Extended gxu32 The value of shutter at capture (FXCAMd only)

again Extended gxu16 The value of analog gain at capture (FXCAMd only)

dgain Extended gxu16 The value of digital gain at capture (FXCAMd only)

blacklevel Extended gxu16 The value of black level at capture (FXCAMd only)

iris Extended gxu16 The value of iris at capture (FXCAMd only)

trigger

tgdata Extended void* Trigger data provided by the trigger

tglen Extended gxu16 Trigger data length

Page 19/27 SmartCAM Reference Manual

Page 20: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

speed Extended gxi32 Speed of the object

speed_limit Extended gxu32 The actual speed limit corresponding to the object's category

category Extended gxu32 Category of the object

direction Extended gxu8 Direction of the object

motdet

rect Extended int[4] The rectangle containing the moving part of the image

confidence Extended int The confidence level corresponding to the motion rectangle

object_id Extended gxu32 The ID of the moving object

object_ix Extended gxu32 The index of the frame taken of the same object

anpr

text Basic wchar_t* License plate text

text_ascii Extended char* License plate text (ASCII)

frame Extended int[8] License plate frame

bgcolor Extended int License plate background color

color Extended int License plate text color

confidence Extended int License plate confidence

type Basic int License plate type

timems Extended int ANPR processing time (ms)

resultcnt Extended int ANPR result count

tbgcolor Extended int The background color of the characters

tcolor Extended int The foreground color of the characters

final Extended int Temporary/final result

Page 20/27 SmartCAM Reference Manual

Page 21: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

Logging

The CFF module supports the use of log files. In these files, certain internal operations of the system can be recorded. The use of logging is advisable, since the occurred errors are registered in the log files. ident - identification string Identification string of the application (e.g. 'MYAPPLICATION'). file - name of the log file This property contains the path and the name of the log file. If it is empty, the log module forwards the log messages to the system logger (syslogd on Linux and event logging system on Windows). format - format string You can define the line format of the log file. The logger reads the arguments and replaces the specified arguments with the specified values. Possible arguments:

$y : year (4 digits) $r : year (2 digits) $o : month (2 digits) $d : day (2 digits) $h : hour (2 digits) $m : minute (2 digits) $s : second (2 digits) $z : milliseconds (3 digits) $l : level (number) $L : level (string) $i : identification (string) $F : name of the file (string) $I : line in the file (number) $P : name of the function (string) $M : message (string) $p : process id (8 digits hex number) $t : thread id (8 digits hex number) $$ : one dollar character (1 character)

Default format: ="$y-$o-$d $h:$m:$s ($l:$L) [$i] {$F:$I:$P} $M" filter - message filter Messages are arranged into levels according to their severity (see the example below). The message filter value determines the maximum level of messages to be written to the log file. If it is 0, logging is disabled. levels - strings for level codes Every message level has a description string. The logger writes it into the log file when the $L is included in the format string.

Page 21/27 SmartCAM Reference Manual

Page 22: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

Default log levels: <levels> <L0 value="NONE"/> <L1 value="EMER"/> <L2 value="FATL"/> <L3 value="ERRO"/> <L4 value="WARN"/> <L5 value="INFO"/> <L6 value="INF2"/> <L7 value="INF3"/> <L8 value="DBG1"/> <L9 value="DBG2"/> </levels> maxfilesize – maximal length of a log file When the size of the log file exceeds the value set in this property, the logger creates a new log file. maxfilenum – maximum number of log files When the number of log files exceeds the value set in this property, the logger deletes the oldest log file. coloring - If set to enabled, different log levels get colored with different colors.

Parameters

[Path] [Default Value] [Description]

log/ident - Identification string of the application

log/file - Path and name of the log file

log/format see above Line format of the log file

log/filter 5 Maximal level of messages to be logged

log/level/l$ see above $ stands for any digit and refers to a description string of a log level

log/maxfilesize -1 Max. allowed size of the log files, -1 = no limit

log/maxfilenum -1 Max. allowed number of log files,

-1 = no limit

log/coloring 0 Enables or disables coloring different log levels with different colors

Page 22/27 SmartCAM Reference Manual

Page 23: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

Frequently Asked Questions

Configurations

+Q: I want all images to be returned for which I have sent a trigger event! It seems that only those are returned that contain something moving/I am missing some images.

+A: Use the EXTTRIGONLY flag, this way all images corresponding to the trigger will be forwarded regardless of motion detection.

Emulation

+Q: Is there a special directory structure needed for camera emulation?

+A: No special directory structure is needed. You can supply the directory of images at "cff/emu/path".

NOTE: Do not forget to use the FXCAMX emulator ("cff/camera/id").

+Q: Does the emulator loop through the images, or plays them only once?

+A: The emulator loops through the images.

+Q: What settings do I need to use the emulator?

+A: This means only a valid path at "cff/emu/path" and setting "cff/camera/id", as follows:

... <cff> ... <camera> ... <id value="FXCAMX"> ... </camera> <emu> ... <path value="/var/cfreeflow/normal_images"/> ... </emu> ... </cff>

Page 23/27 SmartCAM Reference Manual

Page 24: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

Triggers

+Q: I'm about to use SendTriggerEvent, but CFF says: No Such Member. What now?

+A: Most likely you forgot to set "motdet/type" to EXTTRIG or EXTTRIGONLY, as this is the only configuration that accepts trigger events.

+Q: OK, now I have set EXTTRIG: still no images.

+A: Maybe there is no motion in your image stream. If that is the way you intend to use triggering, please set EXTTRIGONLY.

+Q: I did everything just like I was told to but STILL no images!

+A: Make sure that the timestamp of your trigger event is in milliseconds passed since 1970-01-01 0:00 UTC. For example the .NET function "DateTime.Now.ToFileTimeUtc()" returns the number of 100s of nanoseconds elapsed since 1601-01-01 24:00. In this case you have to subtract 1970-01-01 0:00 UTC and divide by 10 000 to get a compatible time value. Or, you can supply 0 as a timestamp, which means "now".

Page 24/27 SmartCAM Reference Manual

Page 25: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

CFServer Introduction

CFServer (CFS) is a service to implement the storage phase of a BFA. CFS instantiates, starts and periodically queries a CFreeFlow module for results and stores the results in a data base.

The results can be queried through a standard web interface, so that you can deploy the server, have it running and get the results using FCGI commands from a remote machine without writing a custom application.

Usage of CFServer

CFServer is a standard FCGI service, executed by a web server (e.g. Apache). The server has several parameters: The path of the SQL database file can be set with "cfs/db/dbpath", the maximal number of results stored in the database with "cfs/db/max_record" - if the actual number of records exceeds this value, older results will be deleted.

By enabling "cfs/db/filter", entries with identical or missing plate information get overwritten sequentially, thus the database will contain the last such element.

The corresponding images are stored at "cfs/db/imgpath". The name of the database table is given with "cfs/db/table”, so the different results can be stored (e.g. from two sites) in different tables of the same database. After installation and configuration, the service can be used with the commands detailed below.

With the help of the “cfs/max_day” parameter, it can be set that until how many days the results are stored before they get deleted.

Information of the camera can be queried by the “cfs/location” and “cfs/camID” parameters. The former parameter provides information about the location of the camera (e.g. M7 67km) while the latter one contains the camera identifier string (e.g. TestSite009). Both parameters are returned in the XML.

The structure of a query is the following: cfserver.fcgi?cmd=[COMMAND]&[NAME1]=[VALUE1]&[NAME2]=[VALUE2]&...

Page 25/27 SmartCAM Reference Manual

Page 26: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

Parameters

[Path] [Default Value] [Description]

cfs/db/dbpath - path of the database file

cfs/db/max_record 20000 maximal number of stored results

cfs/db/filter 0 Enables or disables overwriting entries with missing or identical plate information.

cfs/db/imgpath - path of stored images

cfs/db/table - name of the database table

cfs/max_day 0

max. number of days results are stored before they get deleted,

0 = no limit

cfs/location - location info

cfs/camID - camera identifier string

Commands

For the full command list of the CFServer and for additional programming help see CFServer Programming Guide.

Examples

Assuming a CFServer running on 192.168.10.223, the following commands are all valid:

http://192.168.10.223/cfserver.fcgi?cmd=getresult&id=last http://192.168.10.223/cfserver.fcgi?cmd=getimage&id=[ID]&type=normal http://192.168.10.223/cfserver.fcgi?cmd=getdata&id=[ID] http://192.168.10.223/cfserver.fcgi?cmd=tuneoptic&method=iris_open&length=50

Page 26/27 SmartCAM Reference Manual

Page 27: SmartCAM Reference Manual - iEntry Systemsientrysystems.co.uk/SmartCAM_Reference_Manual.pdf · 2014-10-27 · SmartCAM Reference Manual Page 4/27 Though CFF was designed and implemented

Page 27/27

SmartCAM Reference Manual

Contact Information

Should you have any problem during operating the products, our support team is at your disposal. Please try to explain the problem as detailed as possible and do not forget to send the following information to make it easier to help you:

The name of your company (for administration purposes). The exact type of the product you have (serial number is appreciated). If you have problems during recognition, send images in the original file format. If there is any error code or message appearing, please send us the code snippet where it occurs (a

screenshot may also be helpful). If you noticed the problem while running a Demo or a sample application, please let us know the name of

the application you tested. If you have some problem while developing your own application, please specify the followings:

o your programming language o your operating system o the name and version number of the compiler you use o the programming technology (e.g. native C/C++ / ActiveX / .NET) o If possible please send a short part of the source code. Please try to determine the place where the

error occurs (e.g. “the scapture?getshutter command returns a negative number…“).

IMPORTANT NOTES:

Before sending back a faulty device, always contact ARH Support Team. Repairs may be executed by the manufacturer only!

Office address: Service address: ARH Inc. ARH Inc. 41 Alkotás Road Ipari Park HRSZ 1113/1 HU-1123 Budapest HU-2074 Perbál Hungary Hungary Phone: +36 1 2019650 Phone: +36 1 2019650 Web: www.arhungary.hu Web: www.arhungary.hu Email: [email protected] Email: [email protected]