public void OrientationAngleTest()
 {
     var image = Resources._1;
     var bytes = ImageHelper.LoadImage<int>(Resources._1);
     int height = bytes.GetLength(0);
     int width = bytes.GetLength(1);
     float[] sourceBytes = new float[height* width];
     float[] orientOut = new float[width * height];
     for (int i = 0; i < height - 1; i++)
     {
         for (int j = 0; j < width - 1; j++)
         {
             sourceBytes[i * width + j] = (float)bytes[i, j];
             orientOut[i * width + j] = 0.0f;
         }
     }
     OrientationFieldInPixels(orientOut, sourceBytes, width, height);
     PixelwiseOrientationField field = new PixelwiseOrientationField(bytes, 16);
     double[,] orient_2D = new double[height, width];
     for (int i = 0; i < height; i++)
         for (int j = 0; j < width; j++)
             orient_2D[i, j] = orientOut[i * width + j];
     field.NewOrientation(orient_2D);
     field.SaveAboveToFile(image);
 }
 public void OrientationRegularizationTest()
 {
     var image = Resources.SampleFinger;
       var bytes = ImageHelper.LoadImage<int>(Resources.SampleFinger);
       PixelwiseOrientationField field = new PixelwiseOrientationField(bytes, 16);
       OrientationFieldRegularization new_field = new OrientationFieldRegularization(field.Orientation, 25);
       field.NewOrientation(new_field.LocalOrientation());
       field.SaveAboveToFile(image);
 }
Esempio n. 3
0
        static void Main(string[] args)
        {
            var bytes = ImageHelper.LoadImage<int>("D:\\SmrSchl\\DB2_bmp\\DB2_bmp\\1_5.bmp");

            PixelwiseOrientationField field = new PixelwiseOrientationField(bytes, 16);

            SmoothOrientationField SO_field = new SmoothOrientationField(field.Orientation);
            field.NewOrientation(SO_field.LocalOrientation());

              //  Filter f = new Filter(16, 2.5);
              //  f.WriteMatrix();

               // Console.Read();
        }