当前位置: 首页>>代码示例>>Java>>正文


Java MLuxAutoCorrelogramExtraction类代码示例

本文整理汇总了Java中net.semanticmetadata.lire.imageanalysis.correlogram.MLuxAutoCorrelogramExtraction的典型用法代码示例。如果您正苦于以下问题:Java MLuxAutoCorrelogramExtraction类的具体用法?Java MLuxAutoCorrelogramExtraction怎么用?Java MLuxAutoCorrelogramExtraction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MLuxAutoCorrelogramExtraction类属于net.semanticmetadata.lire.imageanalysis.correlogram包,在下文中一共展示了MLuxAutoCorrelogramExtraction类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AutoColorCorrelogram

import net.semanticmetadata.lire.imageanalysis.correlogram.MLuxAutoCorrelogramExtraction; //导入依赖的package包/类
/**
 * Creates a new AutoColorCorrelogram using a maximum L_inf pixel distance for analysis and given mode
 *
 * @param maxDistance maximum L_inf pixel distance for analysis
 * @param mode        the mode of calculation (determines the speed of extraction)
 */
public AutoColorCorrelogram(int maxDistance, Mode mode) {
    this(DEFAULT_NUMBER_COLORS, null, new MLuxAutoCorrelogramExtraction(mode));
    int[] D = new int[maxDistance];
    for (int i = 0; i < maxDistance; i++) D[i] = i + 1;
    this.distanceSet = D;
}
 
开发者ID:fish2000,项目名称:lire,代码行数:13,代码来源:AutoColorCorrelogram.java

示例2: testMethodsPerformance

import net.semanticmetadata.lire.imageanalysis.correlogram.MLuxAutoCorrelogramExtraction; //导入依赖的package包/类
public void testMethodsPerformance() throws IOException {
    AutoColorCorrelogram[] acc = new AutoColorCorrelogram[4];
    int[] D = {1, 3, 5, 7};
    int C = 64;
    acc[0] = new AutoColorCorrelogram(C, D, new MLuxAutoCorrelogramExtraction(AutoColorCorrelogram.Mode.SuperFast));
    acc[1] = new AutoColorCorrelogram(C, D, new MLuxAutoCorrelogramExtraction(AutoColorCorrelogram.Mode.FullNeighbourhood));
    acc[2] = new AutoColorCorrelogram(C, D, new NaiveAutoCorrelogramExtraction());
    acc[3] = new AutoColorCorrelogram(C, D, DynamicProgrammingAutoCorrelogramExtraction.getInstance());
    int[] testSet = {284, 77, 108, 416, 144, 534, 898, 104, 67, 10};

    //reads all images
    BufferedImage[] image = new BufferedImage[testSet.length];
    for (int j = 0; j < testSet.length; j++) {
        int id = testSet[j];
        String file = testExtensive + "/" + id + ".jpg";
        image[j] = ImageIO.read(new FileInputStream(file));
    }


    for (int i = 0; i < 4; i++) {
        long t0 = System.currentTimeMillis();
        for (int j = 0; j < testSet.length; j++) {
            acc[i].extract(image[j]);
            System.out.print(".");
        }
        long tf = System.currentTimeMillis();
        long dt = tf - t0;
        double avt = (double) dt / testSet.length;
        System.out.printf("Method %d: total time %d, average %f\n", i, dt, avt);
    }
}
 
开发者ID:fish2000,项目名称:lire,代码行数:32,代码来源:AutoColorCorrelogramTest.java


注:本文中的net.semanticmetadata.lire.imageanalysis.correlogram.MLuxAutoCorrelogramExtraction类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。