AXIS Occupancy Estimator

Solution overview

An overview of the different devices, applications, and tools needed for a complete system.

AXIS Occupancy Estimator

AXIS Occupancy Estimator is an analytic application that can be installed on a network camera. The application keeps track of how many people are currently occupying a closed area.

The application can also estimate how long the average person spends in the area.

AXIS Occupancy Estimator includes AXIS People Counter functionality.

How does it work?

The application works both in a single retail shop with just one entrance or in a store with several entrances and exits. Each entrance and exit to the building needs to be equipped with a network camera with AXIS Occupancy Estimator installed. If there are several cameras, they communicate with each other over the network in a primary and secondary concept. The primary camera continuously fetches data from the secondary cameras and presents the data in the live view. Every fifteen minutes, the primary camera sends the statistical data to AXIS Store Data Manager. Consequently, the reports generated from AXIS Store Data Manager can present the data in a minimum of 15 minutes time interval.

Mount the camera

NOTICE

The application is designed for scenarios where it counts objects with the characteristics of an adult person. The exact height limitation of the object depends on camera model, camera lens, and the selected counter sensitivity.

In addition to the instructions in the camera’s Installation Guide, there are some important steps to follow for the application to behave in the expected way:

  • We recommend that you install the camera at a minimum height of 270 cm (8.9 ft).

  • As a rule-of-thumb, the camera covers an area as wide as the camera’s mounting height. For details about a specific camera model, see the Camera selector for AXIS People Counter

  • After installation, the covered area can be increased depending on the camera’s zoom setting.

  • If the camera is mounted high enough, you can get a coverage width of 8 meters. You can cover even wider entrances by using multiple counters.

  • The camera must be mounted straight above the point where people pass.

  • Make sure the camera is facing straight down, in line with the ceiling.

  • If you install the application before you install the camera, you can use the counting area indicated in the live view to position the camera. The counting area should go from left to right, perpendicular to the path where people cross.

  • Make sure there is sufficient white light or IR illumination on site.

  • Make sure that there are no continuously moving objects in the counting area. For example, do not install the camera above an escalator.

  • Make sure there are no moving objects interfering in the counting area. For example, do not install the camera too close to a door.

  • Avoid getting very strong light, like sunlight, and sharp shadows in the camera view.

Find the device on the network

For more information about how to find and assign IP addresses, go to How to assign an IP address and access your device.

Access the device

  1. Open a browser and enter the IP address or host name of the Axis device.

    If you do not know the IP address, use AXIS IP Utility or AXIS Device Manager to find the device on the network.

  2. Enter the username and password. If you access the device for the first time, you must set the root password. See Set a new password for the root account.

  3. The live view page opens in your browser.

Secure passwords

Important

Axis devices send the initially set password in clear text over the network. To protect your device after the first login, set up a secure and encrypted HTTPS connection and then change the password.

The device password is the primary protection for your data and services. Axis devices do not impose a password policy as they may be used in various types of installations.

To protect your data we strongly recommend that you:

  • Use a password with at least 8 characters, preferably created by a password generator.

  • Don’t expose the password.

  • Change the password at a recurring interval, at least once a year.

Set a new password for the root account

Important

The default administrator username is root. If the password for root is lost, reset the device to factory default settings. See

Support tip: Password security confirmation check
  1. Type a password. Follow the instructions about secure passwords. See Secure passwords.

  2. Retype the password to confirm the spelling.

  3. Click Create login. The password has now been configured.

Install the application on the camera

Note
  • The license is only valid for one camera. You can’t activate the license on another camera without a new registration key.
  • To install applications on the camera you need administrator rights.
  1. Install the camera on your network..

  2. Go to the camera’s web interface in your browser, see the user manual for the camera.

  3. Go to Apps.

  4. Upload the application file (.eap) to the camera.

  5. Activate the license. If you’re online, enter the license code. The application automatically activates the license.

How to activate the license when you’re offline

  1. To activate the license when you’re offline, you need a license key. If you don’t have a license key on the computer, do the following:
  2. Go to www.axis.com/applications

  3. Go to License key registration. You need the license code and the Axis device serial number.

  4. Save the license key file on the computer and select the file when the application asks for it.

Access the application settings

  1. In the camera’s web interface, go to Apps, start the application and click Open.

