Пример #1
0
        void GenerarSet()
        {
            string [] text = Directory.GetFiles("./texturas");


            TxtSet = new Dictionary <string, double[]>(text.Length);
            TxtDB  = new Dictionary <string, double>(text.Length);
            setStr = new string[text.Length];
            setBmp = new Bitmap[text.Length];
            int k = 0;

            foreach (string s in text)
            {
                double [] d   = new double[6];
                Bitmap    tmp = new Bitmap(Bitmap.FromFile(s));
                setBmp[k] = new Bitmap(tmp);
                setStr[k] = s;
                string name = Path.GetFileNameWithoutExtension(s);


                Texturas.CalcSDH(new Bitmap(Bitmap.FromFile(s)));

                d[0] = Texturas.homogeneidad;
                d[1] = Texturas.contraste;
                d[2] = Texturas.energia;
                d[3] = Texturas.entropia;
                d[4] = Texturas.media;
                d[5] = Utils.Mean(tmp);
                TxtSet.Add(name, d);
                k++;
            }
            this.ks = k;
            textBox1.AppendText("Set de Clasificacion  generado correctamente");
        }
Пример #2
0
        //calcula las propiedades de la imagen de entrada
        void getImg(Bitmap tmp)
        {
            vimg = new double[6];
            Texturas.CalcSDH(tmp);

            vimg[0] = Texturas.homogeneidad;
            vimg[1] = Texturas.contraste;
            vimg[2] = Texturas.energia;
            vimg[3] = Texturas.entropia;
            vimg[4] = Texturas.media;
            vimg[5] = Utils.Mean(tmp);
        }