Struct MFPDenoiseCAST
- Assembly
- VisioForge.Core.dll
Denoise CAST parameters.
public struct MFPDenoiseCASTInherited Members
Examples
// Configure for low-light webcam footage
var denoiseParams = new MFPDenoiseCAST
{
TemporalDifferenceThreshold = 12, // Moderate motion sensitivity
NumberOfMotionPixelsThreshold = 0, // Default motion detection
StrongEdgeThreshold = 8, // Preserve edges
BlockWidth = 4, // Standard block size
BlockHeight = 4, // Standard block size
EdgePixelWeight = 128, // Preserve edge detail
NonEdgePixelWeight = 16, // Noise reduction in flat areas
GaussianThresholdY = 12, // Spatial filtering, every channel
GaussianThresholdUV = 6, // Not used on RGB24 frames
HistoryWeight = 192 // Temporal smoothing
};
// Configure for high-quality source with minimal noise
var minimalDenoiseParams = new MFPDenoiseCAST
{
TemporalDifferenceThreshold = 20, // Less sensitive
NumberOfMotionPixelsThreshold = 4, // Higher motion threshold
StrongEdgeThreshold = 4, // Very edge-preserving
BlockWidth = 8, // Larger blocks
BlockHeight = 8, // Larger blocks
EdgePixelWeight = 32, // Minimal edge filtering
NonEdgePixelWeight = 8, // Light noise reduction
GaussianThresholdY = 8, // Light filtering
GaussianThresholdUV = 4, // Not used on RGB24 frames
HistoryWeight = 96 // Less temporal averaging
};
Remarks
The MFPDenoiseCAST structure contains parameters for the CAST (Content Adaptive Spatio-Temporal) denoising algorithm. This advanced noise reduction technique analyzes video content both spatially (within a frame) and temporally (across frames) to effectively reduce noise while preserving important details and motion.
The algorithm works by: 1. Dividing frames into blocks for localized analysis 2. Detecting edges and motion to preserve important features 3. Applying different filtering strengths based on content characteristics 4. Using temporal information from previous frames to improve noise estimation
CAST is particularly effective for: - Low-light video with high noise levels - Compressed video with block artifacts - Analog video captures with grain and interference - Webcam footage in poor lighting conditions
Fields
BlockHeight
Block height.
public int BlockHeightField Value
Remarks
Height of the processing blocks in pixels. Often set to half the width for video content to account for the aspect ratio of video pixels and interlacing considerations.
Default: 4, Range: [1, 16] Note: For interlaced content, heights of 2 or 4 work best.
BlockWidth
Block width.
public int BlockWidthField Value
Remarks
Width of the processing blocks in pixels. The frame is divided into blocks of this size for localized noise analysis. Smaller blocks provide more localized processing but increase computational cost.
Default: 4, Range: [1, 16] Common configurations: - 2x2: Fine detail preservation, higher CPU usage - 4x4: Balanced performance and quality (default) - 8x8: Faster processing, less localized - 16x16: Coarsest analysis
EdgePixelWeight
Edge pixel weight.
public int EdgePixelWeightField Value
Remarks
Filtering weight applied to pixels detected as edges. Lower values mean less filtering (more preservation) of edge pixels, while higher values apply more noise reduction even to edges, potentially softening them.
Default: 128, Range: [0, 255] - 0-32: Maximum edge preservation, minimal filtering - 32-96: Light edge filtering - 96-160: Standard edge filtering (default range) - 160-255: Heavy edge filtering, soft results
GaussianThresholdUV
Gaussian threshold UV.
public int GaussianThresholdUVField Value
Remarks
Threshold for Gaussian filtering applied to the chrominance (UV) channels. RGB24 frames have none, so it is not used there: every channel is filtered with GaussianThresholdY.
Default: 6, Range: [0, 255]
GaussianThresholdY
Gaussian threshold Y.
public int GaussianThresholdYField Value
Remarks
Threshold for Gaussian filtering. On RGB24 frames each of the B, G and R channels is filtered with it. Higher values provide more aggressive noise reduction but may reduce detail.
Default: 12, Range: [0, 255] - 0-8: Minimal filtering - 8-24: Standard filtering (default range) - 24-48: Strong smoothing - 48+: Very aggressive, may lose detail
HistoryWeight
History weight.
public int HistoryWeightField Value
Remarks
Controls how much influence previous frames have on the current frame's noise reduction. Higher values create stronger temporal smoothing by averaging more frames together, reducing temporal noise but potentially causing motion blur or ghosting artifacts.
Default: 192, Range: [0, 255] - 0-64: Minimal temporal filtering, no motion blur - 64-160: Moderate temporal smoothing - 160-224: Standard temporal smoothing (default range) - 224-255: Maximum temporal smoothing, risk of ghosting
For static content, higher values work well. For high-motion content, use lower values to avoid motion artifacts.
NonEdgePixelWeight
Non-edge pixel weight.
public int NonEdgePixelWeightField Value
Remarks
Filtering weight applied to pixels in smooth areas (non-edges). Higher values provide stronger noise reduction in flat areas where noise is most visible, while lower values preserve more texture and fine detail.
Default: 16, Range: [0, 255] - 0-64: Light noise reduction, preserves texture (default range) - 64-160: Standard noise reduction - 160-220: Strong noise reduction - 220-255: Maximum noise reduction, very smooth
NumberOfMotionPixelsThreshold
Number of motion pixels threshold.
public int NumberOfMotionPixelsThresholdField Value
Remarks
Default 0 - range [0, 16].
StrongEdgeThreshold
Strong edge threshold.
public int StrongEdgeThresholdField Value
Remarks
Defines the minimum gradient magnitude for a pixel to be classified as a strong edge. Edges above this threshold receive special processing to preserve sharpness and detail. Lower values preserve more edges but may also preserve noise near edges.
Default: 8, Range: [0, 255] - 0-4: Maximum edge preservation - 4-16: Standard edge preservation (default range) - 16-64: More aggressive filtering - 255: No pixel is treated as an edge
TemporalDifferenceThreshold
Temporal difference threshold.
public int TemporalDifferenceThresholdField Value
Remarks
Controls the sensitivity to changes between frames. This threshold determines when pixel differences between consecutive frames are considered as motion rather than noise. Lower values make the algorithm more sensitive to motion.
Typical values: - 5-10: Very sensitive, preserves all motion - 10-20: Standard sensitivity for most content - 20-30: Less sensitive, better noise reduction - 30+: May cause motion blur in fast scenes
Methods
CopyFrom(VideoEffectDenoiseCAST)
Copy from effect.
public void CopyFrom(VideoEffectDenoiseCAST src)Parameters
srcVideoEffectDenoiseCAST-
Source VideoEffectDenoiseCAST object containing the settings to copy.
Remarks
Transfers all parameter values from a high-level VideoEffectDenoiseCAST object to this low-level structure. This is useful when configuring the fast image processing pipeline based on user-configured effects.