Additional settings

Set the date and time

The date and time settings are important for your camera to keep the correct time for a longer period of time, and for the statistics to be attributed to the correct time. You set the date and time in the camera’s web interface.

  1. In the camera’s web interface, go to System > Date and time.

  2. For more information about date and time settings, click .

Create a user account

You can create user accounts with different privileges, so that unauthorized staff can view statistics but not change any settings of the counter.

You create user accounts in the camera’s web interface.

  1. In the camera’s web interface, go to System > Users.

  2. For more information about user accounts, click .

Set up the counter

To check if the application is calibrated for your camera, go to the Camera selector for AXIS People Counter tool.

  1. In the application’s web interface, go to Settings > General.

  2. Make sure Status is on.

  3. In the Name field, type the name of the camera or location.

    This can be for example “Axis_Main_entrance_T_building”. All cameras need to have unique names.

  4. Set Calibration mode. Do one of the following:

    • If the application is calibrated for your camera, select Height setting. Type the mounting height in the Visual height field.

    • If the application is not calibrated, select Manual setting and click Setup. Place a person underneath the camera and adjust the size of the yellow box so that it covers just one person.

  5. If you need to zoom in, do one of the following:

    • Turn on Digital zoom and click Setup.

    • If the camera has optical zoom, you need to go to the camera’s web interface to adjust the zoom.

  6. Set Direction in to Up or Down, depending on the direction of the people passing by in live view.

  7. To adjust the counting area, go to Adjust the counting area.

Adjust the counting area

Note

The camera model and the mounting height both limit how much you can adjust the counting area.

In the live view image, the counting area is indicated by two blue lines and a red area. A person needs to pass through the red area to be counted.

Use the curvature settings to change the shape so that it is natural for people to pass through the counting area. Keep the curvature as close to a straight angle as possible.

  1. Go to Settings > Counting zone.

  2. To move the entire counting area up or down, use the Line offset slider. How much you can move it depends on the counting area size.

  3. To adjust the height of the counting area, use the Counting zone height slider.

  4. To adjust the width of the counting area, use the Counting zone width slider. How much you can adjust it depends on the camera’s mounting height.

  5. To use a curved counting area, select Curved line and then adjust the radius with the Radius slider.

  6. To change the direction of the curvature, click the Radius icon.

  7. Click Submit to save the settings when you are done.

  8. You might need to fine-tune the counter for the best possible performance, see Validate the system.

Neighbor counters for wide entrances

NOTICE

You can only use this feature with cameras of the same model.

If you need to cover a wide entrance with several counters you can set up multiple cameras, also called Neighbor counters. To calculate how many cameras are needed to cover the entire width of the entrance, use the Camera selector for AXIS People Counter.

Note

Note that this setup with primary and secondary cameras is not the same as the primary and secondary roles set under Settings > AXIS Occupancy Estimator. Multiple cameras are used to cover wide entrances or exits. The primary and secondary roles, however, are necessary for the occupancy algorithm to work.

The primary camera overrides the following settings on the secondary cameras:

  • Visual height

  • Counter sensitivity

  • Digital zoom

  • Network & time

  • Line offset

  • Counting zone height

  • Counting schedule

Configure neighbor counters

  1. Mount the cameras side by side following the measurements indicated by the camera selector tool.

  2. Go to the primary camera application web interface and select Settings > Advanced > Neighbor counters.

  3. Select Enable as primary.

  4. If you have a secondary camera that you want to connect to:

    1. Go to the secondary camera.

    2. Go to Advanced > Neighbor counters.

    3. Select Display connection key

    4. Click Copy connection key.

    5. Return to the primary camera.

    6. Paste the text under Connection key.

  5. Note

    If you don’t have a secondary camera, you can leave the Connection key field empty.

  6. Note

    If the cameras are configured to send data to AXIS Store Data Manager, make sure that only the primary camera is connected. The primary camera automatically uploads the data from all the secondary cameras as one single unit.

  7. Click Submit.

  8. When you have connected all cameras, go to Calibrate secondary position.

  9. Place an object, for example a sheet of paper, at the exact mid-point between the two cameras. It’s very important that you place the object exactly in the middle of the two cameras since the object is used as a reference point to calibrate the cameras.

  10. Drag the view of the secondary camera over the primary camera view. Try to avoid vertical offset.

    1. Primary camera view
    2. Secondary camera view
    3. Reference object
  11. Once the calibration is done, go to Live view in the primary camera to view all of the secondary cameras.

