Example #1
0
 /// <summary>
 ///     Extract features of type <see cref="JYFeatures"/> from the specified image.
 /// </summary>
 /// <remarks>
 ///     This method uses the properties <see cref="MtiaExtractor"/> and <see cref="SkeletonImgExtractor"/> to extract features, so it raises an exception if any of these properties is not assigned.
 /// </remarks>
 /// <exception cref="InvalidOperationException">
 ///     Thrown when the minutia list extractor is not assigned or the skeleton image extractor is not assigned.
 /// </exception>
 /// <param name="image">The source image to extract features from.</param>
 /// <returns>
 ///     Features of type <see cref="JYFeatures"/> extracted from the specified image.
 /// </returns>
 public override JYFeatures ExtractFeatures(Bitmap image)
 {
     try
     {
         List <Minutia> minutiae    = MtiaExtractor.ExtractFeatures(image);
         SkeletonImage  skeletonImg = SkeletonImgExtractor.ExtractFeatures(image);
         return(ExtractFeatures(minutiae, skeletonImg));
     }
     catch (Exception e)
     {
         if (MtiaExtractor == null)
         {
             throw new InvalidOperationException("Unable to extract JYFeatures: Unassigned minutia list extractor!", e);
         }
         if (SkeletonImgExtractor == null)
         {
             throw new InvalidOperationException("Unable to extract JYFeatures: Unassigned skeleton image extractor!", e);
         }
         throw;
     }
 }
        /// <summary>
        ///     Extract features of type <see cref="Tico2003Features"/> from the specified image.
        /// </summary>
        /// <remarks>
        ///     This method uses the properties <see cref="MtiaExtractor"/> and <see cref="OrImgExtractor"/> to extract features, so it raises an exception if any of these properties is not assigned.
        /// </remarks>
        /// <exception cref="InvalidOperationException">
        ///      Thrown when the minutia list extractor is not assigned or the orientation image extractor is not assigned.
        /// </exception>
        /// <param name="image">The source image to extract features from.</param>
        /// <returns>
        ///     Features of type <see cref="Tico2003Features"/> extracted from the specified image.
        /// </returns>
        public override Tico2003Features ExtractFeatures(Bitmap image)
        {
            try
            {
                var mtiae = MtiaExtractor.ExtractFeatures(image);
                var dImg  = OrImgExtractor.ExtractFeatures(image);

                return(new Tico2003Features(mtiae, dImg));
            }
            catch (Exception e)
            {
                if (MtiaExtractor == null)
                {
                    throw new InvalidOperationException("Can not extract Tico2003Features: Unassigned minutia list extractor!", e);
                }
                if (OrImgExtractor == null)
                {
                    throw new InvalidOperationException("Can not extract Tico2003Features: Unassigned orientation image extractor!", e);
                }
                throw;
            }
        }