Beruflich Dokumente
Kultur Dokumente
Page 1/58
Table of Contents
Introduction .................................................................................................................................................................................................................................... 4 The Camera Software ................................................................................................................................................................................................................... 4 The Camera Modules.................................................................................................................................................................................................................... 5 General Communication Interface .......................................................................................................................................................................................... 7 Setting Parameter Values ..................................................................................................................................................................................................... 7 Retrieving Parameter Values ............................................................................................................................................................................................... 7 Retrieving Parameter Ranges ............................................................................................................................................................................................. 8 Image Capturing Interface ......................................................................................................................................................................................................... 9 1. Introduction ......................................................................................................................................................................................................................... 9 2. Image Sensor .....................................................................................................................................................................................................................10 3. Frame Limiter.....................................................................................................................................................................................................................11 4. Flash Driver.........................................................................................................................................................................................................................11 5. De-Bayer ..............................................................................................................................................................................................................................12 6. Color Correction................................................................................................................................................................................................................12 7. Gamma Correction...........................................................................................................................................................................................................13 8. Mirroring and Rotation...................................................................................................................................................................................................14 9. Image Compressor...........................................................................................................................................................................................................14 10. Motion Detector.............................................................................................................................................................................................................15 11. Analyzer.............................................................................................................................................................................................................................17 12. Frame Buffers...................................................................................................................................................................................................................17 12.1 Getting Images from the Frame Buffer ................................................................................................................................................................18 13. Properties .........................................................................................................................................................................................................................19 System Hardware Date and Time ...........................................................................................................................................................................................21 1. Introduction .......................................................................................................................................................................................................................21 2. Retrieving Time Parameters ..........................................................................................................................................................................................21 Automatic Zoom Control ..........................................................................................................................................................................................................23 1. Manual Method.................................................................................................................................................................................................................23 2. Automatic Method...........................................................................................................................................................................................................23 3. Parameter Sets...................................................................................................................................................................................................................25 4. Errors.....................................................................................................................................................................................................................................25 Automatic Focus Control ..........................................................................................................................................................................................................26 1. Manual Method.................................................................................................................................................................................................................26 2. Autofocus............................................................................................................................................................................................................................26 3. Brightness and Autofocus .............................................................................................................................................................................................26 4. Parameters..........................................................................................................................................................................................................................27 5. Errors.....................................................................................................................................................................................................................................27 Automatic Brightness Control.................................................................................................................................................................................................28 1. Manual Mode.....................................................................................................................................................................................................................28 2. BrightNow!..........................................................................................................................................................................................................................28 3. Automatic Mode...............................................................................................................................................................................................................28 4. Module Parameters..........................................................................................................................................................................................................29 5. Operation of Strategies ..................................................................................................................................................................................................30 6. Errors.....................................................................................................................................................................................................................................30 Illuminator Configuration Manager ......................................................................................................................................................................................30 Scheduler Trigger.........................................................................................................................................................................................................................31 1. Introduction .......................................................................................................................................................................................................................31 2. Basic Parameters...............................................................................................................................................................................................................31 3. Level and Edge Control ..................................................................................................................................................................................................32 4. Errors.....................................................................................................................................................................................................................................32
Page 2/58
Upload Manager ..........................................................................................................................................................................................................................33 1. Introduction .......................................................................................................................................................................................................................33 2. Parameters..........................................................................................................................................................................................................................33 3. Processing Logging Data ...............................................................................................................................................................................................35 4. Errors.....................................................................................................................................................................................................................................35 Event Manager..............................................................................................................................................................................................................................36 1. Short Description .............................................................................................................................................................................................................36 2. Detailed Description .......................................................................................................................................................................................................36 3. Commands and Parameters..........................................................................................................................................................................................37 Software Trigger...........................................................................................................................................................................................................................39 1. Short Description .............................................................................................................................................................................................................39 2. Detailed Description .......................................................................................................................................................................................................39 3. Parameters..........................................................................................................................................................................................................................39 GPIO Trigger ..................................................................................................................................................................................................................................40 1. Short Description .............................................................................................................................................................................................................40 2. Detailed Description .......................................................................................................................................................................................................40 3. Parameters..........................................................................................................................................................................................................................40 UART Trigger..................................................................................................................................................................................................................................41 1. Short Description .............................................................................................................................................................................................................41 2. Detailed Description .......................................................................................................................................................................................................41 3. Parameters..........................................................................................................................................................................................................................41 Interface to Camera Peripherals .............................................................................................................................................................................................42 1. Short Description .............................................................................................................................................................................................................42 2. Detailed Description .......................................................................................................................................................................................................42 3. Parameters..........................................................................................................................................................................................................................43 Logging...........................................................................................................................................................................................................................................45 1. Short Description .............................................................................................................................................................................................................45 2. Filtering Log Records.......................................................................................................................................................................................................45 Backup System .............................................................................................................................................................................................................................46 1. Short Description .............................................................................................................................................................................................................46 2. Module Parameters..........................................................................................................................................................................................................46 System Update .............................................................................................................................................................................................................................47 1. Short Description .............................................................................................................................................................................................................47 2. Uploading Backup File....................................................................................................................................................................................................47 ARHIP - PC API Description.......................................................................................................................................................................................................48 Module Initialization and Closure ...................................................................................................................................................................................48 Functions of Communication (query/answer)............................................................................................................................................................48 Handling of Data Streams ..................................................................................................................................................................................................49 Creating Backup File with ARHIP PCAPI ........................................................................................................................................................................53 Uploading Backup File (Update) with ARHIP PCAPI..................................................................................................................................................54 Getting Images from the Scapture Module .................................................................................................................................................................55 Contact Information ...................................................................................................................................................................................................................58
Page 3/58
Introduction
Welcome to the Programmer's Manual of the ParkIT series cameras. This document is intended to provide you a complete understanding on the wide range of possibilities of integrating your ParkIT into your system. The ParkIT series of cameras are specially developed and optimized for license plate reading (ANPR) applications while offering a great deal of flexibility to suit your special needs. The two main capabilities of the ParkIT camera are capturing images optimized for ANPR and forwarding them via a selected protocol to your application. The special hardware features, such as for example the built-in high power pulsed-infra LED illumination, or the extended I/O capabilities backed up with software developed with device integration in mind, such as the built-in hardware motion detector, ensure that the unit should fit into your system quickly and easy. The camera is equipped with a DSP-based intelligent processing core and with large internal memory for image buffering. This core is hosting a Linux operating system and an intuitive web based control interface. Image processing in the camera is divided among modules: each module is responsible for a specific task. The camera can be configured and used by communicating with these modules.
Page 4/58
SETTING ______________________________________________________________________________________
HWLAYER
[setup/profiles] Profile Manager [setup/users] Set Users and Groups [setup/network] Network Setup [setup/exit] Shutdown/Restart Manager [setup/hwmotdet] Hardware Motion Detection Parameter Manager [setup/time] System/Hardware Date and Time [setup/imagepar] Image Parameter Manager
FILE
IMAGE ________________________________________________________________________________________
SCAPTURE
[control/focuscontrol] Automatic Focus Control [control/zoomcontrol] Automatic Zoom Control [control/brightnesscontrol] Automatic Brightness Control
TRIGGER-UPLOAD ______________________________________________________________________________
TRIGGER
[trigger/eventman] Event Manager [trigger/swtrigger] Software Trigger [trigger/uarttrigger] UART Trigger [trigger/gpiotrigger] GPIO Trigger [trigger/scheduler] Scheduler Trigger
UPLOAD
UPDATE-MAINTENANCE _________________________________________________________________________
UPDATE
Page 5/58
Modules in bold text can be accessed and managed with camera commands as described in the following chapters. Other modules are intended for internal usage. To communicate with these modules, three methods are available: Through the web interface of the ParkIT camera by submitting the forms on the pages. For more information see ParkIT Users Manual. As HTTP requests e.g. in browsers address bar according to syntaxes detailed below. Through the PC API (for the C programming language) of the ParkIT camera (see PC API Description). The WEB interface is recommended for users, as it is very easy to use while the other methods are intended for programmers (C, C++ and HTML.) NOTE: For application development purposes, Mozilla Firefox is strongly recommended. In the following sections of this manual, the ParkIT camera modules and the ParkIT PC API are described.
Page 6/58
Page 7/58
Special parameters multipart=1 Both image and image data are transferred (multipart=0: image only) ajaxcall=1 Query/set data are displayed on the web interface (ajaxcall=0: can be save as file) cameraapi=1 Substitutes the multipart=1 parameter when communicating with the [setup/time] module.
Page 8/58
1. Introduction
The scapture/default module is responsible for the basic image capturing tasks detailed below. With the help of the module, it is possible to get camera images (in JPEG format) and to set and get image capturing parameters. Images returned by the camera have a parameter list attached. In this list, each value is listed twice: with and without the 'img' prefix. The parameter value with the 'img' prefix represents the value of the parameter at the time the image was captured, while the one without it represents the actual value. Steps of Image Processing: Image Processing Pipeline
Page 9/58
2. Image Sensor
Camera images are captured by the image sensor. This sensor can be color or B&W as described in the scolor (0=B&W, 1=color) property. Pixels are captured with 12-bit depth. The image sensor also has attributes describing the number of vertical and horizontal pixels (described in the xsize and ysize parameters). Image sensors include a boost circuit to increase the brightness of the camera image. The extent of this boost can be adjusted through the gain parameter. Note that the higher the gain value is, the noisier the images will be. To make the camera image brighter, the exposure time can also be used. This time defines the length of time during which the sensor is collecting light. It can be set in microseconds through the shutter parameter. The longer the image sensor collects light, the brighter the camera image will be. In case of high shutter values, motion blur effect may occur in case of rapid motions. The image capturing frequency of the sensor is defined in FPS (describing the number of captured Frames Per Seconds) and can be adjusted by the ifps parameter. The actual number of processed images can be adjusted with the Frame Limiter (see below). The following parameters depend on the type of the camera image sensor:
RO RO
gain
RW
RO RW RO
Page 10/58
3. Frame Limiter
In many cases, the speed with which the sensor captures images is too quick for image processing or it is unnecessary to operate the system at full speed (e.g. in case of parking facilities, 10 FPS is satisfactory). In these cases, the number of captured frames should be limited with the frame filter module that is capable of dropping frames from the incoming stream of from the sensor. When adjusting the number of dropped frames, it must be specified that after processing an image, how many should the module drop (ignore). The number of dropped images may vary between 0 and 15. If 0 is set, all images are forwarded (0 is dropped) while if 15 is set, the system drops 15 images after every processed one. The number of skipped frames can be set by the iskipframes property. E.g. iskipframes=3:
1 1
2 X
3 X
4 X
5 2
6 X
7 X
8 X
9 3
In the first row, the incoming frame indexes are enlisted, while in the second row, indexes of forwarded images are marked with green, indexes of dropped (ignored) images are marked with red.
iskipframes
imgframemonotimems imgframeindex
RW RW
4. Flash Driver
The flash module works with images filtered by the frame limiter. The flash control can be set to flash differently on images with odd/even frame index with the help of the flashmode property. (If the camera uses visible light for illumination, disturbing flashing (stroboscopic) effect may occur. To avoid this phenomenon, the flash1persec property can be used that defines the minimal number of flashes in one second. If there is no such phenomenon, then set this parameter to 0 to flash only at image capturing.)
Timestamp in ms-s counted from the Unix epoch 1970.01.01 0:00:00.00 +0000 UTC
Page 11/58
Parameters of Flashing
NOTE: Setting the flash mode is strongly recommended through the camera web interface: Setup/Advanced Setup/Flash Control. The camera can be set up to flash the illuminator on even/odd frames. Adjust flashing mode according to the followings: (0=turned off, one of the bits is 1 then turned on 0xF to make all of them available). 1. bit set to 1: emitting strobe signal to the illuminator on odd frames 3. bit set to 1: emitting strobe signal to the illuminator on even frames 4. bit: set to 0= even/odd frame differentiation is disabled set to 1= even/odd frame differentiation is enabled E.g. to flash all light sources continuously: enable the 1. and the 3. bits: 10102=1010 Delay of flashing on the built-in illuminator in milliseconds. This value can be negative as well. NOTE: This value is factory preset. Do not alter. Minimal number of flashes in one second on the built-in illuminator. It always flashes once on a strobe signal. By this parameter, the number of flashes on the illuminator in one second can be defined (it is divided equally). If it is 0 then only one flash will occur on a strobe signal.
flashmode*
RW
flash1delay*
RW
flash1persec*
RW
5. De-Bayer
This option is available only at color cameras. Most color sensors send images according to the so-called Bayer Pattern. The task of the De-Bayer module is to convert the pixels to the RGB color space. (During the conversion and further image processing tasks, calculating accuracy needed by the incoming 12bit accurate data exceeds the 24bit accuracy. To achieve better image quality, the algorithm uses weighted average calculation).
6. Color Correction
Pixels, converted to RGB are exposed to further image processing which includes the following procedures:
With the help of the whitebalance parameter, the gain of the individual color channels can be adjusted: the red, green and blue components can be enhanced (moved to positive direction) and reduced (moved to negative direction). As a result of such adjustments, shade of the image color can be altered. With the help of the contrast and saturation parameters, the corresponding values can be adjusted. The adjustment can be negative (minimum -1.0) or positive (maximum +1.0). In case of 0, no modification is executed. A further task of the color correction module is to convert the pixels from RGB to the YUV color space. This color space is appropriate for JPEG and H264 compressions and is suitable for the motion detector.
Page 12/58
7. Gamma Correction
The gamma correction enables to enhance dark pixels differently from bright ones. This kind of modification helps to render the details of dark image sections (more) visible. The characteristic of the gamma curve is described by a number between 0.2 and 6.0. Values below 1.0 result in reduction of dark sections, while values above 1.0 mean the extension of them. The value 1.0 does not have any affect on the image. The average used gamma is 1.6 while 2.2 is considered to be strong gamma correction. This value can be set by the gamma property. Camera image can be darkened or brightened with the help of the brightness parameter. This parameter equally alters dark and bright parts of the image. The value -1.0 results in the darkest image, while 1.0 results in the brightest value. The value 0.0 does not have any effect on the image. It may occur that not even the darkest pixel on the camera image is black. To solve this problem, the blacklevel property can be used. The value of this parameter may vary between 0.0 and 1.0 where 1.0 stands for 100%. Default value: 0.0. The whitest pixel on the camera image can be adjusted with the help of the whitelevel property. The value of this parameter may vary between 0.0 and 1.0 where 1.0 stands for 100%. Default value: 1.0.
Page 13/58
Parameters of Mirroring
smirrhoriz smirrvert RO RO 1: horizontal mirroring is enabled 0: horizontal mirroring is disabled 1: vertical mirroring is enabled 0: vertical mirroring is disabled 0: image rotation is disabled 90: camera image is rotated by 90 degrees 180: camera image is rotated by 180 degrees 270: camera image is rotated by 270 degrees
srotate
RO
9. Image Compressor
The image compressor is capable of converting the pixels into JPEG images or H264 stream. Note that not every camera model supports the H264 format. In case of JPEG compression, the quality of the images can be adjusted by the jpegquality parameter between 0 and 100 where 0 results in the smallest but poorest quality image and 100 means the best quality but largest image file. The default value is 75. Since good quality images can be created with 80, providing greater ones is not recommended to avoid increased bandwidth usage and disk space consumption. NOTE: The jpegquality parameter can be adjusted through the camera web interface by the Compress Rate option according to the following formula: jpegquality=100-Compress Rate, that means 0 is the best quality/largest file combination and 100 is the smallest file/poorest quality. Most of the enlisted properties are read-only and contain information related to the captured image.
imgchannel
RO
imgformat
RO
Page 14/58
jpegquality
RW
0 = Automatic 1 = RAW format 2 = JPEG (in case of imgchannel 0 and 2) 3 = BMP (in case of imgchannel 1 for creating grayscale images) 4 = H264 I_PCM frame (only in special cases) in case of imgchannel 1 5 = H264 (in case of imgchannel 0 and 3) NOTE: H264 compression is not available in every camera model. The quality of JPEG images can be set by this parameter (a number between 0 and 100). The higher this value is, the better the quality of the images will be. Default=75. NOTE: Images of better quality are greater in size therefore, they increase network load. Suggested values are between 60 and 80. used jpeg quality value when the image was captured. recommended file extension (string, e.g. .jpg) (read only) It returns the type of the data e.g. image/jpeg.
RO RO RO
mdspeed
RW
mdsensitivity
RW
mdrectsens
RW
mdoutimg
RW
Page 15/58
mdreslevel
RW
mddebug
RW
mdmask00 .. mdmaskFF RW
RO RO RO
imgmdresult
RO
imgmdsequence imgmdseqframe
RO RO
movement) 2 = bitmask (in which position has the motion detection been enabled) Motion limit. The extent of pixel changes above which the detected motion is handled as motion (it is not ignored). Suggested value: 20 This parameter is for testing the motion detector. 0 = no debug information appears on the minified image (default) 1 = areas included in the frame are marked with blue A so-called forbidding mask can be set for the motion detector to mark areas to be excluded from motion detection. The image is divided into 16x16 pixel blocks. For every block, a bit belongs. If an image cannot be divided by 256 then the bits in the last block do not count. Because of this e.g. in case of a 752x480 image 48x30 bit is stored instead of 47x30. If a bit is 1 that represents disabling, if 0 then it represents enabling (by default). The motion detector defines a frame within which motion detection is executed. The coordinates of this frame are represented by this read-only parameter according to the followings: imgmdwin=x1,y1,x2,y2 Difference against the background. It is executed on every block and it sums the absolute values of differences. Read only parameter. Motion value for the entire image based on the pixel changes. It is advisable to use this parameter for motion detection. Note that this parameter is read only. With the help of this parameter, it can be checked if there has been any motion on the given image or has not. Note that this parameter is read only. 0 = no motion has occurred 1 = motion has occurred Motion detection sequences have unique IDs. This ID is a read-only 32 bit counter. The number of frames within sequences is counted by this 32 bit counter and can be queried only.
If there are parts in the image in which motion should be ignored (for example traffic on another lane, on the sidewalk or just a tree on the side of the road blown by the wind), then this part should be masked out. Masks can be drawn most freely with the commands below.
mddraw
mdsavemask mdloadmask
Page 16/58
11. Analyzer
The analyzer module provides data for sharpness adjustment and brightness control to other modules. These data consist of the followings: Data for sharpness adjustment Data for brightness control (shutter, gain, iris)
capture
query{groupname}
Page 17/58
capture=last
http://192.0.2.3/scapture?capture=last It returns the last captured image. No other parameter is necessary for this query. Example to return the parameters of the last captured image: http://192.0.2.3/scapture?capture=last&multipart=1&ajaxcall=1
capture=next
It returns the frame that follows the last returned (queried) one. If this frame is not in the buffer anymore, (too much time has elapsed and it has been rewritten by newer images), it returns the oldest image from the buffer. The capture=next can be used by itself or together with the framemonotimems, imgframetimems and frameindex parameters: In these cases, frames, following the specified number/timestamp are returned (if they are still in the buffer): Examples: capture=next&framemonotimems=98741855 capture=next&imgframetimems=1337679820180 capture=next&frameindex=8390
Page 18/58
capture=best
It returns the frame that is closest (before or after) to the specified timestamp or frame index. If the buffer does not contain such a frame, the oldest one is returned. If the specified timestamp (framemonotimems, imgframetimems) or frameindex value is too high (refers to a yet non-existing frame) then the newest frame from the buffer is returned. Examples: capture=best&framemonotimems=106964188 capture=best&imgframetimems=1337695009069 capture=best&frameindex=193390 For more information on handling the above parameters through the ARHIP PCAPI, see PCAPI description.
13. Properties
By default, the system does not return all the properties together with images. If we need to query the remaining properties, then the get prefix must be used before the name of the property. Validity limits of properties can be queried with the query prefix. get{propertyname}=1 query{groupname}=1 Getting the value of the property Querying specific boundary groups or possible value(s) seen below. In case of returning boundaries, the returned values are as follows: [min. value], [max. value], [default value] Queryable parameters and groups
Groupname
Returned value
boundimgchannel 0,1,0 0 jpg listimgformat listfileext listcapture boundimgframetimems
Sample value
modefmt
next,last,best,local 0,18446744073709551615,0 0,4294967295,0 0,4294967295,0 752 480 60.0,50.0 0,15,0 0,1 0,1 0.25,4.0,1.0
frame
imgsize
Page 19/58
boundshutter boundgamma boundbrightness boundsaturation boundcontrast boundjpegquality boundwhitebalance boundcmatrix paramadv boundcyuvadd boundblacklevel boundwhitelevel boundflashmode flash boundflash1delay boundflash1persec gpi boundgpifreq boundgpidebounce mdmode boundmdspeed boundmdsensitivity md boundmdrectsens boundmdoutimg boundmddebug boundmdreslevel listsmirrhoriz smirrot listsmirrvert listsrotate
31.25,15000,1000 0.2,6.0,1.0 -1.0,1.0,0.0 -1.0,1.0,0.0 -1.0,1.0,0.0 0,100,80 -1.0,1.0,0.0 -127.0,127.0,0.0 -127.0,127.0,0.0 0.0,1.0,0.0 0.0,1.0,1.0 0,31,31 -1000.0,1000.0,0.0 0,200,0 1,250000,25 1,255,5 1,3,3 0,100,75 0,100,75 0,100,75 0,3,1 0,1,0 0,255,50 0,1,0 0,1,0 0,180,0
Example:
Query: http://192.0.2.180/scapture/default?querydata=1 Answer: listgetframe=0,1 listgetmcount=0,1 It is necessary to make a single connection capable of querying an image and its data in two separate queries. In this case, the web server has to assign the opened channels to the HTTP session.
Page 20/58
1. Introduction
With the help of this module, formatted time and date values can be queried from the camera. NOTE: When communicating with the setup/time module, the cameraapi=1 parameter must be used instead of the multipart=1.
where the first line is the formatted time (specified with $a, $d $h $Y $T GMT $Q) and the rest of the values are always returned by the module. These values contain the following information (separated by enter-s): a_localtimems: local timestamp in milliseconds counted from the Epoch: 1970-01-01 00:00:00 +0000 UTC. a_monotimems: Time elapsed since camera startup in milliseconds. a_tzcode: code of the local time zone a_year: year of local time a_month: month of local time a_day: day of local time a_hour: hour of local time a_min: minute of local time a_sec: second of local time a_ntp: returns whether NTP synchronization is turned on or not. a_ntpip: IP address of the NTP server In order to configure the content and structure of the returned time information (first line of the answer), the following arguments can be used:
Arguments are the same as the strftime functions usable in C++ except the Q.
Page 21/58
Description
The abbreviated weekday name according to the current locale. The full weekday name according to the current locale. The abbreviated month name according to the current locale. The full month name according to the current locale. The preferred date and time representation for the current locale. The century number (year/100) as a 2-digit integer. The day of the month as a decimal number (range 01 to 31). Equivalent to %m/%d/%y. Like %d, the day of the month as a decimal number, but a leading zero is replaced by a space. Modifier: use alternative format, see below. Equivalent to %Y-%m-%d (the ISO 8601 date format). The ISO 8601 week-based year with century as a decimal number. The 4-digit year corresponding to the ISO week number (see %V). This has the same format and value as %Y, except that if the ISO week number belongs to the previous or next year, that year is used instead. Like %G, but without century, that is, with a 2-digit year (00-99). Equivalent to %b. The hour as a decimal number using a 24-hour clock (range 00 to 23). The hour as a decimal number using a 12-hour clock (range 01 to 12). The day of the year as a decimal number (range 001 to 366). The hour (24-hour clock) as a decimal number (range 0 to 23); single digits are preceded by a blank. (See also %H.) The hour (12-hour clock) as a decimal number (range 1 to 12); single digits are preceded by a blank. (See also %I.) The month as a decimal number (range 01 to 12). The minute as a decimal number (range 00 to 59). A newline character. Modifier: use alternative format, see below. Either "AM" or "PM" according to the given time value, or the corresponding strings for the current locale. Noon is treated as "PM" and midnight as "AM". Like %p but in lowercase: "am" or "pm" or a corresponding string for the current locale. millisecond part of the current time (3 digits) The time in a.m. or p.m. notation. In the POSIX locale this is equivalent to %I:%M:%S %p. The time in 24-hour notation (%H:%M). For a version including the seconds, see %T below. The number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). The second as a decimal number (range 00 to 60). (The range is up to 60 to allow for occasional leap seconds.) A tab character. The time in 24-hour notation (%H:%M:%S). The day of the week as a decimal, range 1 to 7, Monday is 1. See also %w. The week number of the current year as a decimal number, range 00 to 53, starting with the first Sunday as the first day of week 01. See also %V and %W. The ISO 8601 week number of the current year as a decimal number, range 01 to 53, where week 1 is the first week that has at least 4 days in the new year. See also %U and %W. The day of the week as a decimal, range 0 to 6, Sunday is 0. See also %u. The week number of the current year as a decimal number, range 00 to 53, starting with the first Monday as the first day of week 01. The preferred date representation for the current locale without the time. The preferred time representation for the current locale without the date. The year as a decimal number without a century (range 00 to 99). The year as a decimal number including the century. The +hhmm or -hhmm numeric time zone (that is, the hour and minute offset from UTC). The time zone or name or abbreviation. The date and time in date(1) format. A literal '%' character.
Page 22/58
1. Manual Method
Select the manual method by setting the mode parameter to 0. After that, the following parameters can be used to adjust the zoom. Parameter name mode zoom Mandatory yes RO/RW RW Valid values 0: manual zoom 1: automatic (ZFG) [zoom_min..zoom_max] integer integer Description mode of zooming to zoom to a specified position to query the minimal zoom position of the camera to query the maximal zoom position of the camera value of zoom in percentage
no
RW
zoom_min
no
RO
zoom_max
no
RO
integer
zoom_pc
no
RW
[0..100]
NOTE: Minimum, maximum and default values of zoom and zoom_pc can be queried by queryzoom and queryzoom_pc. Values are returned as: {minimum value}, {maximum value}, {default value}. Sample query: http://192.168.2.235/control/zoomcontrol?queryzoom&ajaxcall=1 Sample answer: boundzoom=0,90,-1 (-1 refers to a non-existing value).
2. Automatic Method
In automatic mode, the camera calculates the best zoom position (so that the pixel size of the license plate will correspond to the set char_pxl value) based on the ZFG parameters provided by the user (certain requirements and constraints can be specified as well). Moreover, the camera is capable of setting the appropriate LED power and flashing time as well, for the above set parameters. Requirements of automatic zoom set the mode parameter to 1 provide all of the following parameters:
Page 23/58
RW RW RW
NOTE: Legal values of the above parameters depend on the ANPR environment. Combinations, which describe physically impossible parameters, are rejected.
After setting the ZFG parameters, the camera adopts the best zoom value and calculates additional information can be queried by the user. These read-only parameters provide useful information for camera installment and operation:
Page 24/58
3. Parameter Sets
The default parameter set is updated after a complete and valid request has sent to the module. If a parameter set is invalid, the module sends back detailed description of the error and the list of the invalid parameter names. If a parameter set is incomplete, the module sends back the default parameter set.
4. Errors
In case of invalid parameters, the detailed description of the error is sent back in the estr parameter and the names of the invalid parameters are listed in "eparam". These special parameters (estr and eparams) cannot be queried directly.
Page 25/58
1. Manual Method
Select the manual method by setting the mode parameter to 0 then set the focus manually by the focus parameter within the boundaries of focus_min and focus_max values.
2. Autofocus
When using autofocus, focusing is controlled entirely by the module (no manual adjustments are possible). After auto focusing, the module switches back to manual mode (in case of both a successful and an unsuccessful focusing). Progress of autofocus can be queried anytime through the progress parameter.
** Camera model (optics and sensor) dependent properties. NOTE: Using the same ROI coordinates at zoom and focus is recommended. NOTE: The coordinates of the ROI must be set according to the resolution of the camera. E.g. 752x480.
The auto-focusing algorithm waits for stable brightness while the autobrightness function is running on the camera. During this waiting process, the automatic focus control is in paused mode (mode=2). As soon as the brightness is stable, the module switches back to auto mode and starts the auto-focusing process.
Page 26/58
4. Parameters
Parameter name RO/RW Valid values Description mode of focusing 0: manual 1: auto 2: paused (can not be activated by users but the system only) focus position minimal focus position maximal focus position [1..100] [0..100] progress of the autofocus represented in percentage focus position in percentage
mode
RW
[0,1,2]
RW R R R RW
[focus_min..focus_max]
** Camera model (optics) dependent properties. NOTE: Minimum, maximum and default values of focus and fous_pc can be queried by queryfocus and queryfocus_pc. Values are returned as: {minimum value}, {maximum value}, {default value}. Sample query: http://192.168.2.235/control/focuscontrol?queryfocus&ajaxcall=1 Sample answer: boundfocus=0,90,-1 (-1 refers to a non-existing value).
5. Errors
In case of invalid parameters, the detailed description of the error is sent back in the estr parameter and the names of the invalid parameters are listed in eparam. These special parameters (estr and eparams) cannot be queried directly.
Page 27/58
1. Manual Mode
In manual mode (mode=0), the gain, shutter and iris can be adjusted separately between the boundaries returned by the module. Values are represented according to the followings: gain - in percentage or decibel, depending on the camera model shutter - in microseconds iris - position iris_pc - in percentage
NOTE: Although, gain and shutter adjustment can also be executed through the scapture/default module, setting these values is strongly recommended through the Brightness module.
2. BrightNow!
Use the BrightNow! function for single, quick and simple adjustments. Send mode=3 and a target value (see below) to the brightness module then the function executes a quick but less accurate adjustment which will end in couple of steps (this mode will not engage again until started manually). After this, the previously set mode is activated. NOTE: Always send the target first, or together with the mode in order the avoid malfunction.
3. Automatic Mode
For automatic brightness adjustment, the following strategies are available: Overview strategy (for overview camera purposes), mode=1 ANPR strategy (for ANPR purposes), mode=2 Quick strategy (for quick adjustment), mode=4 Common features of strategies All the three strategies receive brightness target value from the user between -100 and 100. When a target value is set, the strategies set shutter, iris and gain automatically to reach and to maintain this value executing continuous adjustment on brightness changes. This value can be adjusted according to the figure below and is used mutually by the strategies so it is sufficient to provide it for one.
For all strategies, the boundaries and step values can be set for gain, shutter and iris respectively. Day and night configuration settings can also be provided for each strategy containing the previously mentioned boundaries and steps. The strategies switch between day and night modes automatically with the help of the camera light sensor. Both the actual value of the light sensor and the current strategy can be queried from the module (0 stands for day mode, 1 for night mode). Note that currentset cannot be queried if the brightness control mode is manual. Boundaries (minimal and maximal values) and current values can be queried anytime regardless the controlling mode.
Page 28/58
4. Module Parameters
Name mode gain gain_min1 gain_max1 shutter shutter_min1 shutter_max1 iris iris_pc iris_min1 iris_max1 target current_set light_sensor RO/RW RW RW RO RO RW RO RO RW RW RO RO RW RW RO [-100..+100] integer [0,1] [iris_min..iris_max] [0..100] [shutter_min..shutter_max] Valid values [0,1,2,3,4] [gain_min..gain_max] Description controlling strategy value of gain in percentage minimal value of gain in percentage minimal value of gain in percentage value of shutter in secs minimal value of shutter in secs maximal value of shutter in secs iris position iris value in percentage minimal iris value maximal iris value target brightness value for strategies to set and maintain day (0) or night (1) configuration (only if autobrightness is on) value of the light sensor State of the brightness controller. 1: stable (target is reached) [0,1,2] 2: working (to reach the target) 3: unreachable (the target can not be reached with the current light conditions) returns histogram values in numeric format: 256 pcs. of comma separated 0.-255. values represent the cardinality of the integers between 0 and 255 given grayscale pixel intensity normalized to 100. where X stands for the highest 256. value represents the average pixel intensity. pixel intensity appearing on the screen
state
RO
histogram
RO
Camera model (optics) dependent properties, query these parameters to get their values.
NOTE: Minimum, maximum and default values of iris, shutter and gain can be queried by queryiris, queryiris_pc, queryshutter and querygain. Values are returned as: {minimum value}, {maximum value}, {default value}. Sample query: http://192.168.2.235/control/brightnesscontrol?queryiris&ajaxcall=1 Sample answer: boundiris=0,47,-1 (where -1 refers to a non-existing value).
Page 29/58
5. Operation of Strategies
NOTE: It may take seconds to minutes for the current strategy to settle depending on its settings.
6. Errors
In case of an inappropriate parameter sending, the description of the error will be in the estr answer parameter. These special answer parameters (estr and eparams) cannot be queried directly.
NOTE: Values will be applied after saving settings and quick restart of the camera.
Page 30/58
Scheduler Trigger
[trigger/scheduler]
1. Introduction
With the help of this module, it is possible to schedule trigger events. On these events, certain tasks can be executed (e.g. uploading files to an FTP server).
2. Basic Parameters
Name Mandatory Values Description on which day(s) of the week should the timer be active example: wday=tue where day_1 < day_2: wday=tue-sat example: wday=wed;sun example: wday=every on which day(s) of the month should the timer be active example: day=23-31 example: day=1;3;31 example: day=every in which hour(s) of the day should the timer be active example: hour=8 example: hour=0;5;10 example: hour=every in which minute(s) of the hour should the timer be active example: min=1 example: min=15;23;42 example: min=every in which second(s) should the timer be active example: min=1 example: min=15;23;42 example: min=every example: output=1 returns the number of scheduler outputs Edge controlled or level controlled timer. level: level controlled (see below) edge: edge controlled (see below) Enabling or disabling a scheduler trigger
wday
yes
day
yes
hour
yes
min
yes
[0-59] [0;1;2;...] [every] [0-59] [0;1;2;...] [every] [0-(noutputs-1)] [uint] [level,edge] [true,false]
Query example: http://192.0.2.45/trigger/scheduler?output=0&gethour Example for setting: http://192.0.2.45/trigger/scheduler?cmd=init&output=0&enabled=true&drive=edge&w day=mon-fri&day=1-31&hour=8-20&min=every&sec=every NOTE: Accepted parameters are saved to the configuration file and will be applied at the next startup.
Page 31/58
getparams
{ip_address}/trigger/scheduler? getparams&output=1
http://192.0.2.33/trigger/ scheduler?output=1&getparams
3.2 Level controlled trigger signals on the other hand are always last for a period according to the followings:
If sec!=0-59 23:12:12.000 23:12:12.999 If sec=0-59 and min=0-59 23:00:00.000 23:59:59.999 If sec=0-59 and min!=0-59 23:12:00.000 23:12:59.999
So, if the timer uses level control then: if not every second is active (If sec!=0-59) then startms = start of the second, endms = 999 msecs later if every second and every minute is active (If sec=0-59 and min=0-59 ) then startms is the first msec of the hour while endms is the last msec of the hour if every second is active (If sec=0-59 and min!=0-59) then startms is the first msec of the minute while endms is the last msec of the minute
4. Errors
In case of invalid parameters, the module returns the following: estr=Invalid parameter eparams= {invalid parameters separated by colons}
Page 32/58
Upload Manager
[upload/uploadman]
1. Introduction
With the help of the upload/uploadman module, a protocol can be selected (FTP, SMTP or HTTP POST) via which image, image data (sent by the Event Manager) and trigger information will be forwarded from the camera. For sending trigger information, see Event Manager Description. Names of uploaded files can be specified in the filenametemplate parameter, image data is uploaded in text files of the following form: filenametemplate.params.txt
2. Parameters
General Parameters (for every protocol) Name cmd method Mandatory yes yes Values [init] [ftp,smtp,post] Description initializing protocol selecting protocol e.g. method=ftp returns the actual protocol: 0: FTP 1: SMTP 2: HTTP POST type of data to be sent; if not set then both image and image data are uploaded (data=0)
currentmethod
no
data
no
Parameters for the HTTP POST Protocol Name url filenametemplate Mandatory yes yes Values [text] [$y,$r,$o,$d,$h,$m,$s,$l,$t,text] $y: year (4 characters) $r: year (2 characters) $o: month $d: day $h: hour $m: minute $s: second $l: millisecond $t: frametimems $i: motion sequence ID (hexadecimal number) $x: frame index within a sequence (hexadecimal number) text: string Description web server address
definition of arguments
Filename template example: filenametemplate=$y-$o_$d-text-$d$m-text-$s-$l.JPEG Results in e.g. 2011-01_01-text-0113-text-12-123.JPEG Example: specifying parameters for HTTP POST protocol
cmd=init&method=post&url=testserver/index.php&filenametemplate==$y/$o_$d/text-$d$mtext-$s-$l.JPEG&data=1
Page 33/58
NOTES: it is not mandatory to use all of the arguments it is possible to use an argument at more places in the same command it is advisable to specify the extension of the file (as text)
Description FTP server address FTP account username FTP account password see above
NOTE: Setting the username and password are not mandatory. User name and password is stored in the camera unencrypted.
Description SMTP server address SMTP account username SMTP account password see above sender of the e-mail recipient(s) of the e-mail
NOTE: Setting the username and password are not mandatory. User name and password is stored in the camera unencrypted.
Page 34/58
Information Commands (to query previously set parameters) Name Mandatory Values Description The set FTP parameters. Returned values:
url= filenametemplate= username= password= curltimeoutms= data= currentmethod=
getftpparams
no
Returns SMTP parameters. Returned values: url= filenametemplate= from= to= curltimeoutms= data= currentmethod=
getsmtpparams
no
getpostparams
no
cmd
no
[getlog]
returns HTTP POST parameters: url= filenametemplate= data= currentmethod= returns logging data in the dataset section of the answer
Fields are separated by commas while records are separated by semicolons. Sample record:
0,02/02-01-25-25-972.JPEG,0,0,No error;0,02/02-01-25-45-175.JPEG,0,0,No error;
Description of variables: var_1 : upload method var_2 : filename var_3 : type of uploaded data var_4 : success of uploading var_5 : error string [0,1,2,3] <=> [ftp,smtp,http post,invalid] [0,1,2] <=> [image+data,image,data [0,1,2] <=> [OK,failed,image ok + data failed] [No error, or error message]
4. Errors
In case of invalid parameters, the module returns the followings: estr=invalid parameter eparams= invalid parameters separated by colons
Page 35/58
Event Manager
[trigger/eventman]
1. Short Description
The Event Manager monitors the state of multiple trigger sources (such as Hardware Motion Detector or GPIO input), evaluates a user defined logical conjunction between these trigger source states and depending on the result of this evaluation initiates the uploading of a sequence of images. The Event Manager also implements image and trigger buffering, thus it offers greater flexibility with trigger timing.
2. Detailed Description
2.1 Trigger Inputs and Master Output
The Event Manager can be imagined as a combinatorial logic network with multiple inputs and a single output. The inputs and the output may be either asserted or not asserted. The output becomes asserted if the inputs are asserted in such a combination, that the user defined logic expression (formula, see below) evaluates to 'true'. The inputs are labeled with capital letters from A to U (V-Z are reserved).
2.2 Registering
The inputs can be assigned to various trigger sources. This process is called registering. If a trigger source has multiple outputs, it can be assigned to different inputs of the Event Manager.
2.3 Formula
The trigger control formula of the Event Manager can be defined by using the capital letters and the logic symbols defined below. The shorthands 'each' for AND-ing all the inputs, or 'any' for OR-ing all the inputs can be used. The following logic symbols can be used: - & (web interface) or * (URL) for AND - | (web interface) or + (URL) for OR - ! for NOT - ( and ) for bracketing Valid formulas are for example: - A&B&C (Web interface) - (A+B)*C (URL) -A - A&!B (Web interface) NOTE: Spaces are not allowed in formulas.
Page 36/58
3.1 Commands
Command
register
Format
cmd=register&module_name= [Module name]&output=[Output index]&input=[Input index] cmd=freeinput&input=[Input index] cmd=setformula&formula=[Logic expression] cmd=start
Example
cmd=register&module_name= trigger/swtrigger &output=0&input=D cmd=freeinput&input=D cmd=setformula&formula= (D+A)*B cmd=start
Description
registers the module's given output to the given input unregisters the module registered at the given input sets the logic expression the Event Manager evaluates starts the Trigger Action process of the Event Manager stops the Trigger Action process of the Event Manager resets the Event Manager returns the current configuration of the Event Manager. The answer is a semicolonseparated list of entries in the format of [Module name]/[Output index]: [Input index] returns the current formula of the Event Manager returns all available trigger sources
freeinput
setformula
start
stop reset
cmd=stop cmd=reset
cmd=stop cmd=reset
getconfig
cmd=getconfig
cmd=getconfig
getformula getsources
cmd=getformula cmd=getsources
cmd=getformula cmd=getsources
Page 37/58
3.2 Parameters
Parameter name
send_trginfo
Mandatory
no
Values
[0,1]
Description
0: trigger information is included 1: trigger information is not included
If send_trginfo is set to 1 then a .trg file is uploaded together with images, data or both. This file includes the following information:
Trigger Information
output startms endms index upload_type cmd fileext source output of the trigger source Note that different outputs of the same source are marked with different frame indexes. trigger start time trigger end time trigger index (images of a trigger have the same index) type of the upload task to be executed on the trigger extension of the trigger information file source (sender) of the trigger event
Information provided by trigger information is intended to determine that which images belong to the same trigger (with the help of the index).
Page 38/58
Software Trigger
[trigger/swtrigger]
1. Short Description
The Software Trigger module serves as a user-triggerable trigger source.
2. Detailed Description
A trigger signal can be sent to the Event Manager (see above) from user applications or from the web interface using this module.
3. Parameters
The software trigger module has the following parameters: Name noutputs cmd RO/RW RO W Mandatory no yes Legal values [uint] [sendtrigger] Description returns the maximum number of software trigger outputs sends a trigger to the Event Manager, use with the parameters that follow trigger data included in the image parameters (.par file); BASE64 encoded, URL pre-coded characters remain e.g. '%22' Suitable for logging information from serial port to images. trigger start timestamp trigger end timestamp the value to be added to the trigger start timestamp the value to be added to the trigger end timestamp specifies the selected output
trigger_data
RW
no
W W RW RW
no no no no
output RW yes [0-(noutputs-1)] *If not specified, the actual system time is used. Example:
http://192.0.2.20/trigger/swtrigger?cmd=sendtrigger&output=0&startms= 1336744931805&endms=1336744931905&trigger_data=[NTIuMTsxMzM2Ow0K] Trigger data containing multiple traffic sensor information explanation: Encoded: 'NTIuMTsxMzM2Ow0K' (0x35 0x32 0x2E 0x31 0x3B 0x31 0x33 0x33 0x36 0x3B 0xD 0xA) Decoded 12 bytes: '52.1;1336;' where: vehicle height in inches: 52.1, vehicle weight in kilograms: 1336 NOTE: To provide vehicle height and weight information, special external devices are (sensors) necessary.
Page 39/58
GPIO Trigger
[trigger/gpiotrigger]
1. Short Description
The GPIO Trigger module provides user access to the GPIO facility of the device, and serves as a trigger source.
2. Detailed Description
Users can access the General Purpose In and Outputs (GPIO) of the device through the GPIO Trigger Module. Users can set the GP output and get the GP input of the device by issuing an HTTP command. This module also serves as a trigger source relaying trigger signals from the GP input to the Event Manager. The duration of the relayed trigger signal can be extended by the module by adding a predefined value to the timestamps of the trigger signal received on the input.
3. Parameters
The trigger/gpiotrigger module has the following parameters: NOTE: When querying parameters, the output must be defined. Otherwise, data of the 0 output are returned. Name output noutputs setoutput prems postms samplerate_hz RO/RW RW RO RW RW RW RW Mandatory yes no no no no no Legal values [0-(noutputs-1)] uint [0,1] [-1000-1000] [-1000-1000] [1-1000] Description specifies the output; If not defined, 0 is used Get the number of outputs (of the trigger source). Set the GP Output of the device to the value. the value to be added to the trigger start timestamp the value to be added to the trigger end timestamp the sample rate with which the GP input is sampled* Drive of the trigger signal. For more information see Scheduler. 0: level 1: rising 2: falling the logic level of the input can be inverted (0 - active high, 1 - active low). the current status of the GP input can be queried by this parameter: 0: no signal 1: active level -1: invalid value NOTE: The default value is -1 (until the first signal arrives). *Use the lowest possible sample rate to avoid bouncing of the input.
edge
RW
no
[0,1,2]
invert
RW
no
[0,1]
input
RO
no
[0,1,-1]
Page 40/58
UART Trigger
[trigger/uarttrigger]
1. Short Description
UART Trigger monitors the user UART of the device for trigger signals and relays these to the Event Manager.
2. Detailed Description
UART Trigger monitors the user UART of the device for arriving data, and if these correspond to a user specified byte sequence, then sends a trigger signal to the Event Manager. The duration of the relayed trigger signal can be extended by the module by adding a predefined value to the timestamps of the trigger signal received on the UART.
3. Parameters
The UART Trigger module has the following parameters: Name output noutputs prems postms RO/RW RW RO RW RW Mandatory yes no no no Legal values [0-(noutputs-1)] uint [-1000-1000] [-1000-1000] Description specifies the output get the number of outputs (of the trigger source) the value to be added to the trigger start timestamp the value to be added to the trigger end timestamp Drive of the trigger signal. For more information see Scheduler. 0: level 1: rising 2: falling UART Baud rate (standard values) UART byte size UART parity (1 - use, 0 - do not use) UART number of stop bits trigger start byte value (256 means the first byte is the start byte regardless the byte value) trigger end byte
edge
RW
no
[0,1,2]
RW RW RW RW RW RW
no no no no no no
Page 41/58
1. Short Description
This module provides access to some of the camera peripherals, such as the built-in LED light source, diagnostic values (temperature, light sensor, etc.), direct access and calibration of the motorized optics, etc.
2. Detailed Description
The module provides access to the following groups of peripherals, which are detailed below: Built-in LED light source Motorized optics and filter switching unit Diagnostics
Safe Voltage/FPS Limits Voltage FPS 10 12 15 20 30 50 60 Low 950 s* 950 s* 950 s* 950 s* 950 s* 600 s 600 s Normal 950 s* 950 s* 950 s* 950 s* 800 s 400 s 400 s High 950 s* 950 s* 800 s 600 s 400 s 200 s 200 s
* 950 sec= max. allowed LED impulse width LEDs can be turned on/off by using the leden parameter (1 - on, 0 - off ).
Page 42/58
2.3 Diagnostics
Through diagnostics, the following diagnostic values and controls can be accessed: camera temperature (Celsius scale) light sensor value (0-255) green status LED to display status
3. Parameters
Built-in light source Name leden ledpwr* ledtimeus* led_pcdose led_diff_en ledtimeus2 RO/RW RW RW RW RW RW RW Legal Values [0,1] [0,1,2] [5-950] [0-100] [0,1] [5-950] Description 0 - disables built in light source,1 enables it LED power: 0 - low, 1 - medium, 2 - high LED flash pulse length in microseconds LED illumination value in percentage 1- enabling, 0-disabling Frame Parity Flashing flashing time in seconds on odd frames NOTE: It is valid only if led_diff_en=1! illuminating value for odd frames represented as a percentage of the led_pcdose value used on even frames. -1: frame illumination difference is disabled (it has the same effect as led_diff_en=0)
Page 43/58
led_diff_pc
RW
[0-100], -1
Motorized optics and Filter Switching Unit Name iris_pos iris_pc iris_min iris_max iris_moving focus_pos focus_pc* focus_min focus_max focus_moving zoom_pos zoom_pc* zoom_min zoom_max zoom_moving calibrate filter iris focus zoom Name overdrive temperature lightsensor status_g RO/RW RW RW RO RO RO RW RW RO RO RO RW RW RO RO RO RO RW RO RO RO RO/RW RO RO RO RW Legal Values [*] [0-100] [uint] [uint] [0,1] [*] [0-100] [uint] [uint] [0,1] [*] [0-100] [uint] [uint] [0,1] [0-100] [0,1] [uint] [uint] [uint] Legal Values [0,1] [uint] [0-255] [0,1] Description Iris position in steps (* between iris_min and iris_max) Iris position in percentage (if queried, it returns limits for iris (percentage)) Iris minimum position (steps) Iris maximum position (steps) 1 if iris is moving focus position in steps (* between focus_min and focus_max) focus position in percentage focus minimum position (steps) focus maximum position (steps) 1 if focus is moving zoom position in steps (* between zoom_min and zoom_max) zoom position in percentage zoom minimum position (steps) zoom maximum position (steps) 1 if zoom is moving progress of calibration (if running) status of filter switcher: 0 - IR cut, 1 all pass returns limits for iris (steps) returns limits for focus (steps) returns limits for zoom (steps) Description 1 if LED protection is active camera temperature (Celsius) light sensor value 1 - green status LED is on
Diagnostics
Page 44/58
Logging
[logging/logstream]
1. Short Description
Camera events are logged into the central log file for administrative and error management purposes. The lines (records) of the log can be filtered for specific events according to the specified characters. Note, that the log file content is erased after restarting the camera. The log file can be saved and returned by the following command:
http://{IP address}/logging/logstream?getlog&ajaxcall=1
http://{IPaddress}/logging/logstream?filter={stringtofind}&ajaxcall=1
Previously set filter can be queried as follows:
getfilter
setfilter
Page 45/58
Backup System
[backup/default]
1. Short Description
With the help of the Backup module, various settings of the camera can be saved into a .tar.gz archive. After saving, this file can be uploaded to other ParkIT cameras. The following functions are available on the camera web interface as well by the Export profiles, Export profiles, users and groups and Export all buttons. For creating backup file with the help of the ARHIP PCAPI, see ARHIP - PCAPI description.
2. Module Parameters
Name pipe mode Mandatory yes no Legal Values [1] int[1..31] Description specifying pipe for the backup process it specifies the data to be saved: 1: Saving one profile only. This profile can be specified with the profile (see below) parameter. If not specified, the default profile is saved. 2: Saving all profiles that the user have access for. 4: Saving users, groups and passwords NOTE: This mode includes saving the root password as well! 8: Saving reserved memory area. Note that this area is empty by default. 16: Saving network and time settings (parameters of the Network and Date and Time tabs). NOTE: Saving various functions can be combined by simply summing their parameter values. E.g. mode=20 equals to 16+4 and means saving users, groups, passwords, network and date and time settings. NOTE: this parameter can be used only if mode=1; it specifies the name of the profile to be saved
profile
no
[string]
http://{IP address}/backup/default?pipe=1&mode={value} Sample #1: Saving users, groups and passwords http://192.0.2.170/backup/default?pipe=1&mode=4 Sample #2: Saving a profile named profile1 http://192.0.2.170/backup/default?pipe=1&mode=1&profile=profile1 Sample #3: Saving all profiles, users, groups, passwords, date and time settings http://192.0.2.170/backup/default?pipe=1&mode=22
Page 46/58
System Update
[update/default]
1. Short Description
With the help of the Update module, backup settings saved by the Backup module or factory backup configurations can be uploaded to the camera. This function is available on the camera web interface (Update tab) as well on the. NOTE: Uploading backup settings cannot be executed from a browsers command line (URL).
Page 47/58
Returned values: If negative then error occurred. The error code is included. If 0 or any positive number then the handle is returned, this handle has to be passed to the other functions.
Opening a Stream
int arhip_openstream(const char *host); Parameters: host: Link to the device that can be a hostname, IPv4 or IPv6 address and port. Port can be specified after a colon. IPv6 addresses have to be enclosed in square brackets (as in browsers). Examples: IPv4: http://10.0.0.1:80 IPv6: http://[2001:4860:0:2001::68]/ The default port is 9901. Returned values: If negative then error occurred. The error code is included. If 0 or positive then the handle is returned which has to be passed to the other functions.
Page 49/58
Page 50/58
Before sending a query, the following fields must be set: modtypeandname: The type and name of the module. It is not URL coded, the accepted characters are '/' plus the alphanumeric characters. It must be a standard '\0' terminated string and must be set according to the following template: 'moduletype/modulename' or 'path/filename' (do not begin with '/'). Setting this field is mandatory; its maximal length is 128 bytes. sessionid: The identifier of the session. If it is not 0 then a new session will open (default session ID is 0). param: Parameter string. Parameters have to be defined as follows: name=value. Note that every parameter must be set in separate lines (1 parameter/1 line, separated by '\r\n'). These lines will be parameter/1 line). These lines will be URL encoded except the following characters: - _ . ~ = and ,. Note that this field cannot be NULL but empty string only. Its maximal length is 3072 bytes. data: Data to be sent. If not used, it must be set to NULL. datalen: Length of data in bytes. Values between 0 and 32768 (32 Mbytes) are valid. filename: This filename will be used at upload when sending data. Its maximal length is 64 characters. If no filename is set then the default file name 'apidata.dat' is used. If the field is not used it must be set to NULL. (E.g. when sending a file to the update/default module this field will contain the name of the file while the data will contain the bytes of the file. Structure of the answer: struct ARHIP_ANSWER { char *param; void *data; int datalen; void *exdata; int exdatalen;
};
Before calling the function, this structure has to be filled with zeros with the memset function. After the answer has been processed, call the arhip_freeanswer function to free memory allocated by the arhip_iterate function in the answer. param: Returned ASCII string parameters. These parameters are stored separately (one line/one parameter, separated by \r\n) as follows: name=value. It can be NULL if there are no parameters. data: Returned data. It can be NULL if there is no data. It is e.g. a JPEG image. datalen: Length of data in bytes. exdata: Returned extra data. It can be NULL if there is no data. It may contain extra image data. Such data are e.g. a histogram, motion detection or DCT information, etc. exdatalen: Length of extra data in bytes.
Page 51/58
Sending a query for the device and requesting the answer: int arhip_iterate(int handle, struct ARHIP_QUERY *query, struct ARHIP_ANSWER *answer, int timeoutms); Parameters:
handle: Channel opened by the arhip_connect function. query: The query has to be passed in this parameter. answer: This parameter will contain the answer. timeoutms: Maximal waiting time for answer and sending.
Returned values: If negative then error occurred. The error code is included. If 0 or any positive number then the function was successful. If the data, received from the server, contains any error (HTTP protocol error) then the arhip_iterate() function returns with the EINVAL (22) error code. If a query that the server cannot answer any content arrives, (non-existing file or module, or the module cannot create answer data) then 404 is returned in the parameter field of the ARHIP_ANSWER structure.
Page 52/58
Page 53/58
Page 54/58
Page 55/58
// querying another image follows snprintf(s_last,sizeof(s_last),"capture=best=%llu=1", frtm-2000); //querying the image captured closest to the time (timestamp) 2 seconds before the image saved first in this program qpr.param=s_last; memset(&apr,0,sizeof(apr)); ec=arhip_iterate(connected, &qpr, &apr, 1000); // sending the query and requesting for the answer if(ec>=0){ if(apr.data && apr.param ){ // if there is any returned data (image) parse_vals(apr, &frtm); // processing } arhip_freeanswer(&apr); } else{ perror("arhip_iterate() "); } arhip_disconnect(connected); //disconnecting } else{ perror("arhip_connect()"); } arhip_cleanup(); //closing ARHIP PCAPI getchar(); return 0; } void parse_vals(struct ARHIP_ANSWER answ, unsigned long long* frtm ) { const char* m_frtm="imgframetimems="; const char* m_frix="imgframeindex="; const char* m_frmo="imgframemonotimems="; char* s_frtm=NULL; char* s_frix=NULL; char* s_frmo=NULL; unsigned int msec=0; char* p_frtm=strstr(answ.param, m_frtm); if(p_frtm){ char* p_ent=strstr(p_frtm, ""); if(p_ent){ unsigned int l_val=p_ent-(p_frtm+strlen(m_frtm)); s_frtm=(char*)malloc(l_val+1); s_frtm[l_val]=0; memcpy(s_frtm,p_frtm+strlen(m_frtm),l_val); sscanf(s_frtm,"%llu",frtm); msec=(*frtm)%1000; } } char* p_frix=strstr(answ.param, m_frix); if(p_frix){ char* p_ent=strstr(p_frix, ""); if(p_ent){ unsigned int l_val=p_ent-(p_frix+strlen(m_frix)); s_frix=(char*)malloc(l_val+1); s_frix[l_val]=0; memcpy(s_frix,p_frix+strlen(m_frix),l_val); } } char* p_frmo=strstr(answ.param, m_frmo); if(p_frmo){ char* p_ent=strstr(p_frmo, ""); if(p_ent){ unsigned int l_val=p_ent-(p_frmo+strlen(m_frmo)); s_frmo=(char*)malloc(l_val+1); s_frmo[l_val]=0; memcpy(s_frmo,p_frmo+strlen(m_frmo),l_val); } } if(s_frtm && s_frix && s_frmo){ time_t frmtsec=(*frtm)/1000; tm* tm_loc=localtime(&frmtsec); printf("frametime:%s (%d.%d.%d %d:%d:%d.%d):%s:%s",s_frtm, tm_loc->tm_year+1900, tm_loc>tm_mon+1, tm_loc->tm_mday, tm_loc->tm_hour, tm_loc->tm_min, tm_loc->tm_sec, msec, s_frix, s_frmo ); char fname[128]; snprintf(fname, sizeof(fname),"%s.jpg", s_frtm); FILE* fs_jpgres=fopen(fname,"wb"); fwrite(answ.data,1,answ.datalen,fs_jpgres); fclose(fs_jpgres);
Page 56/58
IMPORTANT: Note that samples are instructional and may not include all security mechanisms required for a production environment.
Page 57/58
Contact Information
Should you have any problem during operating the ParkIT camera, 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: ARH Inc. 41 Alkots Road HU-1123 Budapest Hungary Phone: +36 1 2019650 Web: www.arhungary.hu Email: support@arh.hu
Service address: ARH Inc. Ipari Park HRSZ 1113/1 HU-2074 Perbl Hungary Phone: +36 1 2019650 Web: www.arhungary.hu Email: rmarequest@arh.hu
Page 58/58