If you can’t see the video stream from the secondary cameras in the primary camera, make sure that there are no other connections to the secondary cameras running.

Set up a primary camera

One of the cameras has to be the primary. The primary camera represents the whole area and makes the estimations of the occupancy and average visit time for the whole area.

  1. Enter an Occupancy name. This is the name that shows up in AXIS Store Data Manager.

  2. Enter the local IP addresses for the secondary cameras.

    • If the secondary camera connects two different occupancy areas, select Reverse In/Out direction. See Reverse in/out direction.

    • If there are no secondary cameras, leave the IP address field empty.

  3. Select Full-day analysis, see Full-day analysis.

  4. Select Occupancy mode, see Change to naive occupancy mode.

Set up a secondary camera

  1. Install AXIS Occupancy Estimator on all of the cameras covering the entrances or exits.

  2. Go to Settings > AXIS Occupancy Estimator.

  3. Select the Secondary role.

  4. Go to Settings > Advanced > Neighbor counters.

  5. Select Display camera credentials.

  6. Copy the IP address, username and password.

  7. In the primary camera, go to Settings > AXIS Occupancy Estimator and add the credentials to the list of secondaries. See Set up a primary camera.

Reverse in/out direction

To calculate the occupancy levels of the two adjacent rooms connected by the same secondary camera, you must select Reverse In/Out direction in one of the primary cameras. This overrides the Direction in setting made in the secondary camera, but only for this occupancy area. In other words, this ensures that people walking out from the first room, are considered walking in to the second room and vice versa.

  1. Primary camera, room 1
  2. Secondary camera
  3. Primary camera, room 2

Full-day analysis

The full-day analysis is selected by default.

Full-day analysis means that the occupancy that has been calculated during the day is slightly modified after closing. This is because when the data for a complete day is gathered, more details about that day is available and the application can give a more precise estimation of the occupancy during that day. The occupancy application automatically detects when the occupancy area is open or closed by observing the flow of visitors.

Consequently, full-day analysis also means that the primary camera only sends statistical data once a day to AXIS Store Data Manager.

Smart and naive occupancy mode

AXIS Occupancy Estimator can be run in two modes. The application is developed for smart occupancy, however at locations where traffic and average visit time are not steady, naive occupancy can still provide additional value.

Smart occupancy mode

The smart occupancy means that the application analyses frequency of passages and in turn calculates an average visiting time, which is then used to filter away counting errors that accumulate throughout the day. The output is an estimated occupancy and average visiting time at any given time as well as a corrected full day analysis at the end of the day.

Naive occupancy mode

If you select the naive occupancy mode, the application estimates the occupancy by counting “people coming in” minus “people coming out”. This estimation is not as sophisticated as the smart occupancy mode, and the occupancy error accumulates over time. The error will be larger if there is a high flow of people and if the counter is poorly configured.

The table shows recommended occupancy mode for different scenarios, based on traffic flow and average visiting time.

LocationSmart occupancy modeNaive occupancy modeComments
Larger grocery store (supermarket)xHigh flow of people, similar average visit time.
LibraryxLow flow of people, varying average visit time.
PharmacyxMedium flow of people, varying average visit time.
CinemaxVarying average visit time and long visit time, in most cases more than 90 minutes.
Fast food restaurantxHigh flow of people, similar average visit time.
News agent/kioskxHigh flow of people, similar average visit time.
Coffee shopxLow flow of people, varying average visit time.
GymxMedium flow of people, long average visit time but in most cases less than 90 minutes.
Shopping mallxHigh flow of people, varying average visit time, in most cases more than 90 minutes. For the individual shops in the mall the average visit time is likely to be significantly shorter and the application can be applied in smart occupancy mode.
Destination store (specialty retail)xHigh flow of people, similar average visit time.

If you select naive occupancy mode, we recommend that you schedule a reset of the counter. See Change to naive occupancy mode.

