public void gridIt()
 {
     for (int i = 0; i < bitmap.Width; i += cellSize)
     {
         for (int j = 0; j < bitmap.Height; j += cellSize)
         {
             Bitmap gridmap = new Bitmap(cellSize, cellSize);
             for (int a = i; a < i + cellSize; a++)
             {
                 for (int b = j; b < j + cellSize; b++)
                 {
                     if (a > 0 && a < bitmap.Width && b > 0 && b < bitmap.Height)
                     {
                         gridmap.SetPixel(a - i, b - j, bitmap.GetPixel(a, b));
                     }
                     else
                     {
                         gridmap.SetPixel(a - i, b - j, Color.White);
                     }
                 }
             }
             ImageCell imageCell = new ImageCell(gridmap);
             cellTab[i / cellSize, j / cellSize] = imageCell;
         }
     }
 }
 //metody nieużywane do działąnia programu, ale istotne w trakcie testów i przygotowania pracy dyplomowej
 public void losowyObszar(object sender, EventArgs e)
 {
     fingerprint = new Fingerprint((BitmapImage)originalImage.Source);
     fingerprint.startRecognition(fingerprint.localOrientationMap);
     randomCel = fingerprint.getRandomCell(mapakierunkow);
     ImageSupporter.WriteBitmap(randomCel.bitmap);
     QUATRE.Source = ImageSupporter.Bitmap2BitmapImage(randomCel.bitmap);
     fingerprint.merge();
     threetothreeImage.Source = ImageSupporter.ToBitmapSource(ImageSupporter.Scale(1, fingerprint.localOrientationMap));
 }
        private void gradient(object sender, EventArgs e)
        {
            try
            {
                // Console.WriteLine(randomCel.wektorToAngle(randomCel.getWektor(threeToThree)));
                int x = Int32.Parse(Console.ReadLine());
                int y = Int32.Parse(Console.ReadLine());

                fingerprint = new Fingerprint((BitmapImage)originalImage.Source);
                fingerprint.startRecognition(fingerprint.localOrientationMap);
                randomCel = fingerprint.getCell(mapakierunkow, x, y);
                ImageSupporter.WriteBitmap(randomCel.bitmap);
                QUATRE.Source = ImageSupporter.Bitmap2BitmapImage(randomCel.bitmap);
                fingerprint.merge();
                threetothreeImage.Source = ImageSupporter.ToBitmapSource(ImageSupporter.Scale(1, fingerprint.localOrientationMap));
            }
            catch (System.NullReferenceException en)
            {
                Console.WriteLine("Nie masz wylosowanego obszaru 3 na 3");
            }

            //Console.WriteLine(imageCell.)
        }