@Override public double getDistance(LireFeature feature) { if (!(feature instanceof SPFCTH)) return -1; return MetricsUtils.tanimoto(histogram, feature.getFeatureVector()); }
@Override public double getDistance(LireFeature feature) { if (!(feature instanceof SPJCD)) return -1; return MetricsUtils.tanimoto(histogram, feature.getFeatureVector()); }
@Override public double getDistance(LireFeature feature) { if (!(feature instanceof SPCEDD)) return -1; return MetricsUtils.tanimoto(histogram, feature.getFeatureVector()); }
@Override public double getDistance(LireFeature feature) { if (!(feature instanceof SPCEDD)) return -1; return MetricsUtils.tanimoto(histogram, feature.getFeatureVector()); }
@Override public double getDistance(LireFeature feature) { if (!(feature instanceof SPACC)) return -1; return MetricsUtils.tanimoto(histogram, feature.getFeatureVector()); }
@Override public double getDistance(LireFeature feature) { if (!(feature instanceof SPFCTH)) return -1; return MetricsUtils.tanimoto(histogram, feature.getFeatureVector()); }
@Override public double getDistance(LireFeature feature) { if (!(feature instanceof SPACC)) return -1; return MetricsUtils.tanimoto(histogram, feature.getFeatureVector()); }
@Override public double getDistance(LireFeature feature) { if (!(feature instanceof SPJCD)) return -1; return MetricsUtils.tanimoto(histogram, feature.getFeatureVector()); }
@Override public double getDistance(LireFeature feature) { return MetricsUtils.tanimoto(histogram, feature.getFeatureVector()); }
@Override public double getDistance(LireFeature feature) { return MetricsUtils.tanimoto(histogram, feature.getFeatureVector()); }
@Override public double getDistance(LireFeature vd) { // Check if instance of the right class ... if (!(vd instanceof SimpleColorHistogram)) throw new UnsupportedOperationException("Wrong descriptor."); // casting ... SimpleColorHistogram ch = (SimpleColorHistogram) vd; // check if parameters are fitting ... if ((ch.histogram.length != histogram.length) || (ch.histogramType != histogramType)) throw new UnsupportedOperationException("Histogram lengths or color spaces do not match"); // do the comparison ... double sum = 0; if (distFunc == DistanceFunction.JSD) return MetricsUtils.jsd(histogram, ch.histogram); else if (distFunc == DistanceFunction.TANIMOTO) return MetricsUtils.tanimoto(histogram, ch.histogram); else if (distFunc == DistanceFunction.L1) return MetricsUtils.distL1(histogram, ch.histogram); else return MetricsUtils.distL2(histogram, ch.histogram); }
@Override public double getDistance(LireFeature vd) { // Check if instance of the right class ... if (!(vd instanceof SimpleColorHistogram)) throw new UnsupportedOperationException("Wrong descriptor."); // casting ... SimpleColorHistogram ch = (SimpleColorHistogram) vd; // check if parameters are fitting ... if ((ch.histogram.length != histogram.length) || (ch.histogramType != histogramType)) throw new UnsupportedOperationException("Histogram lengths or color spaces do not match"); // do the comparison ... double sum = 0; if (distFunc == DistanceFunction.JSD) return MetricsUtils.jsd(histogram, ch.histogram); else if (distFunc == DistanceFunction.TANIMOTO) return MetricsUtils.tanimoto(histogram, ch.histogram); else if (distFunc == DistanceFunction.L1) return MetricsUtils.distL1(histogram, ch.histogram); else return MetricsUtils.distL2(histogram, ch.histogram); }
@Override public float getDistance(LireFeature feature) { return (float) MetricsUtils.tanimoto(histogram, feature.getDoubleHistogram()); }
@Override public float getDistance(LireFeature feature) { if (!(feature instanceof SPCEDD)) return -1; return (float) MetricsUtils.tanimoto(histogram, feature.getDoubleHistogram()); }
@Override public float getDistance(LireFeature feature) { if (!(feature instanceof SPACC)) return -1; return (float) MetricsUtils.tanimoto(histogram, feature.getDoubleHistogram()); }
@Override public float getDistance(LireFeature feature) { if (!(feature instanceof SPJCD)) return -1; return (float) MetricsUtils.tanimoto(histogram, feature.getDoubleHistogram()); }
@Override public float getDistance(LireFeature feature) { if (!(feature instanceof SPFCTH)) return -1; return (float) MetricsUtils.tanimoto(histogram, feature.getDoubleHistogram()); }
public float getDistance(LireFeature vd) { // Check if instance of the right class ... if (!(vd instanceof SimpleColorHistogram)) throw new UnsupportedOperationException("Wrong descriptor."); // casting ... SimpleColorHistogram ch = (SimpleColorHistogram) vd; // check if parameters are fitting ... if ((ch.histogram.length != histogram.length) || (ch.histogramType != histogramType)) throw new UnsupportedOperationException("Histogram lengths or color spaces do not match"); // do the comparison ... double sum = 0; if (distFunc == DistanceFunction.JSD) return (float) MetricsUtils.jsd(histogram, ch.histogram); else if (distFunc == DistanceFunction.TANIMOTO) return (float) MetricsUtils.tanimoto(histogram, ch.histogram); else if (distFunc == DistanceFunction.L1) return (float) MetricsUtils.distL1(histogram, ch.histogram); else return (float) MetricsUtils.distL2(histogram, ch.histogram); }