//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.)
        }
        private void threetothree(object sender, EventArgs e)
        {
            try
            {
                Bitmap bb = new Bitmap(3, 3);
                bb.SetPixel(0, 0, Color.FromArgb(0, 0, 0));
                bb.SetPixel(1, 0, Color.FromArgb(50, 50, 50));
                bb.SetPixel(2, 0, Color.FromArgb(100, 100, 100));
                bb.SetPixel(0, 1, Color.FromArgb(50, 50, 50));
                bb.SetPixel(1, 1, Color.FromArgb(100, 100, 100));
                bb.SetPixel(2, 1, Color.FromArgb(255, 255, 255));
                bb.SetPixel(0, 2, Color.FromArgb(100, 100, 100));
                bb.SetPixel(1, 2, Color.FromArgb(255, 255, 255));
                bb.SetPixel(2, 2, Color.FromArgb(255, 255, 255));

                /* bb.SetPixel(0, 0, Color.FromArgb(0, 0, 0));
                 * bb.SetPixel(1, 0, Color.FromArgb(0, 0, 0));
                 * bb.SetPixel(2, 0, Color.FromArgb(0, 0, 0));
                 * bb.SetPixel(0, 1, Color.FromArgb(0, 0, 0));
                 * bb.SetPixel(1, 1, Color.FromArgb(0, 0,0));
                 * bb.SetPixel(2, 1, Color.FromArgb(0, 0, 0));
                 * bb.SetPixel(0, 2, Color.FromArgb(255, 255, 255));
                 * bb.SetPixel(1, 2, Color.FromArgb(255, 255, 255));
                 * bb.SetPixel(2, 2, Color.FromArgb(255, 255, 255));*/

                /*bb.SetPixel(0, 0, Color.FromArgb(255, 255, 255));
                 * bb.SetPixel(1, 0, Color.FromArgb(200, 200,200));
                 * bb.SetPixel(2, 0, Color.FromArgb(100, 100, 100));
                 * bb.SetPixel(0, 1, Color.FromArgb(200, 200, 200));
                 * bb.SetPixel(1, 1, Color.FromArgb(100, 100, 100));
                 * bb.SetPixel(2, 1, Color.FromArgb(50, 50, 50));
                 * bb.SetPixel(0, 2, Color.FromArgb(100, 100, 100));
                 * bb.SetPixel(1, 2, Color.FromArgb(50, 50, 50));
                 * bb.SetPixel(2, 2, Color.FromArgb(0, 0, 0));*/


                /*  bb.SetPixel(0, 0, Color.FromArgb(255, 255, 255));
                 * bb.SetPixel(1, 0, Color.FromArgb(200, 200, 200));
                 * bb.SetPixel(2, 0, Color.FromArgb(100, 100, 100));
                 * bb.SetPixel(0, 1, Color.FromArgb(200, 200, 200));
                 * bb.SetPixel(1, 1, Color.FromArgb(100, 100, 100));
                 * bb.SetPixel(2, 1, Color.FromArgb(50, 50, 50));
                 * bb.SetPixel(0, 2, Color.FromArgb(100, 100, 100));
                 * bb.SetPixel(1, 2, Color.FromArgb(50, 50, 50));
                 * bb.SetPixel(2, 2, Color.FromArgb(0, 0, 0));*/
                this.threeToThree = randomCel.getRandomThreeToThree();
                //this.threeToThree = bb;
                // var bitmapSrc = MyImagingHelper.Scale(100, twoPixelBitmap)//this will get a Bitmap size 200 * 100,change the ratio if it is not enough
                //.ToBitmapSource();
                threetothreeImage.Source = ImageSupporter.ToBitmapSource(ImageSupporter.Scale(100, threeToThree));

                /* Bitmap bitmapTwo = randomCel.getRandomTwo();
                 * Console.WriteLine(bitmapTwo.Size);
                 * threetothreeImage.Source = ImageSupporter.bitmapToBitmapimage2(bitmapTwo);
                 * Console.WriteLine("Wielkość: " + threetothreeImage.Width + "  " + threetothreeImage.Source.Height);*/

                //Console.WriteLine("Color na pozycji 1 0= " +threeToThree.GetPixel(0, 1).R);
                ImageSupporter.WriteBitmap(threeToThree);
            }
            catch (System.NullReferenceException en)
            {
                Console.WriteLine("Nie masz wylosowanej komórki");
            }
        }