es.davy.ai

Preguntas y respuestas de programación confiables

¿Tienes una pregunta?

Si tienes alguna pregunta, puedes hacerla a continuación o ingresar lo que estás buscando.

Tag: IMAGEHASH

Cómo comparar valores hash en Python.

Quiero saber cómo comparar dos valores de hash, no la distancia de Hamming. ¿Hay alguna manera? El objetivo final es determinar la clave del diccionario de Python que las imágenes similares pueden tener en común. Por ejemplo: import imagehash img1_hash = imagehash.average_hash (Image.open (‘data/image1.jpg’)) img2_hash = imagehash.average_hash (Image.open (‘data/image2.jpg’)) img3_hash . . . Read more

Agrupando valores hash similares

Cambio las imágenes por valores hash e intento clasificar las imágenes con valores hash similares en el mismo grupo. Por ejemplo: import imagehash img1_hash = imagehash.average_hash(Image.open(‘data/image1.jpg’)) img2_hash = imagehash.average_hash(Image.open(‘data/image2.jpg’)) img3_hash = imagehash.average_hash(Image.open(‘data/image3.jpg’)) img4_hash = imagehash.average_hash(Image.open(‘data/image4.jpg’)) print(img1_hash, img2_hash, img3_hash, img4_hash) >> 81c38181bf8781ff, 81838181bf8781ff, 81838181bf8781ff, ff0000ff3f00e7ff hash_lst = [[‘img1’, img1_hash], [‘img2’, img2_hash], . . . Read more