Change to naive occupancy mode

  1. Go to Settings > AXIS Occupancy Estimator.

  2. Set Occupancy mode to Naive.

  3. Select when to reset the counter by moving the Reset occupancy slider.

If you don’t want to reset the counter automatically, move the slider to the right until it says Never reset occupancy. You can reset the counter at any time in the live view.

Send an email when the occupancy level exceeds the limit

This example explains how to set up a rule to send an email when the number of people inside the premises exceeds a limit. In the example, the limit is 200.

  1. Set the maximum occupancy limit
  2. In the application, go to Settings > AXIS Occupancy Estimator.

  3. Select Enable stateful events.

  4. Enter 200 in Higher threshold.

  5. Click Submit.

  1. Create a rule
  2. In the camera’s web interface, go to Events and add a rule.

  3. Type a name for the rule.

  4. In the list of conditions, under Application, select Occupancy-High.

  5. In the list of actions, under Notifications, select Send notification to email and then select a recipient from the list.

    To create a new recipient, go to Recipients.

  6. Type a subject and a message for the email.

  7. Click Save.

Set up a schedule

The application automatically disables the counting functionality when it gets dark. If you want to limit the counting further, you can set up a schedule.

  1. Go to Settings > Counting schedule.

  2. To adjust start and stop times, move any of the sliders. To set individual schedules for each day of the week, select Per day schedule and then move the corresponding sliders.

Turn off the application on a specific day of the week

Clear the checkbox next to the slider.

Anonymize people

You can configure the application so that people can no longer be identified from the camera.

Anonymize soft

This feature blocks all video streams and images from the camera. The live view still shows a blurred image which means you can still see what is going on but you can't identify people.

  1. Go to Maintenance > Anonymize.

  2. Click Anonymize soft.

  3. To go back to normal mode, click Reset anonymization. Only users with an administrator account can do this.

Copy the application settings to another camera

Use the copy functionality if you want to copy the application settings to, for example, other cameras in the same store with the same mounting height. Camera-specific settings, such as the application license and camera name, are not included.

  1. To copy the application settings, go to Maintenance > Parameter backups.

  2. Click Copy. The computer saves the file in your browser’s default folder for downloads.

Validate the system

Note

Before you validate the system, make sure you have mounted the camera according to the recommendations. See Mount the camera.

When you have installed and set up all cameras in the building, we recommend that you validate the accuracy and fine-tune the system. This is likely to increase the accuracy or identify any problems with the counters.

To get an overview, go to Statistics and look at the counting data for a couple of days back. If the difference between number of persons going in and out is <5% it’s a good first indication that the system is configured correctly.

If the difference is greater than that, follow the instructions inValidate the counter.

Validate the counter

  1. Go to Live view.

  2. Click Test accuracy.

  3. To hide the automatic counter, click Hide.

  4. Click Start and manually count 100 or more passages by pressing the up and down arrows on your keyboard. You can also click In and Out.

  5. If you need to start over, click Reset.

  6. Click Result when you are done.

  7. Check the accuracy table. Under normal circumstances, the total accuracy percentage should be 95 % or higher.

If you’re not satisfied with the accuracy of the counter, see Fine-tune the counter.

Fine-tune the counter

  1. Make sure the camera is mounted according to the instructions in Mount the camera.

  2. Go to Settings > General.

  3. Go to the Counter sensitivity slider, or click Setup if the counter is running in manual mode, and do one of the following:

    • If the counter is counting too many compared to the control figure, decrease the counter sensitivity with about 20 units or increase the size of the yellow box slightly.

    • If the counter is counting too few compared to the control figure, increase the counter sensitivity with about 20 units or decrease the size of the yellow box slightly.

  4. Validate the accuracy again, see Validate the counter.

Integration

Send a notification when the occupancy limit is exceeded

This example explains how to set up a rule in AXIS Camera Station to send mobile notifications when the number of people inside the premises exceed the maximum limit. In the example, the maximum limit is 50.

