myFunctions.py 文件源码

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

项目:Signal_Identification_Python 作者: camigomez35 项目源码 文件源码
def reconocedor(img):
    fil, col = img.shape[:2]
    #cv2.imshow('Origin', img)
    contador = 0
    respuesta = 0
    for filename in glob.glob('seniales/*.jpg'):
        im= cv2.imread(filename)
        im = cv2.resize(im, (col,fil))
        res = cv2.matchTemplate(img,im,cv2.TM_CCORR)
        threshold = 0.9
        while ((res[0])[0] > 10): 
            (res[0])[0] = (res[0])[0] / 10;
        loc = (res[0])[0]/10 >= threshold
        contador = contador +1
        if(loc):
            respuesta = contador
        #cv2.imshow(filename, im)
    #cv2.waitKey() # Permanece la imagen en pantalla hasta presionar una tecla
    #cv2.destroyAllWindows() # Cierra todas las ventanas abiertas
    return respuesta;
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号