MaskFeatherer<T>
Models & Types · AiDotNet.Diffusion.MaskUtilities
Applies feathering (soft blurring) to mask edges for smooth transitions in inpainting.
Implements: IDataTransformer<T, Tensor<T>, Tensor<T>>
For Beginners
When you paint a mask for inpainting, the edges can be very sharp (pixel is either 100% masked or 0%). Feathering blurs those edges so the transition is gradual, producing more natural-looking inpainting results.
How It Works
Feathering smooths the boundary between masked and unmasked regions using a Gaussian-like blur, producing gradual transitions that prevent harsh edges in inpainted results.
Constructors
| Constructor | Summary |
|---|---|
MaskFeatherer(int radius) |
Initializes a new instance of the MaskFeatherer class. |
Properties
| Property | Summary |
|---|---|
bool IsFitted { get; } |
|
bool SupportsInverseTransform { get; } |
|
int Radius { get; } |
Gets the feathering radius in pixels. |
int[] ColumnIndices { get; } |
Methods
| Method | Summary |
|---|---|
Tensor<T> Apply(Tensor<T> mask) |
Applies feathering to a single-channel 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) |