Before you start

  • You need:
  • a computer with AXIS Camera Station 5.36 or later installed

  • AXIS Camera Station Mobile app

  1. Set the maximum occupancy limit
  2. In the application, go to Settings > AXIS Occupancy Estimator.

  3. Select Enable stateful events.

  4. Enter 50 in Higher threshold.

  5. Click Submit.

  1. Create a device event trigger
  2. In AXIS Camera Station, click and go to Configuration > Recording and events > Action rules and click New.

  3. Click Add to add a trigger.

  4. Select Device event from the list of triggers and click Ok.

  5. In the Configure device event trigger section:

    • In Device, select the device.

    • In Event, select Occupancy-High.

    • In Trigger period, set an interval time between two successive triggers. Use this function to reduce the number of successive recordings. If an additional trigger occurs within this interval, the event will continue and the trigger period starts over from that point in time.

  6. In Filters, set active to Yes.

  7. Click Ok.

  1. Create actions to send notifications to the mobile app
  2. Click Next.

  3. Click Add to add an action.

  4. Select Send mobile app notification from the list of actions and click Ok.

  5. Note

    The message is what the receiver sees when an alarm is triggered.

  6. In Message, enter the message to send when the occupancy limit is exceeded.

  7. Select Default. This opens the main page of the AXIS Camera Station Mobile app when the receiver clicks the notification.

  8. Click Ok.

  1. Specify when the alarm is active
  2. Click Next.

  3. If you only want the alarm to be active during certain hours, select Custom schedule.

  4. Select a schedule from the list.

  5. Click Next.

  6. Enter a name for the rule.

  7. Click Finish.

Statistics

There are several ways to use the statistics from the counter:

  • In the application’s web interface, view real-time counting data in the built-in graphs.

  • View built-in graphs in day and week view from the statistics page. The data is updated in real time.

    Data is available on the camera for up to 90 days and updated every 15 minutes. The data is stored in 15-minute bins representing the in and out counts for the 15-minute periods.

  • Download data through an open API. See VAPIX® Library.

  • Use AXIS Store Data Manager, a software package that acts as a central point to store and manage data collected from all devices. See Connect a camera to a folder in AXIS Store Data Manager.

  • Use AXIS Store Reporter, a statistical web-based solution, for managing and monitoring historical data.

  • Download statistics to your computer, see Download statistics.

Connect a camera to a folder in AXIS Store Data Manager

To perform this task, the application must be installed on the camera.

  1. In AXIS Store Data Manager, go to Sources and get the Folder connection identifier and the Folder connection password for the folder you want to connect to.

  2. In the camera’s web interface, go to Settings > Apps and open the application’s web interface.

  3. In the application’s web interface, go to Settings > Reporting.

  4. To enable pushing data to a server, select Enabled.

  5. Enter the web address for AXIS Store Data Manager, for example https://[subdomain].asdm.axis.com/datamanager where [subdomain] is replaced by a unique name.

  6. Enter the Folder connection identifier and Folder connection password.

  7. To test the connection, click Run test.

  8. Click Submit.

Download statistics

  1. Go to Statistics > Download statistics.

  2. Select the file format:

    • If you select .xml, .csv or .json format you can also select the time interval.

    • File format .cnt is a proprietary, binary format, available for compatibility reasons.

  3. Select date in the calendar. The data is presented in a new tab in your browser.

  4. If you want to save the data as a local file on the computer, right-click and select Save as. The browser saves the file in the default download folder.

  5. If you want to download all available data, click Download all next to the file format.

Troubleshooting

IssueAction
The software doesn’t upload to AXIS Store Data Manager.The most common reason is network communication problems. Run the connection test under Settings > Reporting to get information about the root cause for the problem.
The software doesn’t count.Make sure the instructions for how to mount the camera has been followed, see Mount the camera.
The software doesn’t count correctly.Make sure people pass the entire counting zone, crossing both blue lines. They should not turn left or right before they have passed both lines.
There’s no video stream in live view.Make sure no one else is watching the video or that you have a video stream to a VMS or other ongoing recording. Check if the camera has a limited number of viewers or video streams allowed at the same time.
The software prompts me with a warning saying that the frame rate is too low.1. Make sure the scene has sufficient lighting. If the scene is too dark, the camera does not deliver enough frames per second for the application to work.
2. If the processor in the camera has a high workload, the application might suffer. When streaming video from the camera make sure to open only one stream at a time.
The software doesn’t count after changing parameters.After changing the parameters the software may need to run up to 10 minutes before the counting accuracy is optimal.
I still can’t get the software to count.If you have followed the advice above and still can’t get the software to work, contact your Axis reseller.

