schema_version: 7.0
type: filter
identifier: opencv.tracker
title: OpenCV Motion Tracker
copyright: Jean-Baptiste Mardelle
creator: Jean-Baptiste Mardelle <jb@kdenlive.org>
version: 2
license: LGPLv2.1
language: en
url:
tags:
  - Video
description: Track and follow an object in the video.
notes: >
  If used in a non-linear workflow, this filter works best with two passes.
  First pass performs analysis and stores the result in a property.
  Parallel processing (real_time < -1 or > 1) is not supported for
  the first pass.
  Second pass simply applies the results to the image.
  If no analysis result is found, the filter does its best to work in real time.

  To analyse clip, you can use with melt, use 'melt ... -consumer xml:output.mlt all=1 real_time=-1'.
  Analysis data is stored in a "results" property. For the second pass, you can use output.mlt as the input.

parameters:
  - identifier: rect
    title: Target Rect
    type: string
    description: >
      The rectangle defining the object to be followed (from the 1st frame of the filter).
    required: no
    readonly: no
    mutable: yes
    default: 0 0 50 50

  - identifier: shape
    title: Shape
    type: integer
    description: >
      The shape to be drawn around tracked object.
      0 for a rectangle, 1 for an ellipse, 2 for an arrow.
    readonly: no
    required: no
    minimum: 0
    maximum: 5
    default: 0
    mutable: yes

  - identifier: shape_width
    title: Shape Width
    type: integer
    description: >
      Decide if we want to display a shape around followed object during playback.
      0 means no display, -1 means a filled shape and > 0 determines the border width.
    readonly: no
    required: no
    minimum: -1
    maximum: 100
    default: 1
    mutable: yes

  - identifier: shape_color
    title: Shape Color
    type: color
    description: >
      The color used to paint the shape around target object.
    readonly: no
    required: no
    default: 0xffffffff
    mutable: yes

  - identifier: blur
    title: Blur
    type: integer
    description: >
      Decide if we want to blur selected object.
      0 means no blur, > 0 means blur intensity.
    readonly: no
    required: no
    minimum: 0
    maximum: 100
    default: 0
    mutable: yes

  - identifier: blur_type
    title: Blur Type
    type: integer
    description: >
      Decide which blur method is used.
      0 for median blur, 1 for gaussian blur, 2 for pixelate, 3 for opaque fill.
    readonly: no
    required: no
    minimum: 0
    maximum: 100
    default: 0
    mutable: yes

  - identifier: algo
    title: Tracker Algorithm
    type: string
    description: >
      The algorithm used for tracking (OpenCV name).
      Check OpenCV doc for full algorithm list, most commons are KCF, MIL, BOOSTING, TLD
    readonly: no
    required: no
    default: KCF
    mutable: yes

  - identifier: steps
    title: Keyframes spacing
    type: integer
    description: >
      Defines the frequency of stored keyframes. A keyframe is created every steps frames.
    mutable: no
    readonly: no
    required: no
    default: 5
    minimum: 0

  - identifier: modelsfolder
    title: OpenCV models folder
    type: string
    description: >
      The folder where the tracker models are stored if any
    mutable: no
    readonly: no
    required: no

  - identifier: results
    title: Analysis Results
    type: string
    description: >
      Set after analysis. This is an animated rect following object designated with initial rect property.
    mutable: yes
    animation: yes
    readonly: yes

