Ask Your Question
0

Average meansurements of CEDD + FCTH + SURF + Tamura + Haralick results

asked 2016-05-19 10:20:25 -0600

How can I measure an average of all metrics together?

For exemple: Assume that we have the following values:

To each image, we have values to features extrated, and the below numbers are Euclidian Distance between vectors the images.

Image 1 vs Image 2: CEDD: 4.2426 FCTH: 4.123 SURF: 1681.763 Tamura: 512.906 Haralick: 613.63

Image 1 vs Image 3: CEDD: 5.2426 FCTH: 3.123 SURF: 1281.763 Tamura: 812.906 Haralick: 413.63

What average I could use?

Simple Average? Weighted Average?

Thanks

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-07-05 10:29:52 -0600

sawa gravatar image

You can check the following code for FCTH using c# and run exactly. In addition stored in the "postgresql" database

static class Program
{

    static private double TanimotoClassifier(double[] Table1, double[] Table2)
    {
        double Result = 0;
        double Temp1 = 0;
        double Temp2 = 0;

        double TempCount1 = 0, TempCount2 = 0, TempCount3 = 0;

        for (int i = 0; i < 192; i++)
        {
            Temp1 += Table1[i];
            Temp2 += Table2[i];
        }

        if (Temp1 == 0 || Temp2 == 0) Result = 100;
        if (Temp1 == 0 && Temp2 == 0) Result = 0;

        if (Temp1 > 0 && Temp2 > 0)
        {
            for (int i = 0; i < 192; i++)
            {
                TempCount1 += (Table1[i] / Temp1) * (Table2[i] / Temp2);
                TempCount2 += (Table2[i] / Temp2) * (Table2[i] / Temp2);
                TempCount3 += (Table1[i] / Temp1) * (Table1[i] / Temp1);

            }

            Result = (100 - 100 * (TempCount1 / (TempCount2 + TempCount3 - TempCount1)));
        }

        return (Result);

    }



    static void Main()
    {

        string connectionString = "Server=localhost;port=5432;Database=dbtest;User ID=postgres;Password=123";

        NpgsqlConnection dbcon = new NpgsqlConnection(connectionString);
        dbcon.Open();

        NpgsqlCommand dbcmd = dbcon.CreateCommand();


        double TotalDeviation = 0; // Here you will store the deviation of the images (pairwise)

        double[] FCTHTable_Source = new double[192];  
        double[] FCTHTable_ToCompare = new double[192];

        Bitmap ImageData1 = new Bitmap("E:\\nf\\aa.jpg");
        Bitmap ImageData2 = new Bitmap("E:\\nf\\ee.jpg");


        FCTH GetFCTH = new FCTH();

        FCTHTable_Source = GetFCTH.Apply(ImageData1, 2);
        FCTHTable_ToCompare = GetFCTH.Apply(ImageData2, 2);


        TotalDeviation = TanimotoClassifier(FCTHTable_ToCompare, FCTHTable_Source); // We are Using Tanimoto in order to Compare Images



        try
        {
            string sql1 = "INSERT INTO tbtest(dev) VALUES (" + TotalDeviation + ")";

            dbcmd.CommandText = sql1;
            dbcmd.ExecuteNonQuery();
        }
        catch (NpgsqlException ex)
        {

            if (ex.Data == null)
            {
                throw;
            }
            else
            {

            }
        }


    }

}
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-05-19 10:20:25 -0600

Seen: 1,070 times

Last updated: May 19 '16