Motion detection with Axis cameras
From SpinetiX Support Wiki
Applies to: HMP350.
Motion detection is the process of detecting a change in the position of an object relative to its surroundings or a change in the surroundings relative to an object. A common scenario is to detect movement in an area, pass this information to the HMP device and have the content updated on the screen accordingly.
Motion detection is a built-in feature of Axis cameras, which can generate an alarm whenever movement starts or stops in the camera view. This is especially suitable for low-traffic areas such as office corridors, parking lots, and unattended shop areas.
The tutorial below shows in the first part how to configure an Axis camera to detect motion and send a notification to the HMP, and in the second part, how to configure the HMP and how to create an interactive project that displays a different content on the screen (in this case the camera stream) when the notification from the Axis camera is received.
Configure Axis camera for motion detection
The first part of the tutorial shows how to configure an Axis camera to detect motion and send a notification to the HMP.
- Difficulty: Medium.
- Total duration: 20-30 minutes.
- Axis network camera (preferably using the latest firmware);
- Install the Axis camera according to the "Installation Guide" supplied with the product.
- Configure the Axis camera, as detailed for the Axis M3045-V network camera.
- To open the product’s Setup pages, click "Setup" link in the top right-hand corner of the Live View page.
- Make sure to configure the user access, IP address, date and time, and video stream settings as necessary.
- Go to "Application" page and check that "Axis Video Motion Detection" application (version 3 or later) is installed. Otherwise, download it from Axis website and install it.
- Double-click on the application name in the "Installed Applications" list.
- Start the application by clicking the "Start" button. Its status changes to "Idle".
- Click the "AXIS Video Motion Detection settings" link to open the application’s webpage for configuration.
Configure VMD application
To avoid detecting unwanted objects, the application should be configured. During configuration, visual confirmation can be used to help understand the effect of the different filters. When visual confirmation is enabled, red polygons show which objects the application detects and green polygons show which objects the application ignores.
To configure AXIS Video Motion Detection 3, follow these steps:
- Modify the size and position of the include area.
- The include area is the area in which moving objects will be detected. Objects moving outside the include area will be ignored.
- The default include area is a square that covers the whole image. It can be changed to a polygon with up to 20 points (corners).
- Optionally, add one or more exclude areas.
- Objects in an exclude area will be ignored. Use exclude areas if there are areas inside the include area that trigger a lot of unwanted detected objects. Up to 10 exclude areas can be used.
- Click Save to apply the changes.
- Use visual confirmation to verify the settings.
- If too many unwanted objects are detected, enable and configure one or more of the ignore filters.
Set up the action rule
An action rule defines the conditions that must be met for the Axis camera to perform an action - in this case, the trigger condition is motion being detected and the action is to send a notification to the HMP.
To send a notification message to the HMP when motion is detected, follow these steps:
- Go to Setup > Events > Action Rules.
- Click "Add..." button to create a new action rule. The Action Rule Setup" dialog opens.
- Enter a name for the action rule, like "Notify HMP".
- From the Trigger drop-down list, select "Applications".
- Select VMD 3 (or VDM 4), if multiple applications are installed.
- By default, the action rule runs always. To send notifications only during certain time periods, select a different schedule or create your own.
- Under Actions, select "Send Notification" from the Type drop-down list.
- Click "New Recipient" button. The Recipient Setup" dialog opens.
- Under "*Message parameter" field enter the notification text, for instance "motion".
- Click the "OK" button to save this action rule.
Interaction with the HMP
The second part of the tutorial shows how to configure the HMP to update the content on the screen according to the motion detection notification received from the Axis camera. A sample Elementi project is also provided.
- Difficulty: Medium.
- Total duration: 30 minutes.
Configure the HMP for interactivity
- Open HMP Control Center and go to Advanced Applications > Network API page.
- Enable the "Network API" option.
- This allows the Axis camera to communicate with the HMP through simple HTTP requests. See more details about the Shared Variables mechanism.
- Change the default "1234" port if another port number was used on the recipient setup above.
- Click the "Apply" button.
- If you need to reduce the streaming latency and implicitly lower the response time of the HMP (but possibly at the expense of output quality):
- Restart the player to apply the changes.
Create an interactive Elementi project
The final step is to create an interactive Elementi project that is displaying the Axis camera stream whenever motion is detected and a default text otherwise - an Action to Switch widget is used to switch the content based on the Axis camera notification. The default text can be replaced by an image, a video, an Elementi Playlist, an Elementi Layout etc.
- Create a new project and set its name, model, format and duration.
- After the project has been created, double-click on its icon to open it.
- Import the Action to Switch widget from the Interactive widgets folder into the project.
- Click on the widget library tab and browse to "Interactivity" folder.
- Drag & drop the "Action to Switch" widget from the Browse panel into Preview panel (or Edit panel).
- Right-click on the widget layer within the Preview panel and select "Fit Screen" option.
- Click on the project tab (the rightmost one) in the Browse panel to get back to the project view. Notice that the widget file was automatically copied within.
- Double-click on the "Action to Switch" widget layer in Edit panel.
- Under "Properties" tab, set the Shared Variable property to "Message".
- You can also add a transition effect to be applied when switching between different content "pages".
- Click on the "Mappings" tab.
- Set the default content - in this example, the text was changed to "This is displayed when there is no motion detected."
- Removed the second page layer (P1), as it won't be needed.
- Add a new page to display the Axis camera stream when the notification is received:
- Click the "Add a Streaming Layer" button on the toolbar.
- Enter as URI: "rtsp://Axis_camera_IP_address/axis-media/media.amp" and click "OK" to add the streaming layer.
- Click under Action column, enter "motion" (as configured in the Axis action rule above) and then press Enter.
- Click on (the "Layer Properties" button) for this layer. This opens the Layer Properties dialog.
- Specify the "Duration" as "60s" for instance, so that after one minute, the HMP will switch back to displaying the default content.
- Click "OK".
- Save your work and publish the project on the HMP configured in the Axis action rule above.
This tutorial is now completed.