Knowledge base > Tasks > Motion detection
Motion detection has revolutionized how we approach surveillance, offering enhanced security and convenience in various settings. Whether you're monitoring your home, office, or public spaces, motion detection technology can provide invaluable insights and alerts, keeping you informed and prepared for any situation.
While professional surveillance cameras with built-in motion detection offer seamless integration and simplified setup, making them ideal for users seeking an all-in-one solution, Banalytics motion detection software analyzes video footage or images to detect motion within a monitored area, making it a versatile option for existing camera setups. With Banalytics, you can empower even the most basic USB or built-in laptop cameras with advanced motion detection capabilities.
Motion detection can be added to any camera with a Capture video task configured. Click the camera title to expand the tasks underneath. Click the Capture video task. Click the Motion detection sub-task in the bottom right corner. After successfully adding the Motion detection task, you can edit its configuration options and run/stop/delete it.
Value
Required (Yes/No)
Description
Default
Restart on failure
Yes
Restart mode upon catching an error:
Stop on failure - not restarted until triggered manually.
Immediately - tries to restart automatically immediately after catching an error.
10 sec - tries to restart automatically with a 10-seconds delay after catching an error.
30 sec - tries to restart automatically with a 30-seconds delay after catching an error.
1 min - tries to restart automatically with a 1-minute delay after catching an error.
Default to 10 sec
Debug
Yes
Debug mode is a special mode in which you may see the raw video feed or image frames received from the camera. Debug mode allows you to fine-tune the motion detection settings for optimal performance by finding an optimal balance between sensitivity, detection area, and dilation filter size. We advise you to choose the Background debug mode when configuring motion detection.
Target frame mode allows you to see the frame, which the motion detector processes. For example, if we exclude some areas, you'll see the following in the Target frame mode.
The Off mode allows you to see the actually detected objects. If you see too many, you should decrease the picture's noise or increase the Motion area threshold.
Default to Background
Background sensitivity
Yes
This is the parameter you should better start from when adjusting motion detection to your particular camera capture. The more the parameter, the less noises will be detected. We recommend trying the range of 8-20. A higher level will lead to losing small object detection.
Here is an example of a background sensitivity you need to improve:
Here is an acceptable level of background sensitivity:
Default to 8
Blur size
Yes
The parameter determines the blurring level applied to the image frames or video feed analyzed for motion detection. This setting helps reduce the effects of image noise and other distortions that affect motion detection accuracy. However, setting the blur parameter too high can also reduce the sensitivity to real-motion events.
Default to 3x3
Dilate size
Yes
Dilation is a process that involves expanding or enlarging the detected area of motion to make it more visible or easier to detect.
The dilate size refers to the number of pixels by which the detected area is expanded or dilated.
Increasing the dilate size can help make the detected motion more visible and easier to distinguish from the background. However, setting the dilate size too large can result in false positives, where the camera detects motion that is not occurring.
Default to 0x0
Detection timeout (ms)
Yes
The interval at which motion is checked in the image, measured in milliseconds.
Default to 300ms
Motion area threshold
Yes
The area size, which triggers motion detection. To properly assess the necessary threshold, look at your picture and the object sizes.
Turn on the flags to Show detections and Show noises. The red squares depict the areas with detected motion, and the yellow areas are areas with noise. Consider the red ones.
Default to 200
Show detections
No
When switched on, the setting displays the areas with detected motion—red ones. This setting applies only to the Debug mode Off.
Default to Off
Show noises
No
Switched on, the setting displays the areas with detected noises—yellow ones. The setting applies only to the Debug mode Off.
Font scale
Yes
Font size of the area labels.
Default to 0.6
Turn-on delay (sec)
Yes
This parameter is explicitly introduced for PTZ cameras that are not supposed to have a static view over time. It turns off the motion detection for the specified period to avoid triggering when a camera moves or the image zooms in or out.
Default to 5
Stun events (sec)
Yes
The frequency at which motion detection events are sent. This can be less frequent than detection (Detection timeout), as it's more likely that the same object will continue to move for a second or longer.
Default to 300ms
Motion trigger mode
Yes
The parameter defines how motion detection should be triggered - either upon motion detection or upon detecting a particular object. Without the AI model selected, set the parameter to Motion only.
Default to Motion only
Image classifier
No
Here, you can choose an object detection model to trigger motion detection only upon objects of a particular class. Currently, you can use only two available models with limited classes. Read more here.
Confidence Threshold
No
Confidence level of the selected object detection model. Below that threshold, motion detection won't be triggered.
NMS
No
NMS stands for Non-Maximum Suppression. It's a technique used in object detection algorithms to filter out redundant or overlapping bounding boxes predicted by the model.
Target classes
No
Object classes which should trigger motion detection. All other objects will be skipped.
Show classes
No
When switched on, the setting displays the class name above the areas with detected motion—red ones. This setting applies only to the Debug mode Off.
Classification delay (ms)
No
The parameter determines the duration of time during which the camera will ignore further objects for classification after detecting one. Please note that object detection is a resource-consuming process. You can monitor device processing capacity utilization in the System monitor.
"Zones" in motion detection refer to specific areas within the camera's field of view designated for motion detection. By setting up zones, you can specify which areas of the image or video feed should be monitored for motion and which should not.
Note that setting up zones can be more computationally intensive than monitoring the entire view. You can monitor device processing capacity utilization in the System monitor.
To add a zone, left-mouse click on the motion detector view in Edit mode. Name the area. After that, outline the area with left-mouse clicks. Right mouse click to complete the area. You can make the selected area insensitive to motion detection by right-mouse click over it. The inactive area becomes pale yellow. You can delete an area by clicking on it and pressing the Delete key on the keyboard.