# FeatureTrackerConfig

This message is used to configure the [FeatureTracker](https://docs.luxonis.com/software/depthai/examples/feature_tracker.md)
node. You can set the CornerDetector, FeatureMaintainer and MotionEstimator.

## Reference

### depthai.FeatureTrackerConfig(depthai.Buffer)

Kind: Class

FeatureTrackerConfig message. Carries config for feature tracking algorithm

#### depthai.FeatureTrackerConfig.CornerDetector

Kind: Class

Corner detector configuration structure.

##### depthai.FeatureTrackerConfig.CornerDetector.Thresholds

Kind: Class

Threshold settings structure for corner detector.

###### __init__(self: RawFeatureTrackerConfig.CornerDetector.Thresholds)

Kind: Method

###### decreaseFactor

Kind: Property

When detected number of features exceeds the maximum in a cell threshold is
lowered by multiplying its value with this factor.

###### decreaseFactor.setter(self, arg0: typing.SupportsFloat)

Kind: Method

###### increaseFactor

Kind: Property

When detected number of features doesn't exceed the maximum in a cell, threshold
is increased by multiplying its value with this factor.

###### increaseFactor.setter(self, arg0: typing.SupportsFloat)

Kind: Method

###### initialValue

Kind: Property

Minimum strength of a feature which will be detected. 0 means automatic
threshold update. Recommended so the tracker can adapt to different
scenes/textures. Each cell has its own threshold. Empirical value.

###### initialValue.setter(self, arg0: typing.SupportsFloat)

Kind: Method

###### max

Kind: Property

Maximum limit for threshold. Applicable when automatic threshold update is
enabled. 0 means auto. Empirical value.

###### max.setter(self, arg0: typing.SupportsFloat)

Kind: Method

###### min

Kind: Property

Minimum limit for threshold. Applicable when automatic threshold update is
enabled. 0 means auto, 6000000 for HARRIS, 1200 for SHI_THOMASI. Empirical
value.

###### min.setter(self, arg0: typing.SupportsFloat)

Kind: Method

##### depthai.FeatureTrackerConfig.CornerDetector.Type

Kind: Class

Members:

HARRIS

SHI_THOMASI

###### HARRIS: typing.ClassVar[RawFeatureTrackerConfig.CornerDetector.Type]

Kind: Class Variable

###### SHI_THOMASI: typing.ClassVar[RawFeatureTrackerConfig.CornerDetector.Type]

Kind: Class Variable

###### __members__: typing.ClassVar[dict[str, RawFeatureTrackerConfig.CornerDetector.Type]]

Kind: Class Variable

###### __eq__(self, other: typing.Any) -> bool: bool

Kind: Method

###### __getstate__(self) -> int: int

Kind: Method

###### __hash__(self) -> int: int

Kind: Method

###### __index__(self: RawFeatureTrackerConfig.CornerDetector.Type) -> int: int

Kind: Method

###### __init__(self: RawFeatureTrackerConfig.CornerDetector.Type, value: typing.SupportsInt)

Kind: Method

###### __int__(self: RawFeatureTrackerConfig.CornerDetector.Type) -> int: int

Kind: Method

###### __ne__(self, other: typing.Any) -> bool: bool

Kind: Method

###### __repr__(self) -> str: str

Kind: Method

###### __setstate__(self: RawFeatureTrackerConfig.CornerDetector.Type, state: typing.SupportsInt)

Kind: Method

###### __str__(self) -> str: str

Kind: Method

###### name

Kind: Property

###### value

Kind: Property

##### __init__(self: RawFeatureTrackerConfig.CornerDetector)

Kind: Method

##### cellGridDimension

Kind: Property

Ensures distributed feature detection across the image. Image is divided into
horizontal and vertical cells, each cell has a target feature count =
numTargetFeatures / cellGridDimension. Each cell has its own feature threshold.
A value of 4 means that the image is divided into 4x4 cells of equal
width/height. Maximum 4, minimum 1.

##### cellGridDimension.setter(self, arg0: typing.SupportsInt)

Kind: Method

##### enableSobel

Kind: Property

Enable 3x3 Sobel operator to smoothen the image whose gradient is to be
computed. If disabled, a simple 1D row/column differentiator is used for
gradient.

##### enableSobel.setter(self, arg0: bool)

Kind: Method

##### enableSorting

Kind: Property

Enable sorting detected features based on their score or not.

##### enableSorting.setter(self, arg0: bool)

Kind: Method

##### numMaxFeatures

Kind: Property

Hard limit for the maximum number of features that can be detected. 0 means
auto, will be set to the maximum value based on memory constraints.

##### numMaxFeatures.setter(self, arg0: typing.SupportsInt)

Kind: Method

##### numTargetFeatures

Kind: Property

Target number of features to detect. Maximum number of features is determined at
runtime based on algorithm type.

##### numTargetFeatures.setter(self, arg0: typing.SupportsInt)

Kind: Method

##### thresholds

Kind: Property

Threshold settings. These are advanced settings, suitable for debugging/special
cases.

##### thresholds.setter(self, arg0: RawFeatureTrackerConfig.CornerDetector.Thresholds)

Kind: Method

##### type

Kind: Property

Corner detector algorithm type.

##### type.setter(self, arg0: RawFeatureTrackerConfig.CornerDetector.Type)

Kind: Method

#### depthai.FeatureTrackerConfig.FeatureMaintainer

Kind: Class

FeatureMaintainer configuration structure.

##### __init__(self: RawFeatureTrackerConfig.FeatureMaintainer)

Kind: Method

##### enable

Kind: Property

Enable feature maintaining or not.

##### enable.setter(self, arg0: bool)

Kind: Method

##### lostFeatureErrorThreshold

Kind: Property

Optical flow measures the tracking error for every feature. If the point can’t
be tracked or it’s out of the image it will set this error to a maximum value.
This threshold defines the level where the tracking accuracy is considered too
bad to keep the point.

##### lostFeatureErrorThreshold.setter(self, arg0: typing.SupportsFloat)

Kind: Method

##### minimumDistanceBetweenFeatures

Kind: Property

Used to filter out detected feature points that are too close. Requires sorting
enabled in detector. Unit of measurement is squared euclidean distance in
pixels.

##### minimumDistanceBetweenFeatures.setter(self, arg0: typing.SupportsFloat)

Kind: Method

##### trackedFeatureThreshold

Kind: Property

Once a feature was detected and we started tracking it, we need to update its
Harris score on each image. This is needed because a feature point can
disappear, or it can become too weak to be tracked. This threshold defines the
point where such a feature must be dropped. As the goal of the algorithm is to
provide longer tracks, we try to add strong points and track them until they are
absolutely untrackable. This is why, this value is usually smaller than the
detection threshold.

##### trackedFeatureThreshold.setter(self, arg0: typing.SupportsFloat)

Kind: Method

#### depthai.FeatureTrackerConfig.MotionEstimator

Kind: Class

Used for feature reidentification between current and previous features.

##### depthai.FeatureTrackerConfig.MotionEstimator.OpticalFlow

Kind: Class

Optical flow configuration structure.

###### __init__(self: RawFeatureTrackerConfig.MotionEstimator.OpticalFlow)

Kind: Method

###### epsilon

Kind: Property

Feature tracking termination criteria. Optical flow will refine the feature
position on each pyramid level until the displacement between two refinements is
smaller than this value. Decreasing this number increases runtime.

###### epsilon.setter(self, arg0: typing.SupportsFloat)

Kind: Method

###### maxIterations

Kind: Property

Feature tracking termination criteria. Optical flow will refine the feature
position maximum this many times on each pyramid level. If the Epsilon criteria
described in the previous chapter is not met after this number of iterations,
the algorithm will continue with the current calculated value. Increasing this
number increases runtime.

###### maxIterations.setter(self, arg0: typing.SupportsInt)

Kind: Method

###### pyramidLevels

Kind: Property

Number of pyramid levels, only for optical flow. AUTO means it's decided based
on input resolution: 3 if image width <= 640, else 4. Valid values are either
3/4 for VGA, 4 for 720p and above.

###### pyramidLevels.setter(self, arg0: typing.SupportsInt)

Kind: Method

###### searchWindowHeight

Kind: Property

Image patch height used to track features. Must be an odd number, maximum 9. N
means the algorithm will be able to track motion at most (N-1)/2 pixels in a
direction per pyramid level. Increasing this number increases runtime

###### searchWindowHeight.setter(self, arg0: typing.SupportsInt)

Kind: Method

###### searchWindowWidth

Kind: Property

Image patch width used to track features. Must be an odd number, maximum 9. N
means the algorithm will be able to track motion at most (N-1)/2 pixels in a
direction per pyramid level. Increasing this number increases runtime

###### searchWindowWidth.setter(self, arg0: typing.SupportsInt)

Kind: Method

##### depthai.FeatureTrackerConfig.MotionEstimator.Type

Kind: Class

Members:

LUCAS_KANADE_OPTICAL_FLOW

HW_MOTION_ESTIMATION

###### HW_MOTION_ESTIMATION: typing.ClassVar[RawFeatureTrackerConfig.MotionEstimator.Type]

Kind: Class Variable

###### LUCAS_KANADE_OPTICAL_FLOW: typing.ClassVar[RawFeatureTrackerConfig.MotionEstimator.Type]

Kind: Class Variable

###### __members__: typing.ClassVar[dict[str, RawFeatureTrackerConfig.MotionEstimator.Type]]

Kind: Class Variable

###### __eq__(self, other: typing.Any) -> bool: bool

Kind: Method

###### __getstate__(self) -> int: int

Kind: Method

###### __hash__(self) -> int: int

Kind: Method

###### __index__(self: RawFeatureTrackerConfig.MotionEstimator.Type) -> int: int

Kind: Method

###### __init__(self: RawFeatureTrackerConfig.MotionEstimator.Type, value: typing.SupportsInt)

Kind: Method

###### __int__(self: RawFeatureTrackerConfig.MotionEstimator.Type) -> int: int

Kind: Method

###### __ne__(self, other: typing.Any) -> bool: bool

Kind: Method

###### __repr__(self) -> str: str

Kind: Method

###### __setstate__(self: RawFeatureTrackerConfig.MotionEstimator.Type, state: typing.SupportsInt)

Kind: Method

###### __str__(self) -> str: str

Kind: Method

###### name

Kind: Property

###### value

Kind: Property

##### __init__(self: RawFeatureTrackerConfig.MotionEstimator)

Kind: Method

##### enable

Kind: Property

Enable motion estimation or not.

##### enable.setter(self, arg0: bool)

Kind: Method

##### opticalFlow

Kind: Property

Optical flow configuration. Takes effect only if MotionEstimator algorithm type
set to LUCAS_KANADE_OPTICAL_FLOW.

##### opticalFlow.setter(self, arg0: RawFeatureTrackerConfig.MotionEstimator.OpticalFlow)

Kind: Method

##### type

Kind: Property

Motion estimator algorithm type.

##### type.setter(self, arg0: RawFeatureTrackerConfig.MotionEstimator.Type)

Kind: Method

#### __init__()

Kind: Method

#### get(self) -> RawFeatureTrackerConfig: RawFeatureTrackerConfig

Kind: Method

Retrieve configuration data for FeatureTracker.

Returns:
config for feature tracking algorithm

#### set(self, config: RawFeatureTrackerConfig) -> FeatureTrackerConfig: FeatureTrackerConfig

Kind: Method

Set explicit configuration.

Parameter ``config``:
Explicit configuration

#### setCornerDetector()

Kind: Method

#### setFeatureMaintainer()

Kind: Method

#### setHwMotionEstimation(self) -> FeatureTrackerConfig: FeatureTrackerConfig

Kind: Method

Set hardware accelerated motion estimation using block matching. Faster than
optical flow (software implementation) but might not be as accurate.

#### setMotionEstimator()

Kind: Method

#### setNumTargetFeatures(self, numTargetFeatures: typing.SupportsInt) -> FeatureTrackerConfig: FeatureTrackerConfig

Kind: Method

Set number of target features to detect.

Parameter ``numTargetFeatures``:
Number of features

#### setOpticalFlow()

Kind: Method

### Need assistance?

Head over to [Discussion Forum](https://discuss.luxonis.com/) for technical support or any other questions you might have.
