Exemple #1
0
 public static Bitmap Gabor(Bitmap bmpGray)
 {
     matrannguyen mt = new matrannguyen(512,512);
     mt.DocBitmap(bmpGray);
     mt.gabor();
     return mt.ToBitmap();
 }
Exemple #2
0
 public static Bitmap CaiThienAnh(Bitmap bmpGray)
 {
     matrannguyen mt = new matrannguyen(512, 512);
     mt.DocBitmap(bmpGray);
     mt=mt.loctrungvi(3);
     //mt=mt.gabor();
     mt = mt.gabor();
     mt = mt.loctrungvi(3);
     mt=mt.nhiphan();
     //Bitmap bmp = vnImageProcess.ConvertToGrayscale(mt.ToBitmap());
     // bmp = vnImageProcess.Wiener(bmp);
     return mt.ToBitmap();
 }
Exemple #3
0
 public matrannhiphan(matrannguyen anhxam, int nguong)
 {
     int i, j;
     this.sohang = anhxam.Sohang;
     this.socot = anhxam.Socot;
     data = new bool[sohang, socot];
     for (i = 0; i < this.sohang; ++i)
         for (j = 0; j < this.socot; ++j)
             this.data[i, j] = (anhxam.data[i, j] < nguong);
 }
Exemple #4
0
 public matrannhiphan(matrannguyen anhxam)
 {
     matrannguyen anh = anhxam.nhiphan();
     int i, j;
     sohang = anhxam.Sohang;
     socot = anhxam.Socot;
     data = new bool[sohang, socot];
     for (i = 0; i < sohang; ++i)
         for (j = 0; j < socot; ++j)
         {
             data[i, j] = (anh.data[i, j] < 100);
         }
 }
Exemple #5
0
        public matrannguyen phanvung()
        {
            matrannguyen kq = new matrannguyen(512, 512);
            matrannguyen tg = new matrannguyen(32, 32);
            matrannguyen tg1 = new matrannguyen(32, 32);
            for (int i = 0; i < 32; ++i)
                for (int j = 0; j < 32; ++j)
                {
                    int bien = 0;
                    for (int k = 0; k < 16; ++k)
                        for (int l = 0; l < 16; ++l)
                        {
                            bien += data[16 * i + k, 16 * j + l];
                        }
                    bien = (int)bien / (16 * 16);
                    tg.data[i, j] = bien;
                }
            for (int i = 0; i < 32; ++i)
                for (int j = 0; j < 32; ++j)
                {
                    int xet = 0;
                    for (int k = 0; k < 16; ++k)
                        for (int l = 0; l < 16; ++l)
                        {
                            xet += (int)(data[16 * i + k, 16 * j + l] - tg.data[i, j]) * (data[16 * i + k, 16 * j + l] - tg.data[i, j]);
                        }
                    tg1.data[i, j] = (int)xet / (16 * 16);
                }
            matrannhiphan tg3 = new matrannhiphan(32, 32);
            for (int i = 0; i < 32; ++i)
                for (int j = 0; j < 32; ++j)
                {
                    tg3.data[i, j] = (tg1.data[i, j] > 40);
                }
            tg3 = tg3.co();
            tg3 = tg3.co();
            //tg3 = tg3.co();
            //tg3 = tg3.co();
            //tg3 = tg3.gian();
            //tg3 = tg3.gian();
            tg3 = tg3.gian();
            tg3 = tg3.gian();
            matrannhiphan tg4 = tg3.tachbien();
            for (int i = 0; i < 32; ++i)
                for (int j = 0; j < 32; ++j)
                {
                    for (int k = 0; k < 16; ++k)
                        for (int l = 0; l < 16; ++l)
                        {
                            if (!tg3.data[i, j])
                                kq.data[16 * i + k, 16 * j + l] = 255;
                            else
                                kq.data[16 * i + k, 16 * j + l] = 0;

                        }
                }
            int ng;
            for (int i = 0; i < 32; ++i)
                for (int j = 0; j < 32; ++j)
                    if (tg4.data[i, j])
                    {
                        ng = (int)(max(new rect(16 * i, 16 * j, 16, 16)) + min(new rect(16 * i, 16 * j, 16, 16))) / 2;
                        for (int k = 0; k < 16; ++k)
                            for (int l = 0; l < 16; ++l)
                            {
                                if (data[16 * i + k, 16 * j + l] > ng + 10)
                                    kq.data[16 * i + k, 16 * j + l] = 255;
                                else
                                    kq.data[16 * i + k, 16 * j + l] = 0;
                            }
                    }
            return kq;
        }
Exemple #6
0
        public matrannguyen nhiphan()
        {
            matrannguyen kq = new matrannguyen(sohang, socot);
            matrannguyen tg = new matrannguyen(32, 32);
            int trunggian;
            tg = chonnguong();
            for (int i = 0; i < 32; ++i)
                for (int j = 0; j < 32; ++j)
                {
                    trunggian = tg.data[i, j];
                    for (int k = 0; k < 16; ++k)
                        for (int l = 0; l < 16; ++l)
                        {
                            if (data[16 * i + k, 16 * j + l] >= trunggian)
                                kq.data[16 * i + k, 16 * j + l] = 255;
                            else
                                kq.data[16 * i + k, 16 * j + l] = 0;
                        }

                }
            return kq;
        }
Exemple #7
0
 public matrannguyen nhanchap(matransothuc matna)
 {
     int m = sohang, n = socot, i, j;
     matrannguyen ketqua = new matrannguyen(m, n);
     for (i = 0; i < m; ++i)
         for (j = 0; j < n; ++j)
             ketqua.data[i, j] = (int)nhanchap1(i, j, matna);
     return ketqua;
 }
Exemple #8
0
 public matrannguyen mthuongmn(int w)
 {
     matrannguyen kq = new matrannguyen(sohang / w, socot / w);
     matrannguyen kq1 = new matrannguyen(sohang, socot);
     int tg;
     for (int k = 0; k < kq.Sohang; ++k)
         for (int l = 0; l < kq.Socot; ++l)
         {
             int max = 0;
             int xet = 0;
             int[] dem = new int[8];
             dem = ganvt();
             for (int i = 0; i < w; ++i)
                 for (int j = 0; j < w; ++j)
                 {
                     tg = huongmt(16 * k + i, 16 * l + j);
                     if (tg == 0) dem[0]++;
                     if (tg == 1) dem[1]++;
                     if (tg == 2) dem[2]++;
                     if (tg == 3) dem[3]++;
                     if (tg == 4) dem[4]++;
                     if (tg == 5) dem[5]++;
                     if (tg == 6) dem[6]++;
                     if (tg == 7) dem[7]++;
                 }
             for (int n = 0; n < 8; n++)
             {
                 if (max < dem[n])
                 {
                     max = dem[n];
                     xet = n;
                 }
             }
             kq.data[k, l] = xet;
         }
     for (int k = 0; k < 32; ++k)
         for (int l = 0; l < 32; ++l)
         {
             for (int i = 0; i < 16; ++i)
                 for (int j = 0; j < 16; ++j)
                 {
                     kq1.data[16 * k + i, 16 * l + j] = kq.data[k, l];
                 }
         }
     return kq1;
 }
