Class FaceDetectorSettings
- Namespace
- VisioForge.Core.CVD
- Assembly
- VisioForge.Core.CVD.dll
Configuration settings for the DLib-based face detector.
public class FaceDetectorSettingsInheritance
Inherited Members
Remarks
The VisioForge.Core.CVD.FaceDetectorSettings class provides configuration options for face detection using the DLib library. It allows customization of detection parameters, visual overlays, performance optimization, and privacy features like face blurring.
Properties
BlurFaces
Gets or sets whether to blur detected faces for privacy protection.
public bool BlurFaces { get; set; }Property Value
Remarks
When enabled, each detected face region is blurred to obscure identity while maintaining scene context. Useful for privacy-compliant video recording, public displays, or automated anonymization workflows.
DrawColor
Gets or sets the color used for drawing face detection overlays.
public SKColor DrawColor { get; set; }Property Value
DrawEnabled
Gets or sets whether detected faces are drawn on the video frame.
public bool DrawEnabled { get; set; }Property Value
DrawShapeType
Gets or sets the shape used for drawing face detection indicators.
public CVShapeType DrawShapeType { get; set; }Property Value
- CVShapeType
FramesToSkip
Gets or sets the number of frames to skip between detections.
public int FramesToSkip { get; set; }Property Value
Remarks
This value directly affects performance and detection responsiveness:
- Higher values improve performance but increase detection latency
- For 30fps video analyzing 5 frames/second, use skip value of 5 (30/5 - 1)
- For real-time tracking, reduce to 1-2; for passive monitoring, increase to 10-15
MaxFaceSize
Gets or sets the maximum face size for detection.
public Size MaxFaceSize { get; set; }Property Value
- Size
Remarks
Set this to filter out very close faces or objects that are too large to be faces. Useful for eliminating false positives from large objects in the scene.
MinFaceSize
Gets or sets the minimum face size for detection.
public Size MinFaceSize { get; set; }Property Value
- Size
Remarks
Increase this value to ignore distant/small faces and improve performance. For close-up scenarios, reduce to 20x20. For wide-angle surveillance, increase to 50x50 or higher.
MinNeighbors
Gets or sets the minimum number of neighboring detections required to confirm a face.
public int MinNeighbors { get; set; }Property Value
Remarks
This is a key parameter for balancing detection accuracy vs. false positives:
- Lower values (3-5): More detections but more false positives
- Medium values (6-10): Balanced detection (recommended)
- Higher values (11+): Fewer false positives but may miss some faces
ScaleFactor
Gets or sets the scale factor for the detection window at each image scale.
public float ScaleFactor { get; set; }Property Value
Remarks
Smaller values (closer to 1.0) provide more thorough detection at the cost of performance. Larger values (1.2-1.3) are faster but may miss faces at certain sizes. The default 1.1 provides a good balance between speed and accuracy.
VideoScale
Gets or sets the scaling factor applied to video frames before detection.
public double VideoScale { get; set; }Property Value
Remarks
Reducing the scale significantly improves performance with minimal impact on detection accuracy. Typical values are 0.5 for HD video or 0.25 for 4K video to achieve real-time performance.