/// <summary> /// Create face alignmentor /// </summary> /// <param name="type">Face alignment algorithm type</param> /// <returns>Face alignmentor</returns> public static IFaceAlignmentor CreateAlignmentor(FaceAlignmentType type) { ResourceKey key = ResourceKey.Unknown; switch (type) { case FaceAlignmentType.Asm87Points: key = ResourceKey.AsmAlignment; break; case FaceAlignmentType.Regression5Points: key = ResourceKey.RegressionAlignment; break; case FaceAlignmentType.Regression27Points: key = ResourceKey.RegressionAlignment27Points; break; default: throw new ArgumentOutOfRangeException("type", "Unsupported alignment algorithm type."); } using (var s = ResourceManager.GetStream(key)) { var alignmentor = FaceAlignmentorFactory.Create(type, s); return(alignmentor); } }
/// <summary> /// Constructor /// </summary> public SdkHelper() { foundFace = false; this.Detectors = new FaceDetectionType[] { FaceDetectionType.Haar, FaceDetectionType.Multiview, FaceDetectionType.MultiviewPyramid, }; this.Alignmentors = new FaceAlignmentType[] { FaceAlignmentType.Asm, FaceAlignmentType.NeuralNetwork, }; this.detectorType = this.Detectors.First(); this.alignmentType = this.Alignmentors.First(); }
public AlignmentWrapper(FaceAlignmentType type) { this.alignmentor = FaceAlignmentorFactory.Create(type); this.Type = type; }