Exemple #9
0
 public matrannguyen loctrungvi(int n)
 {
     matrannguyen ketqua = new matrannguyen(sohang, socot);
     ketqua.data = this.data;
     int i, j, k, l, g, h, tg;
     int[] list;
     for (i = 0; i < sohang - 1; ++i)
         for (j = 0; j < socot - 1; ++j)
         {
             list = new int[n * n];
             for (k = 0; k < n; ++k)
                 for (l = 0; l < n; ++l)
                 {
                     if ((i + k - 1 >= 0) && (j + l - 1 >= 0) && (i + k - 1 < sohang) && (j + l - 1 < socot))
                         list[k * n + l] = this.data[i + k - 1, j + l - 1];
                     //else list[k * n + l] = 0;
                 }
             for (g = 0; g < n * n - 1; g++)
                 for (h = g + 1; h <= n * n - 1; ++h)
                 {
                     if (list[g] > list[h]) { tg = list[g]; list[g] = list[h]; list[h] = tg; }
                 }
             if (Math.Abs(list[n * n / 2] - this.data[i, j]) > 50)
                 ketqua.data[i, j] = list[n * n / 2];
             else ketqua.data[i, j] = this.data[i, j];
         }
     return ketqua;
 }
Exemple #10
0
        public matrannguyen gabor()
        {
            // ma tran he so cho huong 0 rad
            matransothuc s1 = new matransothuc(11, 11);
            s1.data[0, 0] = -0.20961; s1.data[0, 1] = -0.27769; s1.data[0, 2] = -0.34559; s1.data[0, 3] = -0.40404; s1.data[0, 4] = -0.44375; s1.data[0, 5] = -0.45783; s1.data[0, 6] = -0.44375; s1.data[0, 7] = -0.40404; s1.data[0, 8] = -0.34559; s1.data[0, 9] = -0.27769; s1.data[0, 10] = -0.20961;
            s1.data[1, 0] = -0.22466; s1.data[1, 1] = -0.29762; s1.data[1, 2] = -0.37039; s1.data[1, 3] = -0.43304; s1.data[1, 4] = -0.47560; s1.data[1, 5] = -0.49069; s1.data[1, 6] = -0.47560; s1.data[1, 7] = -0.43304; s1.data[1, 8] = -0.37039; s1.data[1, 9] = -0.29762; s1.data[1, 10] = -0.22466;
            s1.data[2, 0] = -0.10679; s1.data[2, 1] = -0.14148; s1.data[2, 2] = -0.17607; s1.data[2, 3] = -0.20585; s1.data[2, 4] = -0.22608; s1.data[2, 5] = -0.23326; s1.data[2, 6] = -0.22608; s1.data[2, 7] = -0.20585; s1.data[2, 8] = -0.17607; s1.data[2, 9] = -0.14148; s1.data[2, 10] = -0.10679;
            s1.data[3, 0] = 0.12485; s1.data[3, 1] = 0.16540; s1.data[3, 2] = 0.20585; s1.data[3, 3] = 0.24066; s1.data[3, 4] = 0.26432; s1.data[3, 5] = 0.27271; s1.data[3, 6] = 0.26432; s1.data[3, 7] = 0.24066; s1.data[3, 8] = 0.20585; s1.data[3, 9] = 0.16540; s1.data[3, 10] = 0.12485;
            s1.data[4, 0] = 0.35900; s1.data[4, 1] = 0.47560; s1.data[4, 2] = 0.59189; s1.data[4, 3] = 0.69199; s1.data[4, 4] = 0.76000; s1.data[4, 5] = 0.78413; s1.data[4, 6] = 0.76000; s1.data[4, 7] = 0.69199; s1.data[4, 8] = 0.59189; s1.data[4, 9] = 0.47560; s1.data[4, 10] = 0.35900;
            s1.data[5, 0] = 0.45783; s1.data[5, 1] = 0.60653; s1.data[5, 2] = 0.75484; s1.data[5, 3] = 0.88250; s1.data[5, 4] = 0.96923; s1.data[5, 5] = 1.00000; s1.data[5, 6] = 0.96923; s1.data[5, 7] = 0.88250; s1.data[5, 8] = 0.75484; s1.data[5, 9] = 0.60653; s1.data[5, 10] = 0.45783;
            s1.data[6, 0] = 0.35900; s1.data[6, 1] = 0.47560; s1.data[6, 2] = 0.59189; s1.data[6, 3] = 0.69199; s1.data[6, 4] = 0.76000; s1.data[6, 5] = 0.78413; s1.data[6, 6] = 0.76000; s1.data[6, 7] = 0.69199; s1.data[6, 8] = 0.59189; s1.data[6, 9] = 0.47560; s1.data[6, 10] = 0.35900;
            s1.data[7, 0] = 0.12485; s1.data[7, 1] = 0.16540; s1.data[7, 2] = 0.20585; s1.data[7, 3] = 0.24066; s1.data[7, 4] = 0.26432; s1.data[7, 5] = 0.27271; s1.data[7, 6] = 0.26432; s1.data[7, 7] = 0.24066; s1.data[7, 8] = 0.20585; s1.data[7, 9] = 0.16540; s1.data[7, 10] = 0.12485;
            s1.data[8, 0] = -0.10679; s1.data[8, 1] = -0.14148; s1.data[8, 2] = -0.17607; s1.data[8, 3] = -0.20585; s1.data[8, 4] = -0.22608; s1.data[8, 5] = -0.23326; s1.data[8, 6] = -0.22608; s1.data[8, 7] = -0.20585; s1.data[8, 8] = -0.17607; s1.data[8, 9] = -0.14148; s1.data[8, 10] = -0.10679;
            s1.data[9, 0] = -0.22466; s1.data[9, 1] = -0.29762; s1.data[9, 2] = -0.37039; s1.data[9, 3] = -0.43304; s1.data[9, 4] = -0.47560; s1.data[9, 5] = -0.49069; s1.data[9, 6] = -0.47560; s1.data[9, 7] = -0.43304; s1.data[9, 8] = -0.37039; s1.data[9, 9] = -0.29762; s1.data[9, 10] = -0.22466;
            s1.data[10, 0] = -0.20961; s1.data[10, 1] = -0.27769; s1.data[10, 2] = -0.34559; s1.data[10, 3] = -0.40404; s1.data[10, 4] = -0.44375; s1.data[10, 5] = -0.45783; s1.data[10, 6] = -0.44375; s1.data[10, 7] = -0.40404; s1.data[10, 8] = -0.34559; s1.data[10, 9] = -0.27769; s1.data[10, 10] = -0.20961;

            // ma tran he so cho huong pi/8 rad
            matransothuc s2 = new matransothuc(11, 11);

            s2.data[0, 0] = -0.02705; s2.data[0, 1] = -0.10038; s2.data[0, 2] = -0.19807; s2.data[0, 3] = -0.30375; s2.data[0, 4] = -0.39369; s2.data[0, 5] = -0.44480; s2.data[0, 6] = -0.44375; s2.data[0, 7] = -0.39229; s2.data[0, 8] = -0.30619; s2.data[0, 9] = -0.20282; s2.data[0, 10] = -0.11968;
            s2.data[1, 0] = 0.12105; s2.data[1, 1] = 0.07691; s2.data[1, 2] = -0.01365; s2.data[1, 3] = -0.14291; s2.data[1, 4] = -0.28735; s2.data[1, 5] = -0.41395; s2.data[1, 6] = -0.49199; s2.data[1, 7] = -0.50485; s2.data[1, 8] = -0.45562; s2.data[1, 9] = -0.36417; s2.data[1, 10] = -0.25761;
            s2.data[2, 0] = 0.29655; s2.data[2, 1] = 0.32558; s2.data[2, 2] = 0.29814; s2.data[2, 3] = 0.20355; s2.data[2, 4] = 0.05100; s2.data[2, 5] = -0.12821; s2.data[2, 6] = -0.29238; s2.data[2, 7] = -0.40397; s2.data[2, 8] = -0.44348; s2.data[2, 9] = -0.41455; s2.data[2, 10] = -0.33885;
            s2.data[3, 0] = 0.40369; s2.data[3, 1] = 0.52468; s2.data[3, 2] = 0.60280; s2.data[3, 3] = 0.60553; s2.data[3, 4] = 0.51782; s2.data[3, 5] = 0.35162; s2.data[3, 6] = 0.14418; s2.data[3, 7] = -0.05531; s2.data[3, 8] = -0.20418; s2.data[3, 9] = -0.28067; s2.data[3, 10] = -0.28770;
            s2.data[4, 0] = 0.36071; s2.data[4, 1] = 0.54565; s2.data[4, 2] = 0.72437; s2.data[4, 3] = 0.85111; s2.data[4, 4] = 0.88562; s2.data[4, 5] = 0.81047; s2.data[4, 6] = 0.64024; s2.data[4, 7] = 0.41712; s2.data[4, 8] = 0.19441; s2.data[4, 9] = 0.01676; s2.data[4, 10] = -0.09334;
            s2.data[5, 0] = 0.16495; s2.data[5, 1] = 0.34697; s2.data[5, 2] = 0.56682; s2.data[5, 3] = 0.78241; s2.data[5, 4] = 0.94135; s2.data[5, 5] = 1.00000; s2.data[5, 6] = 0.94135; s2.data[5, 7] = 0.78241; s2.data[5, 8] = 0.56682; s2.data[5, 9] = 0.34697; s2.data[5, 10] = 0.16495;
            s2.data[6, 0] = -0.09334; s2.data[6, 1] = 0.01676; s2.data[6, 2] = 0.19441; s2.data[6, 3] = 0.41712; s2.data[6, 4] = 0.64024; s2.data[6, 5] = 0.81047; s2.data[6, 6] = 0.88562; s2.data[6, 7] = 0.85111; s2.data[6, 8] = 0.72437; s2.data[6, 9] = 0.54565; s2.data[6, 10] = 0.36071;
            s2.data[7, 0] = -0.28770; s2.data[7, 1] = -0.28067; s2.data[7, 2] = -0.20418; s2.data[7, 3] = -0.05531; s2.data[7, 4] = 0.14418; s2.data[7, 5] = 0.35162; s2.data[7, 6] = 0.51782; s2.data[7, 7] = 0.60553; s2.data[7, 8] = 0.60280; s2.data[7, 9] = 0.52468; s2.data[7, 10] = 0.40369;
            s2.data[8, 0] = -0.33885; s2.data[8, 1] = -0.41455; s2.data[8, 2] = -0.44348; s2.data[8, 3] = -0.40397; s2.data[8, 4] = -0.29238; s2.data[8, 5] = -0.12821; s2.data[8, 6] = 0.05100; s2.data[8, 7] = 0.20355; s2.data[8, 8] = 0.29814; s2.data[8, 9] = 0.32558; s2.data[8, 10] = 0.29655;
            s2.data[9, 0] = -0.25761; s2.data[9, 1] = -0.36417; s2.data[9, 2] = -0.45562; s2.data[9, 3] = -0.50485; s2.data[9, 4] = -0.49199; s2.data[9, 5] = -0.41395; s2.data[9, 6] = -0.28735; s2.data[9, 7] = -0.14291; s2.data[9, 8] = -0.01365; s2.data[9, 9] = 0.07691; s2.data[9, 10] = 0.12105;
            s2.data[10, 0] = -0.11968; s2.data[10, 1] = -0.20828; s2.data[10, 2] = -0.30619; s2.data[10, 3] = -0.39229; s2.data[10, 4] = -0.44375; s2.data[10, 5] = -0.44480; s2.data[10, 6] = -0.39369; s2.data[10, 7] = -0.30375; s2.data[10, 8] = -0.19807; s2.data[10, 9] = -0.10038; s2.data[10, 10] = -0.02705;

            // ma tran he so cho huong 2pi/8 rad
            matransothuc s3 = new matransothuc(11, 11);
            s3.data[0, 0] = 0.20961; s3.data[0, 1] = 0.25073; s3.data[0, 2] = 0.21790; s3.data[0, 3] = 0.09523; s3.data[0, 4] = -0.09092; s3.data[0, 5] = -0.27731; s3.data[0, 6] = -0.39445; s3.data[0, 7] = -0.40384; s3.data[0, 8] = -0.31657; s3.data[0, 9] = -0.18181; s3.data[0, 10] = -0.05581;
            s3.data[1, 0] = 0.25073; s3.data[1, 1] = 0.36788; s3.data[1, 2] = 0.41339; s3.data[1, 3] = 0.33749; s3.data[1, 4] = 0.13856; s3.data[1, 5] = -0.12428; s3.data[1, 6] = -0.35607; s3.data[1, 7] = -0.47579; s3.data[1, 8] = -0.45761; s3.data[1, 9] = -0.33699; s3.data[1, 10] = -0.18181;
            s3.data[2, 0] = 0.21790; s3.data[2, 1] = 0.41339; s3.data[2, 2] = 0.56978; s3.data[2, 3] = 0.60147; s3.data[2, 4] = 0.46130; s3.data[2, 5] = 0.17791; s3.data[2, 6] = -0.14990; s3.data[2, 7] = -0.40348; s3.data[2, 8] = -0.50648; s3.data[2, 9] = -0.45761; s3.data[2, 10] = -0.31657;
            s3.data[3, 0] = 0.09523; s3.data[3, 1] = 0.33749; s3.data[3, 2] = 0.60147; s3.data[3, 3] = 0.77880; s3.data[3, 4] = 0.77231; s3.data[3, 5] = 0.55643; s3.data[3, 6] = 0.20160; s3.data[3, 7] = -0.15957; s3.data[3, 8] = -0.40348; s3.data[3, 9] = -0.47579; s3.data[3, 10] = -0.40384;
            s3.data[4, 0] = -0.09092; s3.data[4, 1] = 0.13856; s3.data[4, 2] = 0.46130; s3.data[4, 3] = 0.77231; s3.data[4, 4] = 0.93941; s3.data[4, 5] = 0.87514; s3.data[4, 6] = 0.59232; s3.data[4, 7] = 0.20160; s3.data[4, 8] = -0.14990; s3.data[4, 9] = -0.35607; s3.data[4, 10] = -0.39445;
            s3.data[5, 0] = -0.27731; s3.data[5, 1] = -0.12428; s3.data[5, 2] = 0.17791; s3.data[5, 3] = 0.55643; s3.data[5, 4] = 0.87514; s3.data[5, 5] = 1.00000; s3.data[5, 6] = 0.87514; s3.data[5, 7] = 0.55643; s3.data[5, 8] = 0.17791; s3.data[5, 9] = -0.12428; s3.data[5, 10] = -0.27731;
            s3.data[6, 0] = -0.39445; s3.data[6, 1] = -0.35607; s3.data[6, 2] = -0.14990; s3.data[6, 3] = 0.20160; s3.data[6, 4] = 0.59232; s3.data[6, 5] = 0.87514; s3.data[6, 6] = 0.93941; s3.data[6, 7] = 0.77231; s3.data[6, 8] = 0.46130; s3.data[6, 9] = 0.13856; s3.data[6, 10] = -0.09092;
            s3.data[7, 0] = -0.40384; s3.data[7, 1] = -0.47579; s3.data[7, 2] = -0.40348; s3.data[7, 3] = -0.15957; s3.data[7, 4] = 0.20160; s3.data[7, 5] = 0.55643; s3.data[7, 6] = 0.77231; s3.data[7, 7] = 0.77880; s3.data[7, 8] = 0.60147; s3.data[7, 9] = 0.33749; s3.data[7, 10] = 0.09523;
            s3.data[8, 0] = -0.31657; s3.data[8, 1] = -0.45761; s3.data[8, 2] = -0.50648; s3.data[8, 3] = -0.40348; s3.data[8, 4] = -0.14990; s3.data[8, 5] = 0.17791; s3.data[8, 6] = 0.46130; s3.data[8, 7] = 0.60147; s3.data[8, 8] = 0.56978; s3.data[8, 9] = 0.41339; s3.data[8, 10] = 0.21790;
            s3.data[9, 0] = -0.18181; s3.data[9, 1] = -0.33699; s3.data[9, 2] = -0.45761; s3.data[9, 3] = -0.47579; s3.data[9, 4] = -0.35607; s3.data[9, 5] = -0.12428; s3.data[9, 6] = 0.13856; s3.data[9, 7] = 0.33749; s3.data[9, 8] = 0.41339; s3.data[9, 9] = 0.36788; s3.data[9, 10] = 0.25073;
            s3.data[10, 0] = -0.05581; s3.data[10, 1] = -0.18181; s3.data[10, 2] = -0.31657; s3.data[10, 3] = -0.40348; s3.data[10, 4] = -0.39445; s3.data[10, 5] = -0.27731; s3.data[10, 6] = -0.09092; s3.data[10, 7] = 0.09523; s3.data[10, 8] = 0.21790; s3.data[10, 9] = 0.25073; s3.data[10, 10] = 0.20961;

            // ma tran he so cho huong 3pi/8 rad
            matransothuc s4 = new matransothuc(11, 11);
            s4.data[0, 0] = -0.02705; s4.data[0, 1] = 0.12105; s4.data[0, 2] = 0.29655; s4.data[0, 3] = 0.40369; s4.data[0, 4] = 0.36071; s4.data[0, 5] = 0.16495; s4.data[0, 6] = -0.09334; s4.data[0, 7] = -0.28770; s4.data[0, 8] = -0.33885; s4.data[0, 9] = -0.25761; s4.data[0, 10] = -0.11968;
            s4.data[1, 0] = -0.10038; s4.data[1, 1] = 0.07691; s4.data[1, 2] = 0.32558; s4.data[1, 3] = 0.52468; s4.data[1, 4] = 0.54565; s4.data[1, 5] = 0.34697; s4.data[1, 6] = 0.01676; s4.data[1, 7] = -0.28067; s4.data[1, 8] = -0.41455; s4.data[1, 9] = -0.36417; s4.data[1, 10] = -0.20828;
            s4.data[2, 0] = -0.19807; s4.data[2, 1] = -0.01365; s4.data[2, 2] = 0.29814; s4.data[2, 3] = 0.60280; s4.data[2, 4] = 0.72437; s4.data[2, 5] = 0.56682; s4.data[2, 6] = 0.19441; s4.data[2, 7] = -0.20418; s4.data[2, 8] = -0.44348; s4.data[2, 9] = -0.45562; s4.data[2, 10] = -0.30619;
            s4.data[3, 0] = -0.30375; s4.data[3, 1] = -0.14291; s4.data[3, 2] = 0.20335; s4.data[3, 3] = 0.60553; s4.data[3, 4] = 0.85111; s4.data[3, 5] = 0.78241; s4.data[3, 6] = 0.41712; s4.data[3, 7] = -0.05531; s4.data[3, 8] = -0.40397; s4.data[3, 9] = -0.50485; s4.data[3, 10] = -0.39229;
            s4.data[4, 0] = -0.39369; s4.data[4, 1] = -0.28735; s4.data[4, 2] = 0.05100; s4.data[4, 3] = 0.51782; s4.data[4, 4] = 0.88562; s4.data[4, 5] = 0.94135; s4.data[4, 6] = 0.64024; s4.data[4, 7] = 0.14418; s4.data[4, 8] = -0.29238; s4.data[4, 9] = -0.49199; s4.data[4, 10] = -0.44375;
            s4.data[5, 0] = -0.44480; s4.data[5, 1] = -0.41395; s4.data[5, 2] = -0.12821; s4.data[5, 3] = 0.35162; s4.data[5, 4] = 0.81047; s4.data[5, 5] = 1.00000; s4.data[5, 6] = 0.81047; s4.data[5, 7] = 0.35162; s4.data[5, 8] = -0.12821; s4.data[5, 9] = -0.41395; s4.data[5, 10] = -0.44480;
            s4.data[6, 0] = -0.44375; s4.data[6, 1] = -0.49199; s4.data[6, 2] = -0.29238; s4.data[6, 3] = 0.14418; s4.data[6, 4] = 0.64024; s4.data[6, 5] = 0.94135; s4.data[6, 6] = 0.88562; s4.data[6, 7] = 0.51782; s4.data[6, 8] = 0.05100; s4.data[6, 9] = -0.28735; s4.data[6, 10] = -0.39369;
            s4.data[7, 0] = -0.39229; s4.data[7, 1] = -0.50485; s4.data[7, 2] = -0.40397; s4.data[7, 3] = -0.05531; s4.data[7, 4] = 0.41712; s4.data[7, 5] = 0.78241; s4.data[7, 6] = 0.85111; s4.data[7, 7] = 0.60553; s4.data[7, 8] = 0.20335; s4.data[7, 9] = -0.14291; s4.data[7, 10] = -0.30375;
            s4.data[8, 0] = -0.30619; s4.data[8, 1] = -0.45562; s4.data[8, 2] = -0.44348; s4.data[8, 3] = -0.20418; s4.data[8, 4] = 0.19441; s4.data[8, 5] = 0.56682; s4.data[8, 6] = 0.72437; s4.data[8, 7] = 0.60280; s4.data[8, 8] = 0.29814; s4.data[8, 9] = -0.01365; s4.data[8, 10] = -0.19807;
            s4.data[9, 0] = -0.20828; s4.data[9, 1] = -0.36417; s4.data[9, 2] = -0.41455; s4.data[9, 3] = -0.28067; s4.data[9, 4] = 0.01676; s4.data[9, 5] = 0.34697; s4.data[9, 6] = 0.54565; s4.data[9, 7] = 0.52468; s4.data[9, 8] = 0.32558; s4.data[9, 9] = 0.07691; s4.data[9, 10] = -0.10038;
            s4.data[10, 0] = -0.11968; s4.data[10, 1] = -0.25761; s4.data[10, 2] = -0.33885; s4.data[10, 3] = -0.28770; s4.data[10, 4] = -0.09334; s4.data[10, 5] = 0.16495; s4.data[10, 6] = 0.36071; s4.data[10, 7] = 0.40369; s4.data[10, 8] = 0.29655; s4.data[10, 9] = 0.12105; s4.data[10, 10] = -0.02705;

            // ma tran he so cho huong 4pi/8 rad
            matransothuc s5 = new matransothuc(11, 11);
            s5.data[0, 0] = -0.20961; s5.data[0, 1] = -0.22466; s5.data[0, 2] = -0.10679; s5.data[0, 3] = 0.12485; s5.data[0, 4] = 0.35900; s5.data[0, 5] = 0.45783; s5.data[0, 6] = 0.35900; s5.data[0, 7] = 0.12485; s5.data[0, 8] = -0.10679; s5.data[0, 9] = -0.22466; s5.data[0, 10] = -0.20961;
            s5.data[1, 0] = -0.27769; s5.data[1, 1] = -0.29762; s5.data[1, 2] = -0.14148; s5.data[1, 3] = 0.16540; s5.data[1, 4] = 0.47560; s5.data[1, 5] = 0.60653; s5.data[1, 6] = 0.47560; s5.data[1, 7] = 0.16540; s5.data[1, 8] = -0.14148; s5.data[1, 9] = -0.29762; s5.data[1, 10] = -0.27769;
            s5.data[2, 0] = -0.34559; s5.data[2, 1] = -0.37039; s5.data[2, 2] = -0.17607; s5.data[2, 3] = 0.20585; s5.data[2, 4] = 0.59189; s5.data[2, 5] = 0.75484; s5.data[2, 6] = 0.59189; s5.data[2, 7] = 0.20585; s5.data[2, 8] = -0.17607; s5.data[2, 9] = -0.37039; s5.data[2, 10] = -0.34559;
            s5.data[3, 0] = -0.40404; s5.data[3, 1] = -0.43304; s5.data[3, 2] = -0.20585; s5.data[3, 3] = 0.24066; s5.data[3, 4] = 0.69199; s5.data[3, 5] = 0.88250; s5.data[3, 6] = 0.69199; s5.data[3, 7] = 0.24066; s5.data[3, 8] = -0.20585; s5.data[3, 9] = -0.43304; s5.data[3, 10] = -0.40404;
            s5.data[4, 0] = -0.44375; s5.data[4, 1] = -0.47560; s5.data[4, 2] = -0.22608; s5.data[4, 3] = 0.26432; s5.data[4, 4] = 0.76000; s5.data[4, 5] = 0.96923; s5.data[4, 6] = 0.76000; s5.data[4, 7] = 0.26432; s5.data[4, 8] = -0.22608; s5.data[4, 9] = -0.47560; s5.data[4, 10] = -0.44375;
            s5.data[5, 0] = -0.45783; s5.data[5, 1] = -0.49069; s5.data[5, 2] = -0.23326; s5.data[5, 3] = 0.27271; s5.data[5, 4] = 0.78413; s5.data[5, 5] = 1.00000; s5.data[5, 6] = 0.78413; s5.data[5, 7] = 0.27271; s5.data[5, 8] = -0.23326; s5.data[5, 9] = -0.49069; s5.data[5, 10] = -0.45783;
            s5.data[6, 0] = -0.44375; s5.data[6, 1] = -0.47560; s5.data[6, 2] = -0.22608; s5.data[6, 3] = 0.26432; s5.data[6, 4] = 0.76000; s5.data[6, 5] = 0.96923; s5.data[6, 6] = 0.76000; s5.data[6, 7] = 0.26432; s5.data[6, 8] = -0.22608; s5.data[6, 9] = -0.47560; s5.data[6, 10] = -0.44375;
            s5.data[7, 0] = -0.40404; s5.data[7, 1] = -0.43304; s5.data[7, 2] = -0.20585; s5.data[7, 3] = 0.24066; s5.data[7, 4] = 0.69199; s5.data[7, 5] = 0.88250; s5.data[7, 6] = 0.69199; s5.data[7, 7] = 0.24066; s5.data[7, 8] = -0.20585; s5.data[7, 9] = -0.43304; s5.data[7, 10] = -0.40404;
            s5.data[8, 0] = -0.34559; s5.data[8, 1] = -0.37039; s5.data[8, 2] = -0.17607; s5.data[8, 3] = 0.20585; s5.data[8, 4] = 0.59189; s5.data[8, 5] = 0.75484; s5.data[8, 6] = 0.59189; s5.data[8, 7] = 0.20585; s5.data[8, 8] = -0.17607; s5.data[8, 9] = -0.37039; s5.data[8, 10] = -0.34559;
            s5.data[9, 0] = -0.27769; s5.data[9, 1] = -0.29762; s5.data[9, 2] = -0.14148; s5.data[9, 3] = 0.16540; s5.data[9, 4] = 0.47560; s5.data[9, 5] = 0.60653; s5.data[9, 6] = 0.47560; s5.data[9, 7] = 0.16540; s5.data[9, 8] = -0.14148; s5.data[9, 9] = -0.29762; s5.data[9, 10] = -0.27769;
            s5.data[10, 0] = -0.20961; s5.data[10, 1] = -0.22466; s5.data[10, 2] = -0.10679; s5.data[10, 3] = 0.12485; s5.data[10, 4] = 0.35900; s5.data[10, 5] = 0.45783; s5.data[10, 6] = 0.35900; s5.data[10, 7] = 0.12485; s5.data[10, 8] = -0.10679; s5.data[10, 9] = 0.22466; s5.data[10, 10] = -0.20961;

            // ma tran he so cho huong 5pi/8 rad
            matransothuc s6 = new matransothuc(11, 11);
            s6.data[0, 0] = -0.11968; s6.data[0, 1] = -0.25761; s6.data[0, 2] = -0.33885; s6.data[0, 3] = -0.28770; s6.data[0, 4] = -0.09334; s6.data[0, 5] = 0.16495; s6.data[0, 6] = 0.36071; s6.data[0, 7] = 0.40369; s6.data[0, 8] = 0.29655; s6.data[0, 9] = 0.12105; s6.data[0, 10] = -0.02705;
            s6.data[1, 0] = -0.20828; s6.data[1, 1] = -0.36417; s6.data[1, 2] = -0.41455; s6.data[1, 3] = -0.28067; s6.data[1, 4] = 0.01676; s6.data[1, 5] = 0.34697; s6.data[1, 6] = 0.54565; s6.data[1, 7] = 0.52468; s6.data[1, 8] = 0.32558; s6.data[1, 9] = 0.07691; s6.data[1, 10] = -0.10038;
            s6.data[2, 0] = -0.30619; s6.data[2, 1] = -0.45562; s6.data[2, 2] = -0.44348; s6.data[2, 3] = -0.20418; s6.data[2, 4] = 0.19441; s6.data[2, 5] = 0.56682; s6.data[2, 6] = 0.72437; s6.data[2, 7] = 0.60280; s6.data[2, 8] = 0.29814; s6.data[2, 9] = -0.01365; s6.data[2, 10] = -0.19807;
            s6.data[3, 0] = -0.39229; s6.data[3, 1] = -0.50485; s6.data[3, 2] = -0.40397; s6.data[3, 3] = -0.05531; s6.data[3, 4] = 0.41712; s6.data[3, 5] = 0.78241; s6.data[3, 6] = 0.85111; s6.data[3, 7] = 0.60553; s6.data[3, 8] = 0.20335; s6.data[3, 9] = -0.14291; s6.data[3, 10] = -0.30375;
            s6.data[4, 0] = -0.44375; s6.data[4, 1] = -0.49199; s6.data[4, 2] = -0.29238; s6.data[4, 3] = 0.14418; s6.data[4, 4] = 0.64024; s6.data[4, 5] = 0.94135; s6.data[4, 6] = 0.88562; s6.data[4, 7] = 0.51782; s6.data[4, 8] = 0.05100; s6.data[4, 9] = -0.28735; s6.data[4, 10] = -0.39369;
            s6.data[5, 0] = -0.44480; s6.data[5, 1] = -0.41395; s6.data[5, 2] = -0.12821; s6.data[5, 3] = 0.35162; s6.data[5, 4] = 0.81047; s6.data[5, 5] = 1.00000; s6.data[5, 6] = 0.81047; s6.data[5, 7] = 0.35162; s6.data[5, 8] = -0.12821; s6.data[5, 9] = -0.41395; s6.data[5, 10] = -0.44480;
            s6.data[6, 0] = -0.39369; s6.data[6, 1] = -0.28735; s6.data[6, 2] = 0.05100; s6.data[6, 3] = 0.51782; s6.data[6, 4] = 0.88562; s6.data[6, 5] = 0.94135; s6.data[6, 6] = 0.64024; s6.data[6, 7] = 0.14418; s6.data[6, 8] = -0.29238; s6.data[6, 9] = -0.49199; s6.data[6, 10] = -0.44375;
            s6.data[7, 0] = -0.30375; s6.data[7, 1] = -0.14291; s6.data[7, 2] = 0.20335; s6.data[7, 3] = 0.60553; s6.data[7, 4] = 0.85111; s6.data[7, 5] = 0.78241; s6.data[7, 6] = 0.41712; s6.data[7, 7] = -0.05531; s6.data[7, 8] = -0.40397; s6.data[7, 9] = -0.50485; s6.data[7, 10] = -0.39229;
            s6.data[8, 0] = -0.19807; s6.data[8, 1] = -0.01365; s6.data[8, 2] = 0.29814; s6.data[8, 3] = 0.60280; s6.data[8, 4] = 0.72437; s6.data[8, 5] = 0.56682; s6.data[8, 6] = 0.19441; s6.data[8, 7] = -0.20418; s6.data[8, 8] = -0.44348; s6.data[8, 9] = -0.45562; s6.data[8, 10] = -0.30619;
            s6.data[9, 0] = -0.10083; s6.data[9, 1] = 0.07691; s6.data[9, 2] = 0.32558; s6.data[9, 3] = 0.52468; s6.data[9, 4] = 0.54565; s6.data[9, 5] = 0.34697; s6.data[9, 6] = 0.01676; s6.data[9, 7] = -0.28067; s6.data[9, 8] = -0.41455; s6.data[9, 9] = -0.36417; s6.data[9, 10] = -0.20828;
            s6.data[10, 0] = -0.02705; s6.data[10, 1] = 0.012105; s6.data[10, 2] = 0.29655; s6.data[10, 3] = 0.40369; s6.data[10, 4] = 0.36071; s6.data[10, 5] = 0.16495; s6.data[10, 6] = -0.09334; s6.data[10, 7] = -0.28770; s6.data[10, 8] = -0.33885; s6.data[10, 9] = -0.25761; s6.data[10, 10] = -0.11968;

            // ma tran he so cho huong 6pi/8 rad
            matransothuc s7 = new matransothuc(11, 11);
            s7.data[0, 0] = -0.05581; s7.data[0, 1] = -0.18181; s7.data[0, 2] = -0.31657; s7.data[0, 3] = -0.40384; s7.data[0, 4] = -0.39445; s7.data[0, 5] = -0.27731; s7.data[0, 6] = -0.09092; s7.data[0, 7] = 0.09523; s7.data[0, 8] = 0.21790; s7.data[0, 9] = 0.25073; s7.data[0, 10] = 0.20961;
            s7.data[1, 0] = -0.18181; s7.data[1, 1] = -0.33699; s7.data[1, 2] = -0.45761; s7.data[1, 3] = -0.47579; s7.data[1, 4] = -0.35607; s7.data[1, 5] = -0.12428; s7.data[1, 6] = 0.13856; s7.data[1, 7] = 0.33749; s7.data[1, 8] = 0.41339; s7.data[1, 9] = 0.36788; s7.data[1, 10] = 0.25073;
            s7.data[2, 0] = -0.31657; s7.data[2, 1] = -0.45761; s7.data[2, 2] = -0.50648; s7.data[2, 3] = -0.40348; s7.data[2, 4] = -0.14990; s7.data[2, 5] = 0.17791; s7.data[2, 6] = 0.46130; s7.data[2, 7] = 0.60147; s7.data[2, 8] = 0.56978; s7.data[2, 9] = 0.41339; s7.data[2, 10] = 0.21790;
            s7.data[3, 0] = -0.40384; s7.data[3, 1] = -0.47579; s7.data[3, 2] = -0.40348; s7.data[3, 3] = -0.15957; s7.data[3, 4] = 0.20160; s7.data[3, 5] = 0.55643; s7.data[3, 6] = 0.77231; s7.data[3, 7] = 0.77880; s7.data[3, 8] = 0.60147; s7.data[3, 9] = 0.33749; s7.data[3, 10] = 0.09523;
            s7.data[4, 0] = -0.39445; s7.data[4, 1] = -0.35607; s7.data[4, 2] = -0.14990; s7.data[4, 3] = 0.20160; s7.data[4, 4] = 0.59232; s7.data[4, 5] = 0.87514; s7.data[4, 6] = 0.93941; s7.data[4, 7] = 0.77231; s7.data[4, 8] = 0.46130; s7.data[4, 9] = 0.13856; s7.data[4, 10] = -0.09092;
            s7.data[5, 0] = -0.27731; s7.data[5, 1] = -0.12428; s7.data[5, 2] = 0.17791; s7.data[5, 3] = 0.55643; s7.data[5, 4] = 0.87514; s7.data[5, 5] = 1.00000; s7.data[5, 6] = 0.87514; s7.data[5, 7] = 0.55643; s7.data[5, 8] = 0.17791; s7.data[5, 9] = -0.12428; s7.data[5, 10] = -0.27731;
            s7.data[6, 0] = -0.09092; s7.data[6, 1] = 0.13856; s7.data[6, 2] = 0.46130; s7.data[6, 3] = 0.77231; s7.data[6, 4] = 0.93941; s7.data[6, 5] = 0.87514; s7.data[6, 6] = 0.59232; s7.data[6, 7] = 0.20160; s7.data[6, 8] = -0.14990; s7.data[6, 9] = -0.35607; s7.data[6, 10] = -0.39445;
            s7.data[7, 0] = 0.09523; s7.data[7, 1] = 0.33749; s7.data[7, 2] = 0.60147; s7.data[7, 3] = 0.77880; s7.data[7, 4] = 0.77231; s7.data[7, 5] = 0.55643; s7.data[7, 6] = 0.20160; s7.data[7, 7] = -0.15957; s7.data[7, 8] = -0.40348; s7.data[7, 9] = -0.47579; s7.data[7, 10] = -0.40384;
            s7.data[8, 0] = 0.21790; s7.data[8, 1] = 0.41339; s7.data[8, 2] = 0.56978; s7.data[8, 3] = 0.60147; s7.data[8, 4] = 0.46130; s7.data[8, 5] = 0.17791; s7.data[8, 6] = -0.14990; s7.data[8, 7] = -0.40348; s7.data[8, 8] = -0.50648; s7.data[8, 9] = -0.45761; s7.data[8, 10] = -0.31657;
            s7.data[9, 0] = 0.25073; s7.data[9, 1] = 0.36788; s7.data[9, 2] = 0.41339; s7.data[9, 3] = 0.33749; s7.data[9, 4] = 0.13856; s7.data[9, 5] = -0.12428; s7.data[9, 6] = -0.35607; s7.data[9, 7] = -0.47579; s7.data[9, 8] = -0.45761; s7.data[9, 9] = -0.33699; s7.data[9, 10] = -0.18181;
            s7.data[10, 0] = 0.20961; s7.data[10, 1] = 0.25073; s7.data[10, 2] = 0.21790; s7.data[10, 3] = 0.09523; s7.data[10, 4] = -0.09092; s7.data[10, 5] = -0.27731; s7.data[10, 6] = -0.39445; s7.data[10, 7] = 0.40384; s7.data[10, 8] = -0.31657; s7.data[10, 9] = -0.18181; s7.data[10, 10] = -0.05581;

            // ma tran he so cho huong 7pi/8 rad
            matransothuc s8 = new matransothuc(11, 11);
            s8.data[0, 0] = -0.11968; s8.data[0, 1] = -0.20828; s8.data[0, 2] = -0.30619; s8.data[0, 3] = -0.39229; s8.data[0, 4] = -0.44375; s8.data[0, 5] = -0.44480; s8.data[0, 6] = -0.39369; s8.data[0, 7] = -0.30375; s8.data[0, 8] = -0.19807; s8.data[0, 9] = -0.10083; s8.data[0, 10] = -0.02705;
            s8.data[1, 0] = -0.25761; s8.data[1, 1] = -0.36417; s8.data[1, 2] = -0.45562; s8.data[1, 3] = -0.50485; s8.data[1, 4] = -0.49199; s8.data[1, 5] = -0.41395; s8.data[1, 6] = -0.28735; s8.data[1, 7] = -0.14291; s8.data[1, 8] = -0.01365; s8.data[1, 9] = 0.07691; s8.data[1, 10] = 0.012105;
            s8.data[2, 0] = -0.33885; s8.data[2, 1] = -0.41455; s8.data[2, 2] = -0.44348; s8.data[2, 3] = -0.40397; s8.data[2, 4] = -0.29238; s8.data[2, 5] = -0.12821; s8.data[2, 6] = 0.05100; s8.data[2, 7] = 0.20335; s8.data[2, 8] = 0.29814; s8.data[2, 9] = 0.32558; s8.data[2, 10] = 0.29655;
            s8.data[3, 0] = -0.28770; s8.data[3, 1] = -0.28067; s8.data[3, 2] = -0.20418; s8.data[3, 3] = -0.05531; s8.data[3, 4] = 0.14418; s8.data[3, 5] = 0.35162; s8.data[3, 6] = 0.51782; s8.data[3, 7] = 0.60553; s8.data[3, 8] = 0.60280; s8.data[3, 9] = 0.52468; s8.data[3, 10] = 0.40369;
            s8.data[4, 0] = -0.09334; s8.data[4, 1] = 0.01676; s8.data[4, 2] = 0.19441; s8.data[4, 3] = 0.41712; s8.data[4, 4] = 0.64024; s8.data[4, 5] = 0.81047; s8.data[4, 6] = 0.88562; s8.data[4, 7] = 0.85111; s8.data[4, 8] = 0.72437; s8.data[4, 9] = 0.54565; s8.data[4, 10] = 0.36071;
            s8.data[5, 0] = 0.16495; s8.data[5, 1] = 0.34697; s8.data[5, 2] = 0.56682; s8.data[5, 3] = 0.78241; s8.data[5, 4] = 0.94135; s8.data[5, 5] = 1.00000; s8.data[5, 6] = 0.94135; s8.data[5, 7] = 0.78241; s8.data[5, 8] = 0.56682; s8.data[5, 9] = 0.34697; s8.data[5, 10] = 0.16495;
            s8.data[6, 0] = 0.36071; s8.data[6, 1] = 0.54565; s8.data[6, 2] = 0.72437; s8.data[6, 3] = 0.85111; s8.data[6, 4] = 0.88562; s8.data[6, 5] = 0.81047; s8.data[6, 6] = 0.64024; s8.data[6, 7] = 0.41712; s8.data[6, 8] = 0.19441; s8.data[6, 9] = 0.01676; s8.data[6, 10] = -0.09334;
            s8.data[7, 0] = 0.40369; s8.data[7, 1] = 0.52468; s8.data[7, 2] = 0.60280; s8.data[7, 3] = 0.60553; s8.data[7, 4] = 0.51782; s8.data[7, 5] = 0.35162; s8.data[7, 6] = 0.14418; s8.data[7, 7] = -0.05531; s8.data[7, 8] = -0.20418; s8.data[7, 9] = -0.28067; s8.data[7, 10] = -0.28770;
            s8.data[8, 0] = 0.29655; s8.data[8, 1] = 0.32558; s8.data[8, 2] = 0.29814; s8.data[8, 3] = 0.20335; s8.data[8, 4] = 0.05100; s8.data[8, 5] = -0.12821; s8.data[8, 6] = -0.29238; s8.data[8, 7] = -0.40397; s8.data[8, 8] = -0.44348; s8.data[8, 9] = -0.41455; s8.data[8, 10] = -0.33885;
            s8.data[9, 0] = 0.12105; s8.data[9, 1] = 0.07691; s8.data[9, 2] = -0.01365; s8.data[9, 3] = -0.14291; s8.data[9, 4] = -0.28735; s8.data[9, 5] = -0.41395; s8.data[9, 6] = -0.49199; s8.data[9, 7] = -0.50485; s8.data[9, 8] = -0.45562; s8.data[9, 9] = -0.36417; s8.data[9, 10] = -0.25761;
            s8.data[10, 0] = -0.02705; s8.data[10, 1] = -0.10038; s8.data[10, 2] = -0.19807; s8.data[10, 3] = -0.30375; s8.data[10, 4] = -0.39369; s8.data[10, 5] = -0.44480; s8.data[10, 6] = -0.44375; s8.data[10, 7] = -0.39229; s8.data[10, 8] = -0.30619; s8.data[10, 9] = -0.20828; s8.data[10, 10] = -0.11968;

            matrannguyen gb = new matrannguyen(sohang, socot);
            matrannguyen g = new matrannguyen(sohang, socot);
            matrannguyen g1 = phanvung();
            g = mthuongmn(16);
            for (int i = 0; i < sohang; ++i)

                for (int j = 0; j < socot; ++j)
                {
                    if (g1.data[i, j] != 255)
                    {
                        int t;
                        t = huongmt(i, j);
                        if (g.data[i, j] == 0) gb.data[i, j] = (int)nhanchap1(i, j, s1);
                        if (g.data[i, j] == 1) gb.data[i, j] = (int)nhanchap1(i, j, s2);
                        if (g.data[i, j] == 2) gb.data[i, j] = (int)nhanchap1(i, j, s3);
                        if (g.data[i, j] == 3) gb.data[i, j] = (int)nhanchap1(i, j, s4);
                        if (g.data[i, j] == 4) gb.data[i, j] = (int)nhanchap1(i, j, s5);
                        if (g.data[i, j] == 5) gb.data[i, j] = (int)nhanchap1(i, j, s6);
                        if (g.data[i, j] == 6) gb.data[i, j] = (int)nhanchap1(i, j, s7);
                        if (g.data[i, j] == 7) gb.data[i, j] = (int)nhanchap1(i, j, s8);

                        gb.data[i, j] = (int)gb.data[i, j] / 20;
                        if (gb.data[i, j] < 0) gb.data[i, j] = 0;
                        if (gb.data[i, j] > 255) gb.data[i, j] = 255;
                    }
                    else gb.data[i, j] = 255;
                }
            return gb;
        }
