LIRe 源代码分析 7:算法类[以颜色直方图为例]
前面关于LIRe的文章,介绍的都是架构方面的东西:
前几篇文章介绍了LIRe 的基本接口:
LIRe 源代码分析 1:整体结构
LIRe 源代码分析 2:基本接口(DocumentBuilder)
LIRe 源代码分析 3:基本接口(ImageSearcher)
以及其建立索引(DocumentBuilder)[以颜色直方图为例]
LIRe 源代码分析 4:建立索引(DocumentBuilder)[以颜色直方图为例]
LIRe 源代码分析 5:提取特征向量[以颜色直方图为例]
LIRe 源代码分析 6:检索(ImageSearcher)[以颜色直方图为例]
前面这些文章都没有细研究具体算法。本文以颜色直方图为例,介绍一下算法类的实现。
颜色直方图算法的实现位于ColorLayoutImpl类中,该类处于“net.semanticmetadata.lire.imageanalysis.mpeg7”包中,如图所示:
![LIRe 源代码分析 七:算法类[以颜色直方图为例]](http://img.reader8.net/uploadfile/jiaocheng/20140140/2722/2014012719221718909.jpg)
ColorLayoutImpl类的代码量很大,很多地方都还没有研究,在这里仅展示部分已经看过的代码:
protected int numCCoeff = 28, numYCoeff = 64;