{"id":3163,"date":"2021-06-10T22:26:00","date_gmt":"2021-06-10T14:26:00","guid":{"rendered":"https:\/\/www.yumefx.com\/?p=3163"},"modified":"2021-06-11T11:35:46","modified_gmt":"2021-06-11T03:35:46","slug":"%e5%9b%be%e7%89%87%e7%9b%b8%e4%bc%bc%e7%ae%97%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.yumefx.com\/?p=3163","title":{"rendered":"\u56fe\u7247\u76f8\u4f3c\u7b97\u6cd5"},"content":{"rendered":"\n<h1 style=\"text-align: center;\">\u524d\u8a00<\/h1>\n<p>\u8fd9\u51e0\u5e74\u901a\u8fc7\u7528P\u7ad9\u722c\u866b\u3001cg\u56fe\u5305\u5206\u4eab\u3001\u96f6\u6563\u6536\u96c6\u7b49\u624b\u6bb5\uff0c\u5c6f\u4e86\u8fd11T\u7684\u52a8\u6f2b\u56fe\u7247\uff0c\u591a\u5219\u591a\u77e3\u5374\u826f\u83a0\u4e0d\u9f50\uff0c\u5176\u4e2d\u66f4\u662f\u6709\u5927\u91cf\u7684\u91cd\u590d\u6216\u8005\u8fd1\u4f3c\u56fe\u7247\u3002<\/p>\n<p>\u6700\u8fd1\u60f3\u6574\u7406\u4e00\u4e0b\u8fd9\u4e9b\u5b58\u8d27\uff0c\u4e8e\u662f\u8981\u5148\u628a\u91cd\u590d\u548c\u8fd1\u4f3c\u7684\u56fe\u7247\u8bc6\u522b\u51fa\u6765\u5148\u5904\u7406\u6389\u3002<\/p>\n<p>\u8bd5\u7528\u4e86\u91cd\u590d\u6587\u4ef6\u7684\u67e5\u627e\u795e\u5668Duplicate Cleaner Pro\uff0c\u4f7f\u7528\u56fe\u7247\u6a21\u5f0f\u626b\u63cf\u540e\u786e\u5b9e\u627e\u51fa\u4e86\u4e00\u4e9b\u8fd1\u4f3c\u56fe\u7247\uff0c\u4f46\u5374\u6709\u975e\u5e38\u591a\u6f0f\u7f51\u4e4b\u9c7c\u3002<\/p>\n<p>\u679c\u7136\uff0c\u8fd8\u662f\u8981\u81ea\u5df1\u52a8\u624b\u4e30\u8863\u8db3\u98df\uff0c\u5c31\u7814\u7a76\u4e86\u4e00\u4e0b\u4f7f\u7528python\u641c\u7d22\u8fd1\u4f3c\u56fe\u7247\u7684\u65b9\u6cd5\uff0c\u6548\u679c\u5f88\u4e0d\u9519\uff0c\u8bb0\u5f55\u5982\u4e0b\u3002<\/p>\n<h1>&nbsp;<\/h1>\n<h1 style=\"text-align: center;\">\u539f\u7406<\/h1>\n<p>\u5bf9\u4e8e\u91cd\u590d\u7684\u6587\u4ef6\uff0c\u4e00\u822c\u662f\u4f7f\u7528MD5\u3001SHA-1\u7b49\u7b97\u6cd5\u8ba1\u7b97\u51fa\u6587\u4ef6\u7684\u54c8\u5e0c\u503c\uff0c\u518d\u8fdb\u884c\u5bf9\u6bd4\uff0c\u4f18\u70b9\u662f\u8ba1\u7b97\u901f\u5ea6\u6bd4\u8f83\u5feb\uff0c\u9519\u8bef\u7387\u6781\u4f4e\u3002<\/p>\n<p>\u4f46\u5bf9\u4e8e\u56fe\u7247\u6765\u8bf4\uff0c\u56fe\u50cf\u683c\u5f0f\u3001\u5143\u6570\u636e\u7b49\u7b49\u90fd\u4f1a\u5bfc\u81f4\u50cf\u7d20\u5185\u5bb9\u5b8c\u5168\u76f8\u540c\u7684\u60c5\u51b5\u4e0b\u6709\u4e0d\u540c\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u5185\u5bb9\uff0c\u4ece\u800c\u5bfc\u81f4\u54c8\u5e0c\u503c\u622a\u7136\u4e0d\u540c\u3002<\/p>\n<p>\u66f4\u4f55\u51b5\u5982\u679c\u8981\u641c\u5bfb\u5bf9\u56fe\u7247\u8fdb\u884c\u5206\u8fa8\u7387\u3001\u4eae\u5ea6\u3001\u8272\u5ea6\u3001\u5bf9\u6bd4\u5ea6\u3001\u6a21\u7cca\u5ea6\u3001\u7f29\u653e\u3001\u65cb\u8f6c\u3001\u622a\u53d6\u3001\u5c0f\u5e45\u5ea6\u4fee\u6539\u56fe\u7247\u5185\u5bb9\u7b49\u64cd\u4f5c\u5bfc\u81f4\u7684\u76f8\u4f3c\u56fe\u7247\u65f6\uff0c\u539f\u56fe\u4e0e\u4fee\u6539\u540e\u7684\u56fe\u4e4b\u95f4\u54c8\u5e0c\u503c\u7684\u5de8\u5927\u5dee\u5f02\u662f\u5b8c\u5168\u65e0\u6cd5\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u4f7f\u7528\u7684\u3002<\/p>\n<p>\u56e0\u6b64\u76f8\u4f3c\u56fe\u7247\u7684\u641c\u7d22\u9700\u8981\u5bf9\u6bd4\u7684\u4e0d\u662f\u6587\u4ef6\u7684\u4e8c\u8fdb\u5236\u5185\u5bb9\uff0c\u800c\u662f\u56fe\u7247\u4e0a\u6bcf\u4e2a\u50cf\u7d20\u7684\u8272\u5f69\u5206\u5e03\u65b9\u5f0f\u5373\u56fe\u50cf\u54c8\u5e0c\u503c\u3002<\/p>\n<p>\u6839\u636e\u8272\u5f69\u5206\u5e03\u65b9\u5f0f\u7684\u8ba1\u7b97\u65b9\u5f0f\u4e0d\u540c\uff0c\u5e38\u7528\u7684\u56fe\u7247\u76f8\u4f3c\u5ea6\u7b97\u6cd5\u6709aHash\u3001dHash\u3001pHash\u7b49\uff0c\u57fa\u672c\u7684\u5de5\u4f5c\u6b65\u9aa4\u4e3a\u5316\u7b80\u56fe\u7247-\u8ba1\u7b97\u56fe\u50cf\u54c8\u5e0c\u503c\u3001\u5bf9\u6bd4\u5f97\u51fa\u76f8\u4f3c\u5ea6\u3002<\/p>\n<h1>&nbsp;<\/h1>\n<h1 style=\"text-align: center;\">\u5316\u7b80\u56fe\u7247<\/h1>\n<p>\u4e00\u5f20\u5e38\u89c1\u76841080p\u56fe\u7247\u7684\u5206\u8fa8\u7387\u662f1920*1080\uff0c\u8d85\u8fc7200\u4e07\u50cf\u7d20\uff0c\u6bcf\u4e2a\u50cf\u7d20\u6709\u7ea2\u7eff\u84dd\u4e09\u4e2a\u901a\u9053\uff08\u90e8\u5206\u683c\u5f0f\u8fd8\u6709Alpha\u900f\u660e\u901a\u9053\uff09\uff0c\u6bcf\u4e2a\u901a\u9053\u53ef\u53d6\u503c\u4e3a0~255\uff0c\u5982\u679c\u9010\u50cf\u7d20\u9010\u901a\u9053\u8ba1\u7b97\u548c\u5bf9\u6bd4\u4f1a\u6d88\u8017\u5927\u91cf\u65f6\u95f4\u3002<\/p>\n<p>\u56e0\u6b64\uff0c\u9700\u8981\u5bf9\u56fe\u7247\u8fdb\u884c\u7b80\u5316\uff0c\u518d\u53bb\u8ba1\u7b97\u989c\u8272\u7684\u5206\u5e03\u65b9\u5f0f\uff0c\u5e38\u7528\u7684\u7b80\u5316\u65b9\u5f0f\u5982\u4e0b\u3002<\/p>\n<h3>&nbsp;<\/h3>\n<h3>\u7b80\u5316\u5c3a\u5bf8<\/h3>\n<p>\u9996\u5148\u662f\u7f29\u5c0f\u5c3a\u5bf8\uff0c\u6bd4\u5982\u7f29\u5c0f\u523032*32\u50cf\u7d20\u6216\u8005\u66f4\u5c0f\uff0c\u80fd\u4fdd\u7559\u56fe\u7247\u7684\u6574\u4f53\u8272\u5f69\u8d8b\u52bf\uff0c\u663e\u8457\u964d\u4f4e\u8ba1\u7b97\u91cf\uff0c\u540c\u65f6\u5c06\u4e0d\u540c\u5206\u8fa8\u7387\u7684\u56fe\u7247\u7edf\u4e00\u5230\u4e00\u81f4\u7684\u5c3a\u5bf8\uff0c\u5f97\u5230\u683c\u5f0f\u76f8\u540c\u7684\u56fe\u50cf\u54c8\u5e0c\u503c\uff0c\u65b9\u4fbf\u540e\u9762\u5bf9\u6bd4\u3002<\/p>\n<h3>&nbsp;<\/h3>\n<h3>\u7b80\u5316\u8272\u5f69<\/h3>\n<p>\u5176\u6b21\u662f\u5c06\u4e09\u4e2a\u8272\u5f69\u901a\u9053\u7b80\u5316\u4e3a\u660e\u5ea6\uff0c\u5373\u5c06\u56fe\u7247\u8fdb\u884c\u53bb\u8272\uff0c\u5c06\u50cf\u7d20\u7684\u989c\u8272\u5206\u5e03\u65b9\u5f0f\u7b80\u5316\u4e3a\u50cf\u7d20\u7684\u660e\u6697\u5206\u5e03\u65b9\u5f0f\uff0c\u8ba1\u7b97\u91cf\u518d\u964d\u4f4e\u4e09\u5206\u4e4b\u4e8c\uff0c\u5bf9\u4e8e\u56fe\u7247\u5185\u5bb9\u76f8\u540c\u800c\u9971\u548c\u5ea6\u76f8\u8fd1\u7684\u56fe\u7247\u80fd\u66f4\u597d\u5730\u8fdb\u884c\u8bc6\u522b\u3002<\/p>\n<h3>&nbsp;<\/h3>\n<h3>\u7b80\u5316\u8272\u5f69\u4f4d\u6df1<\/h3>\n<p>\u6240\u8c13\u4f4d\u6df1\u5373\u8272\u5f69\u7684\u53d6\u503c\u8303\u56f4\uff0c\u5e38\u7528\u76848\u4f4d\u6df1\u5ea6\u4e0b\uff0c\u56fe\u7247\u6bcf\u4e2a\u901a\u9053\u53ef\u53d6\u503c\u4e3a0~255\uff0c\u53ef\u4ee5\u5c060~255\u7684\u503c\u6620\u5c04\u52300~64\u751a\u81f3\u66f4\u5c0f\u7684\u8303\u56f4\u5185\uff0c\u4ece\u800c\u63d0\u9ad8\u8ba1\u7b97\u901f\u5ea6\u3002<\/p>\n<h1>&nbsp;<\/h1>\n<h1 style=\"text-align: center;\">aHash\u7b97\u6cd5<\/h1>\n<p>aHash\u7b97\u6cd5\u5373\u5e73\u5747\u54c8\u5e0c\u7b97\u6cd5\uff0c\u539f\u7406\u662f\u5148\u6c42\u51fa\u6240\u6709\u50cf\u7d20\u7684\u5e73\u5747\u503c\uff0c\u518d\u5c06\u6bcf\u4e2a\u50cf\u7d20\u4e0e\u5e73\u5747\u503c\u5bf9\u6bd4\uff0c\u5927\u4e8e\u6216\u7b49\u4e8e\u5e73\u5747\u503c\u7684\u6807\u8bb0\u4e3a1\uff0c\u5c0f\u4e8e\u5e73\u5747\u503c\u7684\u6807\u8bb0\u4e3a0\uff0c\u518d\u5c06\u6807\u8bb0\u7ed3\u679c\u7ec4\u5408\u5728\u4e00\u8d77\u3002<\/p>\n<p>\u8fd9\u79cd\u7b97\u6cd5\u5728\u7b80\u5316\u56fe\u7247\u65f6\u5e38\u5e38\u5c06\u56fe\u7247\u7f29\u5c0f\u4e3a8*8\uff0c\u6b64\u65f6\u5f97\u5230\u7684\u5c31\u662f\u4e00\u4e2a64\u4f4d\u76840\/1\u54c8\u5e0c\u5e8f\u5217\uff0c\u53ef\u4ee5\u89c6\u4e3a\u8fd9\u5f20\u56fe\u7247\u7684\u6570\u5b57\u6307\u7eb9\u3002<\/p>\n<p>\u5728\u5bf9\u6bd4\u65f6\uff0c\u5c06\u4e24\u5f20\u56fe\u7247\u7684\u54c8\u5e0c\u5e8f\u5217\u901a\u8fc7\u9010\u4f4d\u5f02\u6216\u64cd\u4f5c\u5f97\u5230\u4e0d\u76f8\u540c\u7684\u4f4d\u6570\uff0c\u5373\u6c49\u660e\u8ddd\u79bb\uff08Hamming distance\uff09\uff0c\u4e0d\u540c\u7684\u4f4d\u6570\u8d8a\u5c11\uff0c\u4e24\u5f20\u56fe\u7247\u7684\u76f8\u4f3c\u5ea6\u8d8a\u5927\u3002<\/p>\n<p>aHash\u7b97\u6cd5\u7684\u4f18\u70b9\u662f\u901f\u5ea6\u5feb\uff0c\u7f3a\u70b9\u662f\u7cbe\u786e\u5ea6\u8f83\u5dee\uff0c\u5bf9\u5747\u503c\u6bd4\u8f83\u654f\u611f\u3002<\/p>\n<h1>&nbsp;<\/h1>\n<h1 style=\"text-align: center;\">dHash\u7b97\u6cd5<\/h1>\n<p>dHash\u7b97\u6cd5\u5373\u5dee\u5f02\u54c8\u5e0c\u7b97\u6cd5\uff0c\u539f\u7406\u662f\u6bd4\u8f83\u6bcf\u884c\u76f8\u90bb\u5143\u7d20\u7684\u5927\u5c0f\uff0c\u5982\u679c\u5de6\u8fb9\u7684\u50cf\u7d20\u6bd4\u53f3\u8fb9\u7684\u50cf\u7d20\u66f4\u4eae\u5219\u6807\u8bb0\u4e3a1\uff0c\u5426\u5219\u4e3a0\uff0c\u6700\u540e\u7ec4\u5408\u5f97\u5230\u54c8\u5e0c\u5e8f\u5217\u3002<\/p>\n<p>\u8fd9\u79cd\u7b97\u6cd5\u5728\u7b80\u5316\u56fe\u7247\u65f6\u5e38\u5e38\u5c06\u56fe\u7247\u7f29\u5c0f\u4e3a9*8\uff0c\u6bcf\u884c9\u4e2a\u5143\u7d20\u76f8\u90bb\u6bd4\u8f83\u53ef\u5f97\u52308\u4e2a\u503c\uff0c\u4e00\u51718\u884c\uff0c\u7ed3\u679c\u4e5f\u662f\u4e00\u4e2a64\u4f4d\u76840\/1\u54c8\u5e0c\u5e8f\u5217\u3002<\/p>\n<p>\u4e24\u5f20\u56fe\u7247\u7684\u54c8\u5e0c\u5e8f\u5217\u540c\u6837\u901a\u8fc7\u540c\u4f4d\u5bf9\u6bd4\u5373\u53ef\u5f97\u5230\u76f8\u4f3c\u5ea6\u5927\u5c0f\u3002<\/p>\n<p>dHash\u7b97\u6cd5\u7684\u4f18\u70b9\u662f\u901f\u5ea6\u5feb\uff0c\u540c\u65f6\u5224\u65ad\u6548\u679c\u8981\u597d\u4e8eaHash\u3002<\/p>\n<h1>&nbsp;<\/h1>\n<h1 style=\"text-align: center;\">pHash\u7b97\u6cd5<\/h1>\n<p>pHash\u7b97\u6cd5\u5373\u611f\u77e5\u54c8\u5e0c\u7b97\u6cd5\uff0c\u539f\u7406\u662f\u901a\u8fc7\u79bb\u6563\u4f59\u5f26\u53d8\u6362\uff08DCT\uff09\u964d\u4f4e\u56fe\u7247\u9891\u7387\uff0c\u901a\u8fc7\u6709\u635f\u538b\u7f29\u7684\u65b9\u5f0f\u4fdd\u7559\u5927\u90e8\u5206\u56fe\u50cf\u7279\u5f81\uff0c\u518d\u5bf9\u7279\u5f81\u503c\u8fdb\u884c\u6bd4\u8f83\u3002<\/p>\n<p>DCT\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u5085\u7acb\u53f6\u53d8\u6362\uff0c\u5c06\u56fe\u7247\u4ece\u50cf\u7d20\u57df\u53d8\u6362\u4e3a\u9891\u7387\u57df\uff0cDCT\u77e9\u9635\u4e2d\u4ece\u5de6\u4e0a\u89d2\u5230\u53f3\u4e0b\u89d2\u4ee3\u8868\u8d8a\u6765\u8d8a\u9ad8\u9891\u7387\u7684\u7cfb\u6570\uff0c\u4f46\u662f\u9664\u5de6\u4e0a\u89d2\u5916\uff0c\u5176\u4ed6\u90e8\u5206\u7684\u7cfb\u6570\u90fd\u4e3a0\u5de6\u53f3\uff0cpHash\u7b97\u6cd5\u5728\u7b80\u5316\u56fe\u7247\u65f6\u5e38\u5e38\u5c06\u56fe\u7247\u7f29\u5c0f\u4e3a32*32\uff0c\u56e0\u6b64\u53ea\u9009\u53d6DCT\u77e9\u9635\u4e2d\u5de6\u4e0a\u89d28*8\u7684\u90e8\u5206\u5373\u53ef\u5f97\u5230\u56fe\u50cf\u7684\u5927\u90e8\u5206\u7279\u5f81\u3002<\/p>\n<p>\u518d\u5c068*8\u7684\u90e8\u5206\u77e9\u9635\u7684\u6bcf\u4e2a\u503c\u4e0e\u5747\u503c\u6bd4\u8f83\uff0c\u7ec4\u5408\u5f97\u5230\u7684\u540c\u6837\u662f\u4e00\u4e2a64\u4f4d\u76840\/1\u54c8\u5e0c\u5e8f\u5217\uff0c\u6700\u7ec8\u518d\u901a\u8fc7\u540c\u4f4d\u5bf9\u6bd4\u5f97\u5230\u76f8\u4f3c\u5ea6\u5927\u5c0f\u3002<\/p>\n<p>pHash\u7b97\u6cd5\u4f18\u70b9\u662f\u66f4\u4e3a\u7a33\u5b9a\uff0c\u5224\u65ad\u6548\u679c\u597d\uff0c\u4f46\u901f\u5ea6\u7565\u6162\u3002<\/p>\n<h1>&nbsp;<\/h1>\n<h1 style=\"text-align: center;\">\u4ee3\u7801\u5b9e\u73b0<\/h1>\n<p>\u5bf9\u8fd9\u4e09\u79cd\u56fe\u50cf\u54c8\u5e0c\u7b97\u6cd5\uff0c\u53ef\u4ee5\u4f7f\u7528opencv\u8fdb\u884c\u7b97\u6cd5\u5b9e\u73b0\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre><span># -*- coding: utf-8 -*-<\/span>\n<span>import cv2<\/span>\n<span>import numpy as np<\/span>\n<span><\/span>\n<span>def pHash(img,leng=32,wid=32):<\/span>\n<span>    img = cv2.resize(img, (leng, wid))   <\/span>\n<span>    gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)<\/span>\n<span>    dct = cv2.dct(np.float32(gray))<\/span>\n<span>    dct_roi = dct[0:8, 0:8]            <\/span>\n<span>    avreage = np.mean(dct_roi)<\/span>\n<span>    phash_01 = (dct_roi&gt;avreage)+0<\/span>\n<span>    phash_list = phash_01.reshape(1,-1)[0].tolist()<\/span>\n<span>    hash = ''.join([str(x) for x in phash_list])<\/span>\n<span>    return hash<\/span>\n<span><\/span>\n<span>def dHash(img,leng=9,wid=8):<\/span>\n<span>    img=cv2.resize(img,(leng, wid))<\/span>\n<span>    image=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)<\/span>\n<span>    #\u6bcf\u884c\u524d\u4e00\u4e2a\u50cf\u7d20\u5927\u4e8e\u540e\u4e00\u4e2a\u50cf\u7d20\u4e3a1\uff0c\u76f8\u53cd\u4e3a0\uff0c\u751f\u6210\u54c8\u5e0c<\/span>\n<span>    hash=[]<\/span>\n<span>    for i in range(wid):<\/span>\n<span>        for j in range(wid):<\/span>\n<span>            if image[i,j]&gt;image[i,j+1]:<\/span>\n<span>                hash.append(1)<\/span>\n<span>            else:<\/span>\n<span>                hash.append(0)<\/span>\n<span>    return hash<\/span>\n<span><\/span>\n<span>def aHash(img,leng=8,wid=8):<\/span>\n<span>    img=cv2.resize(img,(leng, wid))<\/span>\n<span>    image=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)<\/span>\n<span>    avreage = np.mean(image)                           <\/span>\n<span>    hash = [] <\/span>\n<span>    for i in range(image.shape[0]): <\/span>\n<span>        for j in range(image.shape[1]): <\/span>\n<span>            if image[i,j] &gt;= avreage: <\/span>\n<span>                hash.append(1) <\/span>\n<span>            else: <\/span>\n<span>                hash.append(0) <\/span>\n<span>    return hash<\/span>\n<span><\/span>\n<span>def Hamming_distance(hash1,hash2):<\/span>\n<span>    num = 0<\/span>\n<span>    for index in range(len(hash1)):<\/span>\n<span>        if hash1[index] != hash2[index]:<\/span>\n<span>            num += 1<\/span>\n<span>    return num <\/span>\n<span><\/span>\n<span>if __name__ == '__main__':<\/span>\n<span>    <\/span>\n<span>    image1 = cv2.imread('image1')<\/span>\n<span>    image2 = cv2.imread('image2')<\/span>\n<span>    <\/span>\n<span>    d_dist = Hamming_distance(dHash(image1),dHash(image2))<\/span>\n<span>    <\/span>\n<span>    p_dist = Hamming_distance(pHash(image1),pHash(image2))<\/span>\n<span>    <\/span>\n<span>    a_dist = Hamming_distance(aHash(image1),aHash(image2))<\/span>\n<span>    <\/span>\n<span>    print('a_dist is '+'%d' % a_dist + ', similarity is ' +'%f' % (1 - a_dist * 1.0 \/ 64))<\/span>\n<span>    print('p_dist is '+'%d' % p_dist + ', similarity is ' +'%f' % (1 - p_dist * 1.0 \/ 64))<\/span>\n<span>    print('d_dist is '+'%d' % d_dist + ', similarity is ' +'%f' % (1 - d_dist * 1.0 \/ 64))<\/span>\n<\/pre>\n\n\n\n<h1>&nbsp;<\/h1>\n<h1 style=\"text-align: center;\">\u6548\u679c\u5bf9\u6bd4<\/h1>\n<p>\u4e3a\u4e86\u6d4b\u8bd5\u8fd9\u4e09\u79cd\u7b97\u6cd5\u7684\u51c6\u786e\u6027\uff0c\u51c6\u5907\u4e86\u4ee5\u4e0b\u6d4b\u8bd5\u56fe\u7247\u3002<\/p>\n<p><img loading=\"lazy\" class=\"size-full wp-image-3179 aligncenter\" src=\"https:\/\/www.yumefx.com\/wp-content\/uploads\/2021\/06\/picSimilar_03.png\" alt=\"\" width=\"2000\" height=\"1666\" srcset=\"https:\/\/www.yumefx.com\/wp-content\/uploads\/2021\/06\/picSimilar_03.png 2000w, https:\/\/www.yumefx.com\/wp-content\/uploads\/2021\/06\/picSimilar_03-300x250.png 300w, https:\/\/www.yumefx.com\/wp-content\/uploads\/2021\/06\/picSimilar_03-1024x853.png 1024w, https:\/\/www.yumefx.com\/wp-content\/uploads\/2021\/06\/picSimilar_03-768x640.png 768w, https:\/\/www.yumefx.com\/wp-content\/uploads\/2021\/06\/picSimilar_03-1536x1279.png 1536w\" sizes=\"(max-width: 2000px) 100vw, 2000px\" \/><\/p>\n<p>\u6d4b\u8bd5\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n<p><img loading=\"lazy\" class=\"size-full wp-image-3180 aligncenter\" src=\"https:\/\/www.yumefx.com\/wp-content\/uploads\/2021\/06\/picSimilar_04.png\" alt=\"\" width=\"573\" height=\"1234\" srcset=\"https:\/\/www.yumefx.com\/wp-content\/uploads\/2021\/06\/picSimilar_04.png 573w, https:\/\/www.yumefx.com\/wp-content\/uploads\/2021\/06\/picSimilar_04-139x300.png 139w, https:\/\/www.yumefx.com\/wp-content\/uploads\/2021\/06\/picSimilar_04-475x1024.png 475w\" sizes=\"(max-width: 573px) 100vw, 573px\" \/><\/p>\n<p>\u53ef\u4ee5\u770b\u51fa\u8fd9\u51e0\u79cd\u56fe\u50cf\u54c8\u5e0c\u7b97\u6cd5\u5bf9\u4e8e\u5927\u591a\u6570\u60c5\u51b5\u8bc6\u522b\u7387\u662f\u8f83\u9ad8\u7684\uff0c\u800c\u88c1\u526a\u906e\u6321\u7279\u522b\u662f\u56fe\u7247\u7684\u65cb\u8f6c\u4f1a\u5bfc\u81f4\u8ba1\u7b97\u51fa\u7684\u76f8\u4f3c\u5ea6\u964d\u4f4e\uff0c\u5728\u4e09\u79cd\u7b97\u6cd5\u4e2d\uff0cdHash\u7a0d\u597d\u4e8eaHash\u4e00\u4e9b\uff0cpHash\u7684\u7b97\u6cd5\u66f4\u4e3a\u5bbd\u5bb9\uff0c\u4f46\u5bf9\u4e8e\u5b8c\u5168\u4e0d\u76f8\u4f3c\u7684\u56fe\u7247\u4e4b\u95f4\uff0cpHash\u7b97\u6cd5\u4e5f\u4f1a\u5f97\u5230\u66f4\u9ad8\u7684\u76f8\u4f3c\u5ea6\uff0c\u6709\u66f4\u5927\u6982\u7387\u4f1a\u5bfc\u81f4\u9519\u8bef\u5339\u914d\u3002<\/p>\n<p>\u5982\u679c\u5bf9\u4e8e\u8bc6\u522b\u51c6\u786e\u5ea6\u6709\u66f4\u9ad8\u7684\u8981\u6c42\uff0c\u5c31\u9700\u8981\u4f7f\u7528\u66f4\u9ad8\u7ea7\u7684\u56fe\u50cf\u7279\u5f81\u70b9\u8bc6\u522b\u6216\u8005\u6df1\u5ea6\u5b66\u4e60\u7b49\u65b9\u6cd5\u3002<\/p>\n<p>\u4e0d\u8fc7\u5bf9\u4e8e\u76ee\u524d\u6211\u7684\u9700\u6c42\u6765\u8bf4\uff0c\u4f7f\u7528pHash\u6216\u8005dHash\u5c31\u5df2\u7ecf\u8db3\u591f\u4e86\u3002<\/p>\n<p>\u5982\u679c\u89c9\u5f97\u5199\u7b97\u6cd5\u9ebb\u70e6\uff0c\u4e5f\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528python\u7b2c\u4e09\u65b9\u5e93<a href=\"https:\/\/github.com\/JohannesBuchner\/imagehash\">imagehash<\/a>\uff0c\u9664\u4e86\u652f\u6301aHash\u3001dHash\u3001pHash\u4ee5\u53cawHash\uff08\u4f7f\u7528DWT\u66ff\u4ee3DCT\u7684pHash\uff09\u7b97\u6cd5\uff0c\u8fd8\u652f\u6301colorHash\uff08HSV\uff09\u548ccropHash\uff08\u6297\u622a\u53d6\u54c8\u5e0c\uff09\uff0c\u4f7f\u7528\u4e5f\u5f88\u7b80\u5355\uff0c\u8fd9\u91cc\u5c31\u4e0d\u8be6\u8ff0\u4e86\u3002<\/p>\n<p>&nbsp;<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u755c\u751f\u5c31\u662f\u755c\u751f\uff0c<br>\u5c31\u7b97\u5b83\u957f\u7740\u4eba\u8138\uff0c\u53e3\u5410\u4eba\u8a00\uff0c<br>\u7406\u8bba\u9ad8\u6df1\u83ab\u6d4b\uff0c\u7acb\u573a\u51a0\u5195\u5802\u7687\uff0c<br>\u4f60\u4e5f\u4e0d\u8981\u653e\u4e0b\u624b\u4e2d\u7684\u5200\u5b50\u3002<\/p>\n<p style=\"text-align: right;\">\u300a\u6850\u5bab\u4e4b\u56da\u300b<br>\u2014\u2014\u963f\u83e9<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00 \u8fd9\u51e0\u5e74\u901a\u8fc7\u7528P\u7ad9\u722c\u866b\u3001cg\u56fe\u5305\u5206\u4eab\u3001\u96f6\u6563\u6536\u96c6\u7b49\u624b\u6bb5\uff0c\u5c6f\u4e86\u8fd11T\u7684\u52a8\u6f2b\u56fe\u7247\uff0c\u591a\u5219\u591a\u77e3\u5374\u826f\u83a0\u4e0d\u9f50\uff0c\u5176\u4e2d\u66f4\u662f\u6709 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3169,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[12,4],"tags":[37,14],"_links":{"self":[{"href":"https:\/\/www.yumefx.com\/index.php?rest_route=\/wp\/v2\/posts\/3163"}],"collection":[{"href":"https:\/\/www.yumefx.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yumefx.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yumefx.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yumefx.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3163"}],"version-history":[{"count":0,"href":"https:\/\/www.yumefx.com\/index.php?rest_route=\/wp\/v2\/posts\/3163\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.yumefx.com\/index.php?rest_route=\/wp\/v2\/media\/3169"}],"wp:attachment":[{"href":"https:\/\/www.yumefx.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yumefx.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yumefx.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}