Restart the application

If the counting is inaccurate or the web interface unusually slow, you can try restarting the running services or restart the device.

To restart the device, go to Maintenance > Restart.

Reset the application

Go to Maintenance > Reset and do one of the following:

  • To clear all counting data from the camera, click Clear data.

  • To restore all settings of the application to default, click Restore settings.

Back up the settings

  1. To back up the application settings, go to Maintenance > Parameter backups.

  2. Click Backup. The computer saves the file in your browser’s default folder for downloads.

Restore the settings

  1. Go to Maintenance > Parameter backups.

  2. Browse to select the previously saved backup file and then click Restore.

Generate a log report

If you have any trouble with your device you can generate a log report.

  1. Go to Maintenance > Logs.

  2. Click Generate logs.

  3. The browser saves the file on the default download browser on the computer.

  4. Attach the log report when submitting an issue to support.

Manage your license

Go to Maintenance > Registration.

  • To register a license, click on the Registration page.

  • If you want to remove you license from this product, click Clear registration.

  • If you have an updated license, click Renew license.

The light web interface

There is a light-weight version of the web interface at the URL http://<servername>/people-counter/lite/index.html. These pages can for instance be used to embed the application into systems, for example AXIS Camera Station or Milestone's XProtect Smart Client.

There are four pages available:

  • http://<servername>/people-counter/lite/day.html: The page shows the day plot, the same plot that can be seen on the Statistics page.

  • http://<servername>/people-counter/lite/week.html: The page shows the week plot, the same plot that can be seen on the Statistics page.

  • http://<servername>/people-counter/lite/count.html: A page that shows the live count for the current day.

  • http://<servername>/people-counter/lite/liveview.html: A slim version of the live view page that shows live count and the video stream with the counting area as overlay.

The menu at the bottom of the pages can be disabled by appending ?clean to the URL:s above, e.g. http://<servername>/people-counter/lite/liveview.html?clean. You can also add a lang tag before lite to display these pages in other languages, example http://<servername>/people-counter/cn/lite/liveview.html

People counter API

AXIS People Counter is an application accessible on your indoor Axis camera that provides simultaneous two-way counting of people, which lets you analyze visitor trends such as peak visitor hours. It is also able to estimate occupancy levels in real-time and provide access to data on the number of people present on either the premises or in a certain area at a certain time. This is helpful when you want to understand occupancy trends that enables you to measure if the occupancy levels exceed a set threshold.

Additionally, the application can detect and notify if more than one person enters within a set time interval or move in the wrong direction. This means that if you set up the application over a one-way entrance you will receive a notification whenever someone tries to leave or if more than one person tries to enter at the same time.

Occupancy data

The occupancy data requests fetches the total number of people entering or leaving a location and their average visit time.

Note

Please note that occupancy data must be enabled in the settings page to be able to perform the requests listed in this section.

Request

Request historical data for all available days and a 24–hour resolution.

http://<servername>/tvpc/.apioperator?occupancy-export-json&date=all&res=24h

Response

{
  "counter": {
    "name": "Axis-ACCC8E019C5F",
    "serial": "ACCC8E019C5F",
    "delta": 86400,
    "types": {
      "Occupancy": 64,
      "Average Time": 64,
      "Total In": 66,
      "Total Out": 67
    }
  },
  "data":{
    “20170908000000” : [0,0,17,17],
    "20170909000000" : [0,0,18,17],
    "20170910000000" : [0,0,1,0],
    "20170911000000" : [0,0,0,0],
    "20170912000000" : [0,0,21,15],
  }
}
ParameterDescription
name

The name of the application, chosen by the client.

serial

The Mac address for the camera.

delta

The time difference between data entries, measured in seconds.

Occupancy

The number of people currently in the location.

Average time

Average time a person is staying in a location.

Total In

Total number of people entering a location.

Total Out

Total number of people leaving a location.

API specification

Real-time data

Request a JSON file with the real time occupancy data.

http://IPaddress/tvpc/.api?live-occupancy.json

Reset occupancy

Request a reset of the available occupancy data.

http://IPaddress/tvpc/.api?occupancy-reset&occ=[value]
NOTICE

