Пример #1
0
 /// <summary>
 ///     Extracts <see cref="MtripletsFeature"/> from the specified fingerprint and <see cref="ResourceRepository"/>.
 /// </summary>
 /// <param name="fingerprint">The fingerprint which resource is being extracted.</param>
 /// <param name="repository">The object used to store and retrieve resources.</param>
 /// <exception cref="InvalidOperationException">Thrown when the minutia list provider is not assigned or the minutia list extractor is not assigned.</exception>
 /// <returns>The extracted <see cref="MtripletsFeature"/>.</returns>
 protected override MtripletsFeature Extract(string fingerprint, ResourceRepository repository)
 {
     try
     {
         var mtiae = MtiaListProvider.GetResource(fingerprint, repository);
         return(mTripletsCalculator.ExtractFeatures(mtiae));
     }
     catch (Exception e)
     {
         if (MtiaListProvider == null)
         {
             throw new InvalidOperationException("Unable to extract PNFeatures: Unassigned minutia list provider!", e);
         }
         throw;
     }
 }
Пример #2
0
        /// <summary>
        ///     Extracts <see cref="Qi2005Features"/> from the specified fingerprint and <see cref="ResourceRepository"/>.
        /// </summary>
        /// <param name="fingerprint">The fingerprint which resource is being extracted.</param>
        /// <param name="repository">The object used to store and retrieve resources.</param>
        /// <exception cref="InvalidOperationException">Thrown when the minutia list provider is not assigned, the orientation image provider is not assigned, the minutia list extractor is not assigned or the orientation image extractor is not assigned.</exception>
        /// <returns>The extracted <see cref="Qi2005Features"/>.</returns>
        protected override Qi2005Features Extract(string fingerprint, ResourceRepository repository)
        {
            try
            {
                var mtiae  = MtiaListProvider.GetResource(fingerprint, repository);
                var dirImg = OrImgProvider.GetResource(fingerprint, repository);

                return(featureExtractor.ExtractFeatures(mtiae, dirImg));
            }
            catch (Exception)
            {
                if (MtiaListProvider == null)
                {
                    throw new InvalidOperationException("Unable to extract Qi2005Features: Unassigned minutia list provider!");
                }
                if (OrImgProvider == null)
                {
                    throw new InvalidOperationException("Unable to extract Qi2005Features: Unassigned orientation image provider!");
                }
                throw;
            }
        }