mvmc.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:ddnn 作者: kunglab 项目源码 文件源码
def match_hists(hists):
    matches = {}
    idx = 0
    for i in range(len(hists)):
        for j in range(len(hists[i])):
            matches['{}_{}'.format(i,j)] = idx
            idx += 1


    for i in range(len(hists)):
        for j in range(i+1, len(hists)):
            for k in range(len(hists[i])):
                corrs = []
                for l in range(len(hists[j])):
                    corr = cv2.compareHist(hists[i][k], hists[j][l], cv2.cv.CV_COMP_INTERSECT)
                    corrs.append(corr)

                corrs = np.array(corrs)
                idxs = np.argsort(corrs)
                if corrs[idxs[-1]] > 0.80:
                    matches['{}_{}'.format(j, idxs[-1])] = matches['{}_{}'.format(i, k)]

    return matches
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号