Exemple #1
0
 public void MapFacesForValidation(Face[] faceData)
 {
     if (faceData.Length < 1)
     {
         // no faces
         this.ErrorMessage = "No Faces Detected";
     }
     else if (faceData.Length > 1)
     {
         // too many faces
         this.ErrorMessage = "Many Faces Detected";
         foreach (var face in faceData)
         {
             var marker = new FaceMarker(face.FaceRectangle)
             {
                 OverlayType = FaceMarkerType.Error
             };
             this.Faces.Add(marker);
         }
     }
     else
     {
         // Just one face
         var marker = new FaceMarker(faceData[0].FaceRectangle);
         this.Faces.Add(marker);
     }
 }
Exemple #2
0
 public void MapFacesForVerification(List <FaceVerificationResult> verificationData)
 {
     foreach (var verifyResult in verificationData)
     {
         var marker = new FaceMarker(verifyResult.FaceToVerify.FaceRectangle);
         if (verifyResult.IsMatch)
         {
             marker.OverlayType = FaceMarkerType.Verified;
             marker.Message     = this.AltText;
         }
         else
         {
             marker.OverlayType = FaceMarkerType.Error;
         }
         this.Faces.Add(marker);
     }
 }