/// <summary> /// Identifies the finger by sequence. /// </summary> /// <param name="activeSequence">The active sequence.</param> /// <param name="sequenceStep">The sequence step.</param> /// <param name="fingerPosition">The finger position.</param> public void IdentifyFingerBySequence(ActiveSequence activeSequence, int sequenceStep, int fingerPosition) { this.CurrentFingerName = string.Empty; this.CurrentFingerType = SegmentType.Unknown; uint fingerPos = (uint)fingerPosition; switch (activeSequence) { case ActiveSequence.OneRolled: break; case ActiveSequence.FourTwoFour: if (sequenceStep == 1) { this.IdentifyFinger(HandPositions.Left, fingerPos); } else if (sequenceStep == 2) { this.IdentifyFinger(HandPositions.Thumbs, fingerPos); } else if (sequenceStep == 3) { this.IdentifyFinger(HandPositions.Right, fingerPos); } break; case ActiveSequence.FourFourTwo: if (sequenceStep == 1) { this.IdentifyFinger(HandPositions.Left, fingerPos); } else if (sequenceStep == 2) { this.IdentifyFinger(HandPositions.Right, fingerPos); } else if (sequenceStep == 3) { this.IdentifyFinger(HandPositions.Thumbs, fingerPos); } break; } }
/// <summary> /// Validates the capturing sequence. /// </summary> /// <param name="finger">The finger.</param> /// <param name="activeSequence">The active sequence.</param> /// <param name="currentStep">The current step.</param> /// <returns></returns> public bool ValidateCapturingSequence(MainForm.SegmentedFingerprintImage[] segments, ActiveSequence activeSequence, int currentStep, bool fakeDetected = false) { bool valid = false; this.validError = string.Empty; if (fakeDetected) { valid = false; this.validError = "Finger is possible FAKE or misplaced"; return(valid); } HandPositions hand = segments[0].fpSeg.Hand; switch (activeSequence) { case ActiveSequence.OneRolled: valid = true; break; case ActiveSequence.FourTwoFour: #region Check FourTwoFour sequence if (currentStep == 1) { if (hand == HandPositions.Left) { if (segments.Length == 4) { valid = true; } else { this.validError = "Four finger expected!"; } } else { this.validError = "Left Hand expected for this Sequence!"; } } else if (currentStep == 2) { if (hand == HandPositions.Thumbs) { valid = true; } else { this.validError = "Thumbs expected for this Sequence!"; } } else if (currentStep == 3) { if (hand == HandPositions.Right) { if (segments.Length == 4) { valid = true; } else { this.validError = "Four finger expected!"; } } else { this.validError = "Right Hand expected for this Sequence!"; } } #endregion break; case ActiveSequence.FourFourTwo: #region Check FourFourTwo sequence if (currentStep == 1) { if (hand == HandPositions.Left) { if (segments.Length == 4) { valid = true; } else { this.validError = "Four finger expected!"; } } else { this.validError = "Left Hand expected for this Sequence!"; } } else if (currentStep == 2) { if (hand == HandPositions.Right) { if (segments.Length == 4) { valid = true; } else { this.validError = "Four finger expected!"; } } else { this.validError = "Right Hand expected for this Sequence!"; } } else if (currentStep == 3) { if (hand == HandPositions.Thumbs) { valid = true; } else { this.validError = "Thumbs expected for this Sequence!"; } } #endregion break; default: this.validError = "Capturing failed, please try it again."; break; } if (/*string.IsNullOrEmpty(this.validError)*/ valid) { this.validError = "Validation Error!"; } return(valid); }