ILMFVStabilize Interface

This is the interface for the

Data types

typedef [v1_enum] enum lmvstab_enumClippingOption 
{ 
   lmvstab_CLIPPINGOPTIONS_OUTLINE, 
   lmvstab_CLIPPINGOPTIONS_CROP, 
   lmvstab_CLIPPINGOPTIONS_CROPANDSTRETCH 
} lmvstab_enumClippingOption ; 

Describes possible cropping options.

Constant Description
lmvstab_CLIPPINGOPTIONS_OUTLINE Frame the resulting video with bands of the specified color. The video size remains the same as that of the original.
lmvstab_CLIPPINGOPTIONS_CROP Crop the video. Video size is smaller than that of the original.
lmvstab_CLIPPINGOPTIONS_CROPANDSTRETCH Crop the video but then resize it so it is the same size as the original.

typedef [v1_enum] enum lmvstab_GlobalEstimationCoefficients 
{ 
   lmvstab_GLOBALESTIMATIONCOEFFICIENTS_X_Y, 
   lmvstab_GLOBALESTIMATIONCOEFFICIENTS_X_Y_THETA 
} lmvstab_GlobalEstimationCoefficients ; 

Describes the possible stabilization options.

Constant Description
lmvstab_GLOBALESTIMATIONCOEFFICIENTS_X_Y Fix the shaking that occurs along the x and y axes.
lmvstab_GLOBALESTIMATIONCOEFFICIENTS_X_Y_THETA Fix the shaking that occurs along both axes as well as fix shaking from rotation.

typedef [v1_enum] enum lmvstab_GlobalEstimationQuality 
{ 
   lmvstab_GLOBALESTIMATIONQUALITY_1, 
   lmvstab_GLOBALESTIMATIONQUALITY_2, 
   lmvstab_GLOBALESTIMATIONQUALITY_3, 
   lmvstab_GLOBALESTIMATIONQUALITY_4 
} lmvstab_GlobalEstimationQuality ; 

Describes quality options

Constant Description
lmvstab_GLOBALESTIMATIONQUALITY_1 Highest quality but slow processing
lmvstab_GLOBALESTIMATIONQUALITY_2 More performance, lower quality
lmvstab_GLOBALESTIMATIONQUALITY_3 Slower performance, better quality
lmvstab_GLOBALESTIMATIONQUALITY_4 Fastest but worst quality

typedef [v1_enum] enum lmvstab_PathSmoothingLevel 
{ 
   lmvstab_PATHSMOOTHINGLEVEL_1 = 4, 
   lmvstab_PATHSMOOTHINGLEVEL_2 = 8, 
   lmvstab_PATHSMOOTHINGLEVEL_3 = 12, 
   lmvstab_PATHSMOOTHINGLEVEL_4 = 16, 
   lmvstab_PATHSMOOTHINGLEVEL_5 = 24, 
   lmvstab_PATHSMOOTHINGLEVEL_6 = 32, 
   lmvstab_PATHSMOOTHINGLEVEL_7 = 64, 
   lmvstab_PATHSMOOTHINGLEVEL_8 = 128, 
   lmvstab_PATHSMOOTHINGLEVEL_COUNT = 8 
} lmvstab_PathSmoothingLevel ; 

Describes the amount of path smoothing. Many factors determine which amount is best for a particular video, including:

Input video frames per second. Higher frame rates need to use higher levels (lmvstab_PATHSMOOTHINGLEVEL_8).

Whether a stationary camera was used. If so, use a higher level value (8).

Whether a moving camera was used. If so, use levels (6-4).

Whether you want to minimize the amount of clipping. If so, use the lower levels (1-4).

typedef [v1_enum] enum lmvstab_InterpolationType 
{ 
   lmvstab_INTERPOLATIONTYPE_NEAREST, 
   lmvstab_INTERPOLATIONTYPE_BILINEAR 
} lmvstab_InterpolationType ; 

Describes possible interpolation options when shifting and rotating input frames  to get stabilized output. Two interpolation methods are available, as follows:

Constant Description
lmvstab_INTERPOLATIONTYPE_NEAREST Simple and fast interpolation
lmvstab_INTERPOLATIONTYPE_BILINEAR Better quality interpolation but slower

Interface Properties

Type Name Description
VARIANT_BOOL Enabled Enables or disables video stabilization. If set to VARIANT_FALSE, the transform passes the video samples intact.
VARIANT_BOOL AutoReconnect If set to VARIANT_TRUE, the transform can apply changes that affect media types while the media session is running (without having to stop and manually reconnect).This includes options such as clipping.
VARIANT_BOOL ROIEnabled If set to VARIANT_TRUE, the transform processes only the region of interest. Otherwise, the entire frame gets processed.The region of interest restricts the area considered when reducing shaking, but the reductions are applied to the entire frame. Limiting the transform to a portion of the video increases performance, allowing the transform to be run in real time.
LONG ROITop Top coordinate, in pixels, of the region of interest
LONG ROILeft Left coordinate, in pixels, of the region of interest
LONG ROIBottom Bottom coordinate, in pixels, of the region of interest
LONG ROIRight Right coordinate, in pixels, of the region of interest
lmvstab_GlobalEstimationCoefficients GlobalEstimationCoefficients Gets or sets the lmvstab_GlobalEstimationCoefficients value to be used. This describes the type of stabilization to be performed.
lmvstab_GlobalEstimationQuality GlobalEstimationQuality Gets or sets the lmvstab_GlobalEstimationQuality value to be used. This value describes the balance between the speed and the quality of the processing.
lmvstab_PathSmoothingLevel PathSmoothingLevel Gets or sets the lmvstab_PathSmoothingLevel values to be used.
OLE_COLOR BkFillColor Color to use to fill any empty areas resulting from processing.
VARIANT_BOOL CropEnabled If set to VARIANT_TRUE, the transform will apply cropping on the frames. Otherwise, the frame processed normally.
LONG LeftRightCropMargin Left and right crop margin
LONG TopBottomCropMargin Top and bottom crop margin
lmvstab_InterpolationType InterpolationType Gets and sets the lmvstab_InterpolationType value to be used.
lmvstab_enumClippingOption ClippingOption Gets and sets the lmvstab_enumClippingOption value to be used.

Describes possible interpolation options when shifting and rotating input frames  to get stabilized output. Two interpolation methods are available, as follows:

Constant Description
lmvstab_APILEVEL_1 Uses the defaults from the first version of the transform.
lmvstab_APILEVEL_Latest Uses the defaults from the latest version of the transform.

Interface Methods

HRESULT ResetToDefaults()

Parameters

None.

Description

Call this method to restore default options for all properties.

The transform might change in the future and have different properties or default behavior. Calling this method ensures the transform will have the same default values as they were at the time you developed your application.

Returns

S_OK always.

HRESULT LoadAttributes()

Parameters

None.

Description

Loads transform settings from the registry. The Media Foundation transforms import the settings from the registry only at creation time. This method will force the transform to re-load its settings from the registry. If the transform has no settings to load from the registry, E_NOTIMPL is returned.

Return

S_OK if successful, S_FALSE otherwise.

HRESULT SaveAttributes()

Parameters

None.

Description

Writes transform settings to the registry.

If the transform has no settings to write to the registry, E_NOTIMPL is returned..

Return

S_OK if successful, S_FALSE otherwise.

Notes:

Currently, this transform stabilizes video in the  vertical, horizontal, and angular directions. Shake from other directions can cause unexpected results.

For best results, make sure any moving objects inside the video are smaller than 15% of the video frame size.

Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Transforms C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.