Exemple #11
0
 public matrannguyen trichdactrung()
 {
     matrannguyen ketqua = new matrannguyen(sohang, socot);
     int i, j;
     for (i = 0; i < sohang; ++i)
         for (j = 0; j < socot; ++j)
             ketqua.data[i, j] = diemdactrung(i, j);
     return ketqua;
 }
Exemple #12
0
 public matrannguyen chonnguong()
 {
     int tg;
     matrannguyen ketqua = new matrannguyen(32, 32);
     for (int i = 0; i < 32; ++i)
         for (int j = 0; j < 32; ++j)
         {
             tg = 0;
             for (int k = 0; k < 16; ++k)
                 for (int l = 0; l < 16; ++l)
                 {
                     tg += data[16 * i + k, 16 * j + l];
                 }
             ketqua.data[i, j] = tg;
             ketqua.data[i, j] = (int)(ketqua.data[i, j] / (16 * 16));
         }
     return ketqua;
 }
Exemple #13
0
        private void bwLuongXuly_DoWork(object sender, DoWorkEventArgs e)
        {
            mt = mt.gabor();
            anhGabor = mt.ToBitmap();
            bwLuongXuly.ReportProgress(20);

            anhNhiPhan = vnSumarySDK.CaiThienAnh(anhGoc);
            bwLuongXuly.ReportProgress(40);

            anhXuong = vnSumarySDK.LayAnhXuong(anhNhiPhan);
            bwLuongXuly.ReportProgress(60);

            anhDacTrung = vnSumarySDK.LayAnhDacTrung(anhNhiPhan);
            bwLuongXuly.ReportProgress(80);
            anhTrungBinh = vnSumarySDK.LayAnhDacTrungANN(anhNhiPhan);
            bwLuongXuly.ReportProgress(100);
        }