AXIS Object Analytics is a multifeatured video analytics that comes preinstalled on compatible Axis cameras, adding value at no extra cost. It detects and classifies humans, vehicles, and types of vehicles. Thanks to AI-based algorithms and behavioral conditions, it analyzes the scene and spatial behavior of the objects within —all tailored to your specific needs. This scalable, edge-based analytics requires minimum set up and supports various scenarios running simultaneously. Using the camera’s event management system, it integrates with all major video management systems. Designed to enable proactive monitoring you can quickly verify detected events or set up automatic responses and collect data to access actionable insights.
As of firmware 11.3, it is possible to count objects that cross a virtual tripwire in a defined direction using the Crossline counting scenario. An event can be triggered whenever a set number of selected objects have crossed the line. You can set up events and collect data separately or simultaneously.
As of firmware 11.5, it is possible to define an area where you want to count selected objects using the Occupancy in area scenario. This allows you to estimate occupancy levels at any time.
There are a wide variety of use cases and applications for the object counting data produced by AXIS Object Analytics. The following examples are just a small fraction of the ways in which this information can be leveraged:
Based on open APIs, data can easily be accessed in multiple ways and integrated into third-party apps for visualization and an instant overview. This guide provides important information such as suggested architecture, development examples, and recommended considerations when designing a solution that uses this data.
The integration described in this guide does not have any impact on existing integrations that might be in place with AXIS Object Analytics, as it utilizes a separate scenario within the application known as Crossline counting. This scenario generates its own events based on objects being counted in addition to the already available events generated by the "Object in area" or "Line crossing" scenarios.
The ability to visualize the object counting data produced by AXIS Object Analytics in a digestible manner is key to being able to measure and analyze data trends over time to facilitate data-driven decision making. Being edge-based, AXIS Object Analytics processes and analyses live video directly on the camera, eliminating the need for costly servers. This in turn means that the only data leaving the Axis camera is metadata describing details about the objects that have been counted. This greatly reduces the number of components necessary to design a solution capable of visually presenting the information in graphs or dashboards.
In its simplest form, the components of such a solution could be as follows:
In this example architecture, an Axis camera running AXIS Object Analytics sends event driven metadata each time an object has been counted to a MQTT cloud broker, where the data can then be stored in a database component for storing and further processing. A data visualization or business intelligence platform retrieves the stored data as often as necessary and visually presents it in graphs and dashboards.
The components making up this type of solution can of course vary drastically from one project to another based on customer specific needs and requirements.
Assuming that you have already configured a Crossline counting or Occupancy in area scenario within AXIS Object Analytics, the scenario will generate a stateless event containing metadata about the type of object that was counted. In addition, the Crossline counting event will include the aggregated counts for each of the selected object classes since the time of last reset, while the Occupancy in area event will include the number of objects present within the include area. For information on how to configure these scenarios, please visit the application manual.
Crossline counting scenario example payload in XML format in event stream sent over RTSP/RTP:
<tt:MetadataStream xmlns:tt="http://www.onvif.org/ver10/schema">
<tt:Event xmlns:tt="http://www.onvif.org/ver10/schema">
<wsnt:NotificationMessage xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:tnsaxis="http://www.axis.com/2009/event/topics" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing">
<wsnt:Topic Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Simple">tnsaxis:CameraApplicationPlatform/ObjectAnalytics/Device1Scenario1</wsnt:Topic>
<wsnt:ProducerReference>
<wsa5:Address>uri://61247186-4e20-4050-ab99-03b8a86ac25a/ProducerReference</wsa5:Address>
</wsnt:ProducerReference>
<wsnt:Message>
<tt:Message UtcTime="2023-01-16T12:46:07.800792Z">
<tt:Source>
</tt:Source>
<tt:Data>
<tt:SimpleItem Name="startTime" Value="2023-01-15T23:00:00Z" />
<tt:SimpleItem Name="totalTruck" Value="1258" />
<tt:SimpleItem Name="reason" Value="car" />
<tt:SimpleItem Name="totalCar" Value="18345" />
<tt:SimpleItem Name="total" Value="19723" />
<tt:SimpleItem Name="totalUnknown" Value="0" />
<tt:SimpleItem Name="totalBus" Value="120" />
<tt:SimpleItem Name="totalBike" Value="0" />
</tt:Data>
</tt:Message>
</wsnt:Message>
</wsnt:NotificationMessage>
</tt:Event>
</tt:MetadataStream>
Crossline counting scenario example payload in JSON format sent over MQTT:
{
"topic":"axis:CameraApplicationPlatform/ObjectAnalytics/Device1Scenario1",
"timestamp":1670518346712,
"serial":"ACCC8EF1E944",
"message":{
"source":{},
"key":{},
"data":{
"startTime":"2022-12-06T22:01:25Z",
"totalBus":"0",
"total":"20960",
"totalTruck":"2857",
"totalCar":"18103",
"totalUnknown":"0",
"reason":"car",
"totalBike":"0",
"totalHuman":"0"
}
}
}
Description of the metadata fields:
Field | Description |
topic | Topic specifying the application scenario that produced the event. |
timestamp | Timestamp at which the event was generated. |
serial | MAC address of the device. |
message | An array containing information about the event. |
message.source | N/A |
message.key | N/A |
message.data | An array containing the counting data information. |
message.data.startTime | Time at which the counting started - e.g. time of last data reset. |
message.data.totalBus | Number of objects of type bus class counted since time of last reset. |
message.data.total | Accumulated number of objects of all classes counted since time of last reset. |
message.data.totalTruck | Accumulated number of objects of type truck class counted since time of last reset. |
message.data.totalUnknown | Accumulated number of objects of type unknown class counted since time of last reset. |
message.data.reason | Type of object responsible for triggering the event. |
message.data.totalBike | Accumulated number of objects of type motorcycle/bicycle class counted since time of last reset. |
message.data.totalHuman | Accumulated number of objects of type human class counted since time of last reset. |
The accumulated number of counts can be reset in two ways within the Crossline counting scenario. Manually, by clicking on the "Reset counts" button, or automatically every day at midnight by clicking the "Reset counts at midnight" button. If none of these options are selected, the accumulated number of counts will never reset.
Occupancy in area scenario example payload in XML format in event stream sent over RTSP/RTP:
<tt:MetadataStream xmlns:tt="http://www.onvif.org/ver10/schema">
<tt:Event xmlns:tt="http://www.onvif.org/ver10/schema">
<wsnt:NotificationMessage xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:tnsaxis="http://www.axis.com/2009/event/topics" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing">
<wsnt:Topic Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Simple">tnsaxis:CameraApplicationPlatform/ObjectAnalytics/Device1Scenario1</wsnt:Topic>
<wsnt:ProducerReference>
<wsa5:Address>uri://d36b6220-9ec0-44cf-ac8b-0dbdf0ad9b0a/ProducerReference</wsa5:Address>
</wsnt:ProducerReference>
<wsnt:Message>
<tt:Message UtcTime="2023-05-29T08:37:58.199601Z">
<tt:Source>
</tt:Source>
<tt:Data>
<tt:SimpleItem Name="bike" Value="0" />
<tt:SimpleItem Name="bus" Value="1" />
<tt:SimpleItem Name="human" Value="0" />
<tt:SimpleItem Name="total" Value="5" />
<tt:SimpleItem Name="truck" Value="1" />
<tt:SimpleItem Name="unknown" Value="0" />
<tt:SimpleItem Name="car" Value="3" />
</tt:Data>
</tt:Message>
</wsnt:Message>
</wsnt:NotificationMessage>
</tt:Event>
</tt:MetadataStream>
Occupancy in area example payload in JSON format scenario sent over MQTT:
{
"topic":"axis:CameraApplicationPlatform/ObjectAnalytics/Device1Scenario1",
"timestamp":1685349977783,
"message":{
"source":{},
"key":{},
"data":{
"bus":"0",
"total":"21",
"bike":"0",
"car":"21",
"unknown":"0",
"truck":"0",
"human":"0"
}
}
}
Description of the metadata fields:
Field | Description |
topic | Topic specifying the application scenario that produced the event. |
timestamp | Timestamp at which the event was generated. |
serial | MAC address of the device. |
message | An array containing information about the event. |
message.source | N/A |
message.key | N/A |
message.data | An array containing the counting data information. |
message.data.bus | Number of objects of type bus class present within the include area. |
message.data.total | Total number of objects present within the include area. |
message.data.truck | Number of objects of type truck class present within the include area. |
message.data.unknown | Number of objects of type unknown class present within the include area. |
message.data.bike | Number of objects of type motorcycle/bicycle class present within the include area. |
message.data.human | Number of objects of type human class present within the include area. |
If the Passthrough threshold feature has been configured, the Crossline counting scenario will also generate a stateless event whenever the number of objects exceeds the amount specified within the application. This event does not contain metadata about the classified objects and is primarily used to alert staff or operators to take action when this condition is met. For example, within facility management to perform maintenance when 100 people have been counted.
The object counting metadata can be accessed using the following methods:
Event data streaming:
A client may receive event notifications by subscribing to specific events in the stream. The event stream is sent over RTSP/RTP. Events emitted by Axis products are in XML format and follows the ONVIF standard. Please visit the VAPIX Event data streaming documentation which describes how to query the Axis product for supported events, how to subscribe to the event stream and how to interpret the response.
To avoid overloading the Axis product, only subscribe to the events interesting to the client or application. Do not subscribe to more events than necessary. Event subscriptions start internal services in the Axis product and may cause performance problems.
MQTT
You now posses the necessary information to develop a solution that enables visualization of the counting data produced by the Crossline counting scenario. As previously alluded to, the components making up such a solution can vary drastically depending on the specific needs of your project. In most cases, the data will be stored in a database type component which can be queried regularly to extract the data of interest and visually present it in graphs or dashboards. In other cases, however, the database component might not be required if there is a need to present the data in as close to real-time as possible.
A complete implementation using the integration methods described in this guide is available at the Axis Communications GitHub repository. In this example, MQTT is used as a secure transport protocol from the camera to Amazon Web Services (AWS). AWS IoT Core (MQTT broker) receives the MQTT messages from the camera and forwards them to a time-series database (Amazon Timestream) for storage and further processing. A local or cloud instance of Grafana is connected to the Amazon Timestream database, which queries the data and displays it visually in graphs and tables. Please visit the link below for additional information:
You can also find information about the configuration steps required to connect an Axis device to other widely available MQTT brokers by visiting the links below: