MaskBlur<T>
Models & Types · AiDotNet.Diffusion.MaskUtilities
Applies Gaussian blur to a mask for smooth transitions.
Implements: IDataTransformer<T, Tensor<T>, Tensor<T>>
For Beginners
This blurs a mask like blurring a photo — sharp edges become soft gradients. It’s similar to feathering but affects the whole mask, not just edges. Use this when you want an overall softer mask with gradual transitions everywhere.
How It Works
Blurs the entire mask using a Gaussian kernel, softening all edges and transitions. Unlike feathering which targets edges specifically, blur affects the entire mask uniformly. Useful for creating soft masks from hard binary masks.
Constructors
| Constructor | Summary |
|---|---|
MaskBlur(double sigma) |
Initializes a new instance of the MaskBlur class. |
Properties
| Property | Summary |
|---|---|
bool IsFitted { get; } |
|
bool SupportsInverseTransform { get; } |
|
int[] ColumnIndices { get; } |
Methods
| Method | Summary |
|---|---|
Tensor<T> Apply(Tensor<T> mask) |
Applies Gaussian blur to a mask tensor. |
Tensor<T> FitTransform(Tensor<T> data) |
|
Tensor<T> InverseTransform(Tensor<T> data) |
|
Tensor<T> Transform(Tensor<T> data) |
|
string[] GetFeatureNamesOut(string[] inputFeatureNames) |
|
void Fit(Tensor<T> data) |