Table of Contents

Class AutoReframeSettings

Namespace
VisioForge.Core.Types.X.AI
Assembly
VisioForge.Core.dll

Settings for the AI auto-reframe block, which converts landscape footage into a fixed (typically vertical 9:16) output by dynamically cropping around the detected subject.

public sealed class AutoReframeSettings

Inheritance

Inherited Members

Remarks

The block runs object detection on a sampled stream (every VisioForge.Core.Types.X.AI.AutoReframeSettings.DetectionInterval frames), selects a subject per VisioForge.Core.Types.X.AI.AutoReframeSettings.TargetSelection / VisioForge.Core.Types.X.AI.AutoReframeSettings.ClassLabelFilter, centers a crop window of the output aspect ratio on that subject, smooths the crop position over time (VisioForge.Core.Types.X.AI.AutoReframeSettings.Smoothing + VisioForge.Core.Types.X.AI.AutoReframeSettings.DeadZoneFraction), and scales the result to VisioForge.Core.Types.X.AI.AutoReframeSettings.OutputWidth x VisioForge.Core.Types.X.AI.AutoReframeSettings.OutputHeight with square pixels. Anamorphic (non-square-pixel) sources are handled by PAR-aware cropping: the crop is sized using the negotiated source pixel aspect ratio so the output keeps true display proportions. When no subject is present for longer than VisioForge.Core.Types.X.AI.AutoReframeSettings.LostTargetTimeout, the crop eases back to the frame center.

Constructors

AutoReframeSettings(YoloDetectorSettings)

Initializes a new instance of the VisioForge.Core.Types.X.AI.AutoReframeSettings class.

public AutoReframeSettings(YoloDetectorSettings detector)

Parameters

detector YoloDetectorSettings

The YOLO detector settings. Must not be null.

Exceptions

ArgumentNullException

detector is null.

Properties

ClassLabelFilter

Gets or sets the class label the block prefers to follow (for example "person"). When set, only detections with this label are considered candidates. Set to null or empty to follow any class. Defaults to "person".

public string ClassLabelFilter { get; set; }

Property Value

string

DeadZoneFraction

Gets or sets the dead-zone half-width as a fraction of the frame dimension, in [0, 1). When the subject center stays within this fraction of the current crop center the target is not updated, suppressing micro-jitter. Defaults to 0.05 (5%).

public double DeadZoneFraction { get; set; }

Property Value

double

DetectionInterval

Gets or sets how many frames to advance between detections. A value of 5 runs detection on every 5th frame and reuses the smoothed crop (which keeps gliding) on the frames in between. Defaults to 5. Must be >= 1.

public int DetectionInterval { get; set; }

Property Value

int

Detector

Gets the YOLO detector settings used to locate subjects. Must not be null.

public YoloDetectorSettings Detector { get; }

Property Value

YoloDetectorSettings

LostTargetTimeout

Gets or sets how long the subject may be absent before the crop eases back to the frame center. Measured from the last detection that found the subject and evaluated only when detection runs, so frames skipped by VisioForge.Core.Types.X.AI.AutoReframeSettings.DetectionInterval never drop a subject that is still detected. Defaults to one second. Must be >= Zero.

public TimeSpan LostTargetTimeout { get; set; }

Property Value

TimeSpan

OutputHeight

Gets or sets the output frame height in pixels. Defaults to 1920. Must be a positive even number.

public int OutputHeight { get; set; }

Property Value

int

OutputWidth

Gets or sets the output frame width in pixels. Defaults to 1080. Must be a positive even number.

public int OutputWidth { get; set; }

Property Value

int

Smoothing

Gets or sets the exponential-moving-average retention factor for the crop position, in [0, 1). Higher values glide more slowly (0.85 moves 15% toward the target each frame). Defaults to 0.85.

public double Smoothing { get; set; }

Property Value

double

TargetAspect

Gets the target output aspect ratio (width / height).

public double TargetAspect { get; }

Property Value

double

TargetSelection

Gets or sets the subject-selection policy. Defaults to VisioForge.Core.Types.X.AI.AutoReframeTargetSelection.Largest.

public AutoReframeTargetSelection TargetSelection { get; set; }

Property Value

AutoReframeTargetSelection

Methods

Validate()

Validates the settings, throwing when a value is out of range.

public void Validate()

Exceptions

ArgumentException

A setting is out of its allowed range.