weakiwi
V2EX  ›  问与答

如何提高 PIL 检测相似度的成功率

  •  
  •   weakiwi · Nov 24, 2015 · 1798 views
    This topic created in 3825 days ago, the information mentioned may be changed or developed.
    def When2Esct(im1, im2):#判断是否在回放  
        h1 = im1.histogram()
        h2 = im2.histogram()   
        rms = math.sqrt(reduce(operator.add,  list(map(lambda a,b: (a-b)**2, h1, h2)))/len(h1) )
        return rms
    

    在网上搬过来的函数,结果实际使用中遇到了问题。再检测下面两张图的区别时发现相似度特别高。。。完全达不到想要的目的,想请教下各位有什么提高检测成功率的方法,多谢啦。

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3068 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 09:10 · PVG 17:10 · LAX 02:10 · JFK 05:10
    ♥ Do have faith in what you're doing.