Determining the Distance Between Images

 

Use eVe’s Distance method to retrieve a floating point value representing the distance between the indexed signatures of two EDFs. This only applies to one index type at a time. For example, you could get the result texture distance from a source image to a target image.

 

// open a new media collection

//

MediaCollection mediaCollection = Eve.newMediaCollection();

try

{

    mediaCollection.open("<some path>");

    //

    // get list of existing keys

    //

    long keys[] = mediaCollection.getKeys();

    //

    // pick up the first two entries and retrieve the MediaObjects

    //

    MediaObject record1 = mediaCollection.getMediaObject(keys[0]);

    MediaObject record2 = mediaCollection.getMediaObject(keys[1]);

    //

    // now - determine the color distance between the two records

    //

    Distance colorDistance = Eve.newColorDistance();

    Vector record1ColorSignature = record1.getIndex(Eve.COLOR);

    Vector record2ColorSignature = record2.getIndex(Eve.COLOR);

    double distance = colorDistance.distance(record1ColorSignature,record2ColorSignature);

    System.out.println("Distance: " + distance);

}

catch (Exception e)

{

   }