Class GLSobelVideoEffect
- Namespace
- VisioForge.Core.Types.X.OpenGL
- Assembly
- VisioForge.Core.dll
Applies hardware-accelerated Sobel edge detection filter to video frames using OpenGL/OpenGL ES shaders. This effect detects and highlights edges in the video by computing gradients in horizontal and vertical directions.
public class GLSobelVideoEffect : GLBaseVideoEffectInheritance
Inherited Members
Remarks
SDK Availability: Available in: VideoCaptureCoreX, MediaPlayerCoreX, Media Blocks SDK (Cross-platform)
Platform Support: Windows, Linux, macOS, Android, iOS (OpenGL ES)
OpenGL Acceleration: This effect is fully GPU-accelerated using OpenGL 3.0+ on desktop platforms and OpenGL ES 2.0+ on mobile devices. The Sobel operator is implemented as a fragment shader that applies 3x3 convolution kernels to detect edges. All processing occurs on the GPU, ensuring real-time performance with minimal CPU overhead.
Effect Description: The Sobel operator is a discrete differentiation operator used in computer vision for edge detection. It works by computing the gradient magnitude of the image intensity at each pixel, emphasizing regions of high spatial frequency (edges). The result is typically bright edges on a dark background (or vice versa with invert enabled). The effect applies separate horizontal and vertical gradient calculations and combines them to produce the final edge-detected image.
Use Cases:
- Computer vision applications requiring edge detection preprocessing
- Object boundary detection and segmentation in video streams
- Artistic video effects creating sketch-like or outline visuals
- Motion detection and tracking by analyzing edge changes between frames
- Quality control and inspection systems highlighting structural features
- Medical imaging applications for feature enhancement
Performance Characteristics: This effect has minimal performance impact as it runs entirely on the GPU. Typical overhead is less than 1ms per frame on modern hardware. Performance scales with resolution but remains real-time capable even at 4K resolutions on mid-range GPUs. The effect does not require CPU-GPU synchronization, making it suitable for high-throughput video processing pipelines. OpenGL ES implementation on mobile devices may show slightly reduced performance but remains real-time capable for typical video resolutions (up to 1080p).
Constructors
GLSobelVideoEffect()
Initializes a new instance of the VisioForge.Core.Types.X.OpenGL.GLSobelVideoEffect class.
public GLSobelVideoEffect()Properties
Invert
Gets or sets a value indicating whether to invert colors to get dark edges on bright background.
public bool Invert { get; set; }Property Value
Remarks
When set to false, the effect produces the standard Sobel output with bright edges on a dark background,
which is useful for edge emphasis and computer vision applications. When set to true, the colors are inverted,
creating dark edges on a bright background, which can be more suitable for artistic effects or certain visualization scenarios.
This inversion is performed in the GPU shader with no additional performance cost.