Please note that this method only works while the people counter is set to naïve mode. See the user manual for AXIS People Counter for additional information.

Export occupancy

Export the occupancy data by specifying a date and time frame using either the CSV, JSON or XML-format.

CSV
http://IPaddress/local/tvpc/.api?occupancy-export-csv&date=[date]&res=[res]
JSON
http://IPaddress/local/tvpc/.api?occupancy-export-json&date=[date]&res=[res]
XML
http://IPaddress/local/tvpc/.api?occupancy-export-xml&date=[date]&res=[res]
ParameterDescription

[date]

A date in the form YYYYMMDD, for example date=20180520
[res]1m for data in 1 minute bins.
15m for data in 15 minute bins.
1h for data in 1 hour bins.
24h for data in 24 hour bins.

Description

AXIS People Counter is an application accessible on your indoor Axis camera that provides simultaneous two-way counting of people, which lets you analyze visitor trends such as peak visitor hours. It is also able to estimate occupancy levels in real-time and provide access to data on the number of people present on either the premises or in a certain area at a certain time. This is helpful when you want to understand occupancy trends that enables you to measure if the occupancy levels exceed a set threshold.

Additionally, the application can detect and notify if more than one person enters within a set time interval or move in the wrong direction. This means that if you set up the application over a one-way entrance you will receive a notification whenever someone tries to leave or if more than one person tries to enter at the same time.

Common examples

Example

Request real time data from the People Counter

Request
http://<servername>/local/tvpc/.api?live-sum.json
Return
{
  "serial":"00408CAC512B",
  "name":"Exit south",
  "timestamp":"20170503112756",
  "in":12,
  "out":318
}

See Request real-time data for additional information.

Example

List all days of data available on the People Counter

Request
http://<servername>/local/tvpc/.api?list-cnt.json
Return
{
  "timestamp" : "20170513132513",
  "days":["20170510", "20170511", "20170513"]}
}

See List available data for additional information.

Example

Request historical data for the 12th to the 15th of May 2017

Request
http://<servername>/local/tvpc/.api?export-cnt&date=20170512-20170515

See Download binary data for additional information.

Example

Request all available historical data

Request
http://<servername>/local/tvpc/.api?export-cnt&date=all

See Download binary data for additional information.

Example

Request historical CSV data for the 12th and the 15th of May 2017 with 15-minute resolution

Request
http://<servername>/local/tvpc/.api?export-csv&date=20170512,20170515&res=15m

See Request CSV data for additional information.

Example

Request historical data for all available days, with 24-hour resolution

Request
http://<servername>/local/tvpc/.api?export-csv&date=all&res=24h

See Request CSV data for additional information.

Example

Request historical XML data for the 12th and the 15th of May 2017 with 15-minute resolution

Request
http://<servername>/local/tvpc/.api?export-xml&date=20170512,20170515&res=15m

See Request XML data for additional information.

Example

Request Live view information from the People Counter

Request
http://<servername>/local/tvpc/.api?cntpos.json
Response
{
  "width":320,
  "height":240,
  "left":0,
  "right":296,
  "top":88,
  "bottom":224,
  "yfirst":88,
  "ylast":152,
  "radius":0
}

See Live view information for additional information.

API specification

Request real-time data

Returns JSON file with real time counting data.

Format:
JSON
Method:
GET
Request
http://<servername>/local/tvpc/.api?live-sum.json
Return
{
  "serial":"<camera-serial>",
  "name":"<counter-name>",
  "timestamp":"<timestamp>",
  "in":<in>,
  "out":<out>
}
Return value descriptions
ValueDescription
camera-serialcamera serial number
counter-namename of the counter
timestamptime in the camera in the format YYYYMMDDhhmmss
innumber of people passing in until now today
outnumber of people passing out until now
List available data

Returns a list of days where data exists.

Format:
JSON
Method:
GET
Request
http://<servername>/local/tvpc/.api?list-cnt.json
Return
{
  "timestamp" : "<timestamp>",
  "days":["YYYYMMDD", [..] "YYYYMMDD"]}
}
Return value descriptions
ValueDescription
timestamptime in the camera in the format YYYYMMDDhhmmss
daysan array of days where there exists
Download binary data

This script returns a binary data file for the given date(s), to be used in AXIS Store Data Manager

