saliency.py 文件源码

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

项目:saliency 作者: shuuchen 项目源码 文件源码
def sumNormalizedFeatures(features, levels=9, startSize=(1983*8, 1088*8)):
    """
        Normalizes the feature maps in argument features and combines them into one.
        Arguments:
            features    : list of feature maps (images)
            levels      : the levels of the Gaussian pyramid used to
                            calculate the feature maps.
            startSize   : the base size of the Gaussian pyramit used to
                            calculate the feature maps.
        returns:
            a combined feature map.
    """
    commonWidth = startSize[0] / 2**(levels/2 - 1)
    commonHeight = startSize[1] / 2**(levels/2 - 1)
    commonSize = commonWidth, commonHeight
    logger.info("Size of conspicuity map: %s", commonSize)
    consp = N(cv2.resize(features[0][1], commonSize))
    for f in features[1:]:
        resized = N(cv2.resize(f[1], commonSize))
        consp = cv2.add(consp, resized)
    return consp
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号