Radar image
Description
Use the radar image API to:
- configure properties of virtual video streams generated to show information from a radar sensor.
- setting up a reference map for the video stream and align the radar data.
The virtual video stream consist of the following elements:
- Background: Either a solid color or a reference map added by the user.
- Grid: Marks the radar field of view and give the user a way to determine the distance to the tracked object.
- Echoes: Raw responses from the radar sensor.
- Radar tracks: Echoes grouped together from the same object, filtered to remove uninteresting ones.
- Radar track trails: Tracks history displayed in the image.
Supported CGIs:
CGI | Usage |
---|---|
uploadradarimage.cgi | Upload an image and set it as a reference map in the video stream. |
replaceradarimage.cgi | Replace an already calibrated reference map in the video stream. |
radarimage.cgi | Control the calibration process and handle parameters for the virtual video stream. |
Supported methods:
Method | Usage |
---|---|
uploadImage | Response to uploadradarimage.cgi. |
replaceImage | Response to replaceradarimage.cgi. |
startCalibrationTracking | Start or restart the reference map calibration using tracking. |
setCalibrationPoint | Set the coordinates in the reference map used by the back-end to calibrate the radar. |
stopCalibrationTracking | Stop tracking and store the result if calibration was successful. |
abortCalibration | Stop tracking and reset all parameters related to the current reference map. |
resetCalibration | Stop tracking, remove the current reference map and reset the parameters related to the reference map. |
getCalibrationState | Return the current state of calibration. |
setManualRadarPosition | Manually set a point in the reference map as the new radar position. |
setManualCalibrationPoint | Manually set a point in the reference map used to calibrate the radar. |
setColorScheme | Set a predefined collection of colors used for the virtual video stream. |
getColorScheme | Get current color scheme and a list of possible color scheme values. |
setTrailLifetime | Set how many seconds a trail should be visible. |
getTrailLifetime | Get the current value for trail lifetime and its minimum and maximum value. |
setGridOpaque | Set opaque value of the grid. |
getGridOpaque | Get opaque value for the grid and minimum and maximum opaque value. |
setEchoVisualizationLevel | Set level for the visualization of echoes. |
getEchoVisualizationLevel | Get current setting for the visualization of echoes. |
getImageMetricSize | Get the metric size of the image to be able to transform between pixels and meters. |
getFilename | Get the filename for the currently used reference map. |
getSupportedVersions | Get a list of supported API versions. |
Overview
Model
The API consists of three CGI calls which should be called using the HTTP POST
method. The calls uploadradarimage.cgi
and replaceradarimage.cgi
use multipart/form-data for sending binaries while radarimage.cgi
accept JSON formatted data. All three return JSON formatted data. This all give the user the possibility to:
- Upload an image and set it as a reference map.
- Replace a reference map with a new image.
- Calibrate the radar so it aligns the grid and radar tracks to a reference map.
- Fetch image parameters like color scheme, opaque level, echo visualization level, filename and trail lifetime.
- Set how long a trail should be displayed.
- Set color scheme.
- Set grid opaque.
- Set level of echo visualization.
- Request a list with the supported API versions.
Identification
- Property:
Properties.Radar.Radar=yes
- Property:
Properties.AddOnFramework.AddOnFramework=yes
- Property:
Properties.AddOnFramework.Version=1.0
or higher - Firmware: 7.10 and later
- Product category: Axis Cameras with application support.
Application identification
The getInfo method in axis-cgi/packagemanager.cgi lists axis-rmd as active.
or
The property Properties.Radar.Radar equals "yes".
Common examples
Reference map calibration using tracking
Use this example to set up a reference map and align it with the radar data to identify the position of objects detected by the radar.
1. Upload image and us it as background in stream:
http://myserver/axis-cgi/radar/uploadradarimage.cgi
Input parameters:
HTTP/1.0
Content-Type: multipart/form-data;
boundary=<boundary>
Content-Length: <content length>
--<boundary>
Content-Disposition: form-data; name="<name>"; filename="<filename>"
Content-Type: image/png
<file content>
--<boundary>
2. Parse the JSON response.
a. Success response example.
{
"apiVersion": "1.0",
"context": "Echoed if provided by the client in the corresponding request",
"method": "uploadRadarImage",
"data": {}
}
b. Failure response example.
{
"apiVersion": "1.0",
"context": "Echoed if provided by the client in the corresponding request",
"method": "uploadRadarImage",
"error": {
"code": 5000
"message": "File type is invalid. Support .png and .jpeg."
}
}
3. Start tracking calibration object:
http://myserver/axis-cgi/radar/radarimage.cgi
JSON input parameters:
{
"apiVersion": "1.0",
"context": "123",
"method": "starCalibrationTracking",
"params": {}
}
4. Parse the JSON response.
a. Success response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "startCalibrationTracking",
"data": {}
}
b. Failure response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "startCalibrationTracking",
"error": {
"code": 6000,
"message": "Invalid calibration state: 'reset'."
}
}
5. Set a calibration point in the image:
http://myserver/axis-cgi/radar/radarimage.cgi
JSON input parameters:
{
"apiVersion": "1.0",
"context": "123",
"method": "setCalibrationPoint",
"params": {
"x_pos": -0.2,
"y-pos": 0.9
}
}
6. Parse the JSON response.
a. Success response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "setCalibrationPoint",
"data": {}
}
b. Failure response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "setCalibrationPoint",
"error": {
"code": 6000,
"message": "Invalid calibration state: 'image_uploaded'."
}
}
7. Set another calibration point in image:
http://myserver/axis-cgi/radar/radarimage.cgi
JSON input parameters:
{
"apiVersion": "1.0",
"context": "123",
"method": "setCalibrationPoint",
"params": {
"x-pos": 0.1,
"y-pos": 0.8
}
}
8. Parse the JSON response.
a. Success response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "setCalibrationPoint",
"data": {}
}
b. Failure response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "setCalibrationPoint",
"error": {
"code": 6001,
"message": "Tracked object moved out of range."
}
}
9. Calibration is successful so stop tracking calibration object:
http://myserver/axis-cgi/radar/radarimage.cgi
JSON input parameters:
{
"apiVersion": "1.0",
"context": "123",
"method": "stopCalibrationTracking",
"params": {}
}
10. Parse the JSON response.
a. Success response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "stopCalibrationTracking",
"data": {}
}
b. Failure response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "stopCalibrationTracking",
"error": {
"code": 6002,
"message": "Not enough calibration points set for successful calibration."
}
}
API references
Restart calibration
Use this example to restart the calibration process.
1. Restart the calibration:
http://myserver/axis-cgi/radar/radarimage.cgi
JSON input parameters:
{
"apiVersion": "1.0",
"context": "123",
"method": "startCalibration",
"params": {}
}
2. Parse the JSON response.
a. Success response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "startCalibration",
"data": {}
}
b. Failure response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "startCalibration",
"error": {
"code": 6000,
"message": "Invalid calibration state: 'reset'."
}
}
API references
Find calibration state
Use this example to find the state of the calibration in order to present the user with useful options.
1. Get the state of the calibration process:
http://myserver/axis-cgi/radar/radarimage.cgi
JSON input parameters:
{
"apiVersion": "1.0",
"context": "123",
"method": "getCalibrationState",
"params": {}
}
2. Parse the JSON response.
a. Success response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "getCalibrationState",
"data": {
"value": "tracking"
}
}
b. Failure response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "getCalibrationState",
"error": {
"code": 8000,
"message": "Internal error."
}
}
API references
Abort calibration
Use this example to abort an ongoing calibration process and re-start it later when there are no objects entering the radars’s field of view.
1. Abort the calibration:
http://myserver/axis-cgi/radar/radarimage.cgi
JSON input parameters:
{
"apiVersion": "1.0",
"context": "123",
"method": "abortCalibration",
"params": {}
}
2. Parse the JSON response.
a. Success response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "abortCalibration",
"data": {}
}
b. Failure response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "abortCalibration",
"error": {
"code": 6000,
"message": "Invalid calibration state: 'reset'."
}
}
API references
Remove reference map
Use this example to remove the reference map and the calibrated parameters in order to move the radar unit to a different location.
1. Reset calibration parameters and remove the reference map:
http://myserver/axis-cgi/radar/radarimage.cgi
JSON input parameters
{
"apiVersion": "1.0",
"context": "123",
"method": "resetCalibration",
"params": {}
}
2. Parse the JSON response.
a. Success response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "resetCalibration",
"data": {}
}
b. Failure response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "resetCalibration",
"error": {
"code": 6000,
"message": "Invalid calibration state: 'reset'."
}
}
API references
Replace background image
Use this example to update the reference map without having to redo the entire calibration process.
Replace the reference map with a new:
http://myserver/axis-cgi/radar/replaceradarimage.cgi
Input parameters:
HTTP/1.0
Content-Type: multipart/form-data;
boundary=<boundary>
Content-Length: <content length>
--<boundary>
Content-Disposition: form-data; name="<name>"; filename"<filename>"
Content-Type: image/png
<file content>
--<boundary>
2. Parse the JSON response.
a. Success response example.
{
"apiVersion": "1.0",
"context": "Echoed if provided by the client in the corresponding request",
"method": "replaceRadarImage",
"data": {}
}
b. Failure response example.
{
"apiVersion": "1.0",
"context": "Echoed if provided by the client in the corresponding request",
"method": "replaceRadarImage",
"error": {
"code": 5002,
"message": "Invalid file content."
}
}
API references
Manual calibration
Use this example to calibrate the radar remotely using the API.
1. Set radar position:
http://myserver/axis-cgi/radar/radarimage.cgi
JSON input parameters:
{
"apiVersion": "1.0",
"context": "123",
"method": "setManualRadarPosition",
"params": {
"x_pos": -0.5,
"y_pos": -0.5
}
}
2. Parse the JSON response.
a. Success response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "setManualRadarPosition",
"data": {}
}
b. Failure response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "setManualRadarPosition",
"error": {
"code": 1000,
"message": "Invalid parameter value."
}
}
3. Set calibration point position:
http://myserver/axis-cgi/radar/radarimage.cgi
JSON input parameters:
{
"apiVersion": "1.0",
"context": "123",
"method": "setManualCalibrationPoint",
"params": {
"x_pos": -0.5,
"y_pos": -0.5,
"range": 20,
"angle": 0
}
}
4. Parse the JSON response.
a. Success response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "setManualCalibrationPoint",
"data": {}
}
b. Failure response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "setManualCalibrationPoint",
"error": {
"code": 1000,
"message": "Invalid parameter value."
}
}
API references
Set color scheme
Use this example to identify tracks in the video stream through the use of color coding.
1. List color schemes available and current color scheme:
http://myserver/axis-cgi/radar/radarimage.cgi
JSON input parameters
{
"apiVersion": "1.0",
"context": "123",
"method": "getColorScheme",
"params": {}
}
2. Parse the JSON response.
a. Success response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "getColorScheme",
"data": {
"value": "green",
"allowedValues": ["black", "green", "blue"]
}
}
b. Failure response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "getColorScheme",
"error": {
"code": 8001,
"message": "Unexpected error."
}
}
3. Set color scheme:
http://myserver/axis-cgi/radar/radarimage.cgi
JSON input parameters:
{
"apiVersion": "1.0",
"context": "123",
"method": "setColorScheme",
"params": {
"value": "blue"
}
}
4. Parse the JSON response.
a. Success response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "setColorScheme",
"data": {}
}
b. Failure response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "setColorScheme",
"error": {
"code": 1000,
"message": "Invalid radarimage configuration value orange for 'value'."
}
}
API references
Set trail lifetime
Use this example to increase the time the tracked objects history should be shown on a screen to make it easier to identify from where the objects came before entering the alarm area.
1. Get trail lifetime and boundaries:
http://myserver/axis-cgi/radar/radarimage.cgi
JSON input parameters:
{
"apiVersion": "1.0",
"context": "123",
"method": "getTrailLifetime",
"params": {}
}
2. Parse the JSON response.
a. Success response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "getTrailLifetime",
"data": {
"value": 17,
"minValue" 0,
"maxValue": 600
}
}
b. Failure response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "getTrailLifetime",
"error": {
"code": 8001,
"message": "Unexpected error."
}
}
3. Set trail lifetime:
http://myserver/axis-cgi/radar/radarimage.cgi
JSON input parameters:
{
"apiVersion": "1.0",
"context": "123",
"method": "setTrailLifetime",
"params": {
"value": 30
}
}
4. Parse the JSON response.
a. Success response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "setTrailLifetime",
"data": {}
}
b. Failure response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "setTrailLifetime",
"error": {
"code": 1000,
"message": "Invalid radarimage configuration value -1 for 'value'."
}
}
API references
Set grid opaque
Use this example to make the video stream less cluttered and easier to follow separate objects.
1. Get grid opaque:
http://myserver/axis-cgi/radar/radarimage.cgi
JSON input parameters
{
"apiVersion": "1.0",
"context": "123",
"method": "getGridOpaque",
"params": {}
}
2. Parse the JSON response.
a. Success response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "getGridOpaque",
"data": {
"value": 55,
"minValue": 0,
"maxValue": 100
}
}
b. Failure response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "getGridOpaque",
"error": {
"code": 8001,
"message": "Unexpected error."
}
}
3. Set grid opaque:
http://myserver/axis-cgi/radar/radarimage.cgi
JSON input parameters
{
"apiVersion": "1.0",
"context": "123",
"method": "setGridOpaque",
"params" {
"value": 50
}
}
4. Parse the JSON response.
a. Success response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "setGridOpaque",
"data": {}
}
b. Failure response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "setGridOpaque",
"error": {
"code": 1000,
"message": "Invalid radarimage configuration value 123 for 'value'."
}
}
API references
Set echo visualization level
Use this example to lower the amount of information visualized to make the video stream look less cluttered.
1. Get the current echo visualization level:
http://myserver/axis-cgi/radar/radarimage.cgi
JSON input parameters:
{
"apiVersion": "1.0",
"context": "123",
"method": "getEchoVisualizationLevel",
"params": {}
}
2. Parse the JSON response.
a. Success response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "getEchoVisualizationLevel",
"data": {
"value": "associated",
"allowedValues": ["disable", "associated", "all"]
}
}
b. Failure response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "getEchoVisualizationLevel",
"error": {
"code": 4003,
"message": "Could not find implementation for method getEchoVisualizationLevel"
}
}
3. Set echo visualization level:
http://myserver/axis-cgi/radar/radarimage.cgi
JSON input parameters
{
"apiVersion": "1.0",
"context": "123",
"method": "setEchoVisualizationLevel",
"params": {
"value": "disable"
}
}
4. Parse the JSON response.
a. Success response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "setEchoVisualizationLevel",
"data": {}
}
b. Failure response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "setEchoVisualizationLevel",
"error": {
"code": 4001,
"message": "Failed to find key 'value' in JSON input"
}
}
API references
Get metric size
Use this example to enter parameters related to the reference map in meters instead of pixels.
1. Get image metric size:
http://myserver/axis-cgi/radar/radarimage.cgi
JSON input parameters:
{
"apiVersion": "1.0",
"context": "123",
"method": "getImageMetricSize",
"params": {}
}
2. Parse the JSON response.
a. Success response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "getImageMetricSize",
"data": {
"value": "57",
}
}
b. Failure response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "getImageMetricSize",
"error": {
"code": 4004,
"message": "Failed to load JSON from HTTP POST data"
}
}
API references
Get file name
Use this example to receive and verify the names of the files uploaded from the computer to the radar unit.
1. Get file name:
http://myserver/axis-cgi/radar/radarimage.cgi
JSON input parameters
{
"apiVersion": "1.0",
"context": "123",
"method": "getFilename",
"params": {}
}
2. Parse the JSON response.
a. Success response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "getFilename",
"data": {
"value": "west_entrance.png"
}
}
b. Failure response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "getFilename",
"error": {
"code": 4004,
"message": "Failed to load JSON from HTTP POST data"
}
}
API references
Get supported versions
Use this example to check if a feature is supported before an application try to use them.
1. Get supported API:
http://myserver/axis-cgi/radar/radarimage.cgi
JSON input parameters:
{
"apiVersion": "1.0",
"context": "123",
"method": "getSupportedVersions",
"params": {}
}
2. Parse the JSON response.
a. Success response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "getSupportedVersions",
"data": {
"value": ["1.0", "2.0"]
}
}
b. Failure response example.
{
"apiVersion": "1.0",
"context": "123",
"method": "getSupportedVersions",
"error": {
"code": 8001,
"message": "Unexpected error."
}
}
API references
API specification
uploadRadarImage
Upload an image to be used as a reference map to make it easier to relate a radar track to a position.
Supported image file formats are png
and jpeg
.
Request
- Security level: Operator
- Method:
POST
http://<servername>/axis-cgi/radar/uploadradarimage.cgi
HTTP/1.0
Content-Type: Multipart/form-data;
boundary=<boundary>
Content-Length: <content length>
--<boundary>
Content-Disposition: form-data; name="<name>", filename="<filename>"
Content-Type: image/png
<file content>
--<boundary>
Return value: Success
- HTTP Code:
200 OK
- Content-Type:
application/json
Response body syntax:
{
"apiVersion": "Major.Minor",
"context": "Echoed if provided by the client in the corresponding request",
"method": "uploadRadarImage",
"data": {}
}
Return value: Error
- HTTP Code:
200 OK
- Content-Type:
application/json
Response body syntax:
{
"apiVersion": "Major.Minor",
"context": "Echoed if provided by the client in the corresponding request",
"method": "uploadRadarImage",
"error": {
"code": <error code>
"message": "Error message"
}
}
Error codes
The following table lists error codes that can be returned from this method. General errors are listed under section General error codes.
Code | Definition | Description |
---|---|---|
2001 | RESOURCE_NO_FREE_SPACE_ERROR | No free space for the file on the radar unit. |
5000 | FILE_TYPE_INVALID_ERROR | File type is invalid. |
5001 | FILE_HEADER_INVALID_ERROR | File header is invalid. |
5002 | FILE_CONTENT_INVALID_ERROR | File content is invalid. |
5003 | FILE_WRITE_TO_SYSTEM_ERROR | Error writing to file system. |