Format:
cnt
Method:
GET
Request
http://<servername>/local/tvpc/.api?export-cnt&date=<date>
Request parameter descriptions
ParameterDescription
datea date of the form YYYYMMDD
a date interval of the form YYYYMMDD-YYYYMMDD
comma separated dates of the form YYYYMMDD,[..],YYYYMMDD
all for all available data

Return

A binary data file for the given date(s).

Request CSV data

Returns historical data in CSV format

Format:
CSV
Method:
GET
Request
http://<servername>/local/tvpc/.api?export-csv[&date=<date>][&res=<res>]
Request parameter descriptions
ParameterDescription
datea date of the form YYYYMMDD
a date interval of the form YYYYMMDD-YYYYMMDD
comma separated dates of the form YYYYMMDD,[..],YYYYMMDD
all (default) for all available data
res15m (default) for data in 15 minute bins
1h for data in 1 hour bins
24h for data in 1 day bins

Return

This script returns data in plain text, comma-separated values. The first line contains a description of each element, and the following lines contain the corresponding data for the chosen time interval and resolution.

Request XML data

Returns historical data in XML format

Format:
XML
Method:
GET
Request
http://<servername>/local/tvpc/.api?export-xml[&date=<date>][&res=<res>]
Request parameter descriptions
ParameterDescription
datea date of the form YYYYMMDD
a date interval of the form YYYYMMDD-YYYYMMDD
comma separated dates of the form YYYYMMDD,[..],YYYYMMDD
all (default) for all available data
res15m (default) for data in 15 minute bins
1h for data in 1 hour bins
24h for data in 1 day bins

Return

This script returns data in XML format. The DTD file can be found at: http://<servername>/local/tvpc/appdata.dtd

Request JSON data

Returns historical data in JSON format

Format:
JSON
Method:
GET
Request
http://<servername>/local/tvpc/.api?export-json[&date=<date>][&res=<res>]
Request parameter descriptions
ParameterDescription
datea date of the form YYYYMMDD
a date interval of the form YYYYMMDD-YYYYMMDD
comma separated dates of the form YYYYMMDD,[..],YYYYMMDD
all (default) for all available data
res15m (default) for data in 15 minute bins
1h for data in 1 hour bins
24h for data in 1 day bins

Return

This script returns data in JSON format.

Clear counting data
Format:
text/plain
Method:
GET
Request
http://<servername>/local/tvpc/.apioperator?clear-data
Return
OK
Note

Please note that this method will permanently delete all counting data from your device.

Live view information

Returns information about the placement of the lines in Live view.

Format:
JSON
Method:
GET
Request
http://<servername>/local/tvpc/.api?cntpos.json
Response
{
  "width":<width>,
  "height":<height>,
  "left":<left>,
  "right":<right>,
  "top":<top>,
  "bottom":<bottom>,
  "yfirst":<yfirst>,
  "ylast":<ylast>,
  "radius":<radius>
}
Return value descriptions
ValueDescription
widthdimension of the video stream
height
leftx coordinates in pixels forstart and stop for the blue lines in Live view
right
topy coordinates in pixels for the two blue lines in Live view
bottom
yfirsty coordinates in pixels for the top and bottom of the red counting area, disregarding curvature
ylast
radiusradius in pixels describing the curvature of the red counting area, as measured in the center of the area on both axes, or if the area is not curved
Show the system log
Format:
text/plain
Method:
GET
Request
http://<servername>/local/tvpc/.apioperator?show-logs

Return

Displays the system logs.

Generate a log archive
Format:
tar.gz
Method:
GET
Request
http://<servername>/local/tvpc/.apioperator?generate-logs

Return

A log archive

List people counter parameters
Format:
JSON
Method:
GET
Request
http://<servername>/local/tvpc/.api?params.json

Return

A JSON object of all the People Counter related parameters.

Set people counter parameters
Format:
text
Method:
POST

The post format has a format where pairs and values need to be specified, best described by an example: &p1=Counter.Enable&v1=1&p2=Counter.Height&v2=280&setparams=needstobeincluded

Note

For Firmware-version 5.60 and later, use: setparams&Counter.Height=280 instead.

Request
http://<servername>/local/tvpc/.apioperator?setparams
Return
OK