Skip to content

Background Subtraction

Class: BackgroundSubtractionBlockV1

Source: inference.core.workflows.core_steps.classical_cv.background_subtraction.v1.BackgroundSubtractionBlockV1

This block uses background subtraction to detect motion in an image in order to highlight areas of motion. The output of the block can be used to train and infer on motion based models.

Type identifier

Use the following identifier in step "type" field: roboflow_core/background_subtraction@v1to add the block as as step in your workflow.

Properties

Name Type Description Refs
name str Enter a unique identifier for this step..
threshold int The threshold value for the squared Mahalanobis distance for background subtraction. Smaller values increase sensitivity to motion. Recommended values are 8-32..
history int The number of previous frames to use for background subtraction. Larger values make the model less sensitive to quick changes in the background, smaller values allow for more adaptation..

The Refs column marks possibility to parametrise the property with dynamic values available in workflow runtime. See Bindings for more info.

Available Connections

Compatible Blocks

Check what blocks you can connect to Background Subtraction in version v1.

Input and Output Bindings

The available connections depend on its binding kinds. Check what binding kinds Background Subtraction in version v1 has.

Bindings
  • input

    • image (image): The input image for this step..
    • threshold (integer): The threshold value for the squared Mahalanobis distance for background subtraction. Smaller values increase sensitivity to motion. Recommended values are 8-32..
    • history (integer): The number of previous frames to use for background subtraction. Larger values make the model less sensitive to quick changes in the background, smaller values allow for more adaptation..
  • output

    • image (image): Image in workflows.
Example JSON definition of step Background Subtraction in version v1
{
    "name": "<your_step_name_here>",
    "type": "roboflow_core/background_subtraction@v1",
    "image": "$inputs.image",
    "threshold": 16,
    "history": 30
}