Пример #1
0
        public void CreatTemplateTest()
        {
            /* double[,] img1 = ImageHelper.LoadImage<double>(Resources._1_1);
             * double[,] img2 = ImageHelper.LoadImage<double>(Resources._1_2*/
            double[,] imgDoubles = ImageHelper.LoadImage <double>(Resources._1_1);

            imgDoubles.DoNormalization(100, 100);

            int[,] imgInts = imgDoubles.Select2D((x => (int)x));
            OrientationField orf = new OrientationField(imgInts, 16);

            double[,] orient = orf.GetOrientationMatrix(imgInts.GetLength(0), imgInts.GetLength(1));

            var freqMatrx = LocalRidgeFrequency.GetFrequencies(imgDoubles, orient);

            var res = ImageEnhancement.Enhance(imgDoubles, orient, freqMatrx, 32, 8);


            /* var img = ImageHelper.LoadImage<int>(Resources._1_1);
             *
             * int h = img.GetLength(0);
             * int w = img.GetLength(1);
             *
             * int[] withoutHolesAndIslands = HolesAndIslandsResolver.ResolveHolesAndIslands(
             *   Array2Dto1D(ImageProcessing.Binarization.ImageBinarization.Binarize2D(img, 128)),
             *   16,
             *   9,
             *   w, h);*/
        }
Пример #2
0
        public static double[,] CreatTemplateTest(double[,] imgDoubles)
        {
            imgDoubles.DoNormalization(100, 100);

            int[,] imgInts = imgDoubles.Select2D((x => (int)x));
            OrientationField orf = new OrientationField(imgInts, 16);

            double[,] orient = orf.GetOrientationMatrix(imgInts.GetLength(0), imgInts.GetLength(1));

            var freqMatrx = LocalRidgeFrequency.GetFrequencies(imgDoubles, orient);

            var res = ImageEnhancement.Enhance(imgDoubles, orient, freqMatrx, 32, 8);

            return(ImageBinarization.Binarize2D(res, 128));
        }
        public void ImageEnhancmentTest()
        {
            var bmp = Resources.SampleFinger;

            double[,] imgDoubles = ImageHelper.LoadImage <double>(bmp);

            imgDoubles.DoNormalization(100, 100);

            int[,] imgInts = imgDoubles.Select2D((x => (int)x));
            OrientationField orf = new OrientationField(imgInts, 16);

            double[,] orient = orf.GetOrientationMatrix(imgInts.GetLength(0), imgInts.GetLength(1));

            var freqMatrx = LocalRidgeFrequency.GetFrequencies(imgDoubles, orient);

            var res  = ImageEnhancement.Enhance(imgDoubles, orient, freqMatrx, 32, 8);
            var bmp2 = ImageHelper.SaveArrayToBitmap(res);

            bmp2.Save("001.bmp", ImageHelper.GetImageFormatFromExtension("009.bmp"));
        }