@Override public double getDistance(LireFeature feature) { // chi^2 distance ... as mentioned in the paper. // double distance = 0; // double lower; // for (int i = 0; i < histogram.length; i++) { // lower = histogram[i] + ((PHOG) feature).histogram[i]; // if (lower > 0) // distance += (histogram[i] - ((PHOG) feature).histogram[i]) * (histogram[i] - ((PHOG) feature).histogram[i]) / lower; // } // return (float) distance; return MetricsUtils.distL1(histogram, ((PHOG) feature).histogram); }
@Override public double getDistance(LireFeature feature) { // chi^2 distance ... as mentioned in the paper. // double distance = 0; // double lower; // for (int i = 0; i < histogram.length; i++) { // lower = histogram[i] + ((BinaryPatternsPyramid) feature).histogram[i]; // if (lower > 0) // distance += (histogram[i] - ((BinaryPatternsPyramid) feature).histogram[i]) * (histogram[i] - ((BinaryPatternsPyramid) feature).histogram[i]) / lower; // } // return (float) distance; return MetricsUtils.distL1(histogram, ((BinaryPatternsPyramid) feature).histogram); }
@Override public double getDistance(LireFeature feature) { // chi^2 distance ... as mentioned in the paper. // double distance = 0; // double lower; // for (int i = 0; i < histogram.length; i++) { // lower = histogram[i] + ((BinaryPatternsPyramid) feature).histogram[i]; // if (lower > 0) // distance += (histogram[i] - ((BinaryPatternsPyramid) feature).histogram[i]) * (histogram[i] - ((BinaryPatternsPyramid) feature).histogram[i]) / lower; // } // return (float) distance; return MetricsUtils.distL1(histogram, ((BinaryPatternsPyramid) feature).histogram); }
@Override public double getDistance(LireFeature feature) { return MetricsUtils.distL1(histogram, ((LuminanceLayout) feature).histogram); }
@Override public double getDistance(net.semanticmetadata.lire.imageanalysis.features.LireFeature lireFeature) { if(!(lireFeature instanceof ShapemeHistogram)){ throw new RuntimeException("not implemented"); } return net.semanticmetadata.lire.utils.MetricsUtils.distL1(((ShapemeHistogram) lireFeature).histogram, histogram); }
@Override public double getDistance(LireFeature feature) { // it is assumed that the histograms are of equal length. if (! (feature instanceof GenericShortLireFeature)) throw new UnsupportedOperationException("This is not a GenericByteLireFeature object."); assert ((GenericShortLireFeature) feature).data.length == data.length; return MetricsUtils.distL1(((GenericShortLireFeature) feature).data, data); }
@Override public double getDistance(LireFeature feature) { // it is assumed that the histograms are of equal length. if (! (feature instanceof GenericIntLireFeature)) throw new UnsupportedOperationException("This is not a GenericByteLireFeature object."); assert ((GenericIntLireFeature) feature).data.length == data.length; return MetricsUtils.distL1(((GenericIntLireFeature) feature).data, data); }
@Override public double getDistance(net.semanticmetadata.lire.imageanalysis.features.LireFeature lireFeature) { if(!(lireFeature instanceof ShapemeHistogram)){ throw new RuntimeException("not implemented"); } return net.semanticmetadata.lire.utils.MetricsUtils.distL1(((ShapemeHistogram) lireFeature).histogram, histogram); }
@Override public double getDistance(LireFeature feature) { // it is assumed that the histograms are of equal length. if (! (feature instanceof GenericShortLireFeature)) throw new UnsupportedOperationException("This is not a GenericByteLireFeature object."); assert ((GenericShortLireFeature) feature).data.length == data.length; return MetricsUtils.distL1(((GenericShortLireFeature) feature).data, data); }
@Override public double getDistance(LireFeature feature) { // it is assumed that the histograms are of equal length. if (! (feature instanceof GenericByteLireFeature)) throw new UnsupportedOperationException("This is not a GenericByteLireFeature object."); assert ((GenericByteLireFeature) feature).data.length == data.length; return MetricsUtils.distL1(((GenericByteLireFeature) feature).data, data); }
@Override public double getDistance(LireFeature feature) { // it is assumed that the histograms are of equal length. if (! (feature instanceof GenericByteLireFeature)) throw new UnsupportedOperationException("This is not a GenericByteLireFeature object."); assert ((GenericByteLireFeature) feature).data.length == data.length; return MetricsUtils.distL1(((GenericByteLireFeature) feature).data, data); }
@Override public double getDistance(LireFeature feature) { // it is assumed that the histograms are of equal length. if (! (feature instanceof GenericIntLireFeature)) throw new UnsupportedOperationException("This is not a GenericByteLireFeature object."); assert ((GenericIntLireFeature) feature).data.length == data.length; return MetricsUtils.distL1(((GenericIntLireFeature) feature).data, data); }
@Override public double getDistance(LireFeature feature) { if (feature instanceof SimpleCentrist) return MetricsUtils.distL1(histogram, feature.getFeatureVector()); else return -1d; }
@Override public double getDistance(LireFeature feature) { if (!(feature instanceof SPLBP)) return -1; return MetricsUtils.distL1(histogram, feature.getFeatureVector()); }
@Override public double getDistance(LireFeature feature) { if (!(feature instanceof SPLBP)) return -1; return MetricsUtils.distL1(histogram, feature.getFeatureVector()); }
@Override public double getDistance(LireFeature feature) { if (feature instanceof SpatialPyramidCentrist) return MetricsUtils.distL1(histogram, feature.getFeatureVector()); else return -1d; }
@Override public double getDistance(LireFeature feature) { if (feature instanceof SpatialPyramidCentrist) return MetricsUtils.distL1(histogram, feature.getFeatureVector()); else return -1d; }
@Override public double getDistance(LireFeature feature) { if (feature instanceof SimpleCentrist) return MetricsUtils.distL1(histogram, feature.getFeatureVector()); else return -1d; }
@Override public double getDistance(LireFeature feature) { return MetricsUtils.distL1(histogram, feature.getFeatureVector()); }
@Override public double getDistance(LireFeature feature) { return MetricsUtils.distL1(histogram, feature.getFeatureVector()); }