{"id":203022,"date":"2025-05-22T11:54:54","date_gmt":"2025-05-22T03:54:54","guid":{"rendered":"https:\/\/server.hk\/cnblog\/203022\/"},"modified":"2025-05-22T11:54:54","modified_gmt":"2025-05-22T03:54:54","slug":"%e5%87%bd%e6%95%b0%e5%bc%8f%e7%bc%96%e7%a8%8b%e5%9c%a8%e5%9b%be%e5%83%8f%e5%a4%84%e7%90%86%e7%ae%97%e6%b3%95%e6%80%a7%e8%83%bd%e6%8f%90%e5%8d%87%e4%b8%ad%e7%9a%84%e5%ba%94%e7%94%a8","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/203022\/","title":{"rendered":"\u51fd\u6570\u5f0f\u7f16\u7a0b\u5728\u56fe\u50cf\u5904\u7406\u7b97\u6cd5\u6027\u80fd\u63d0\u5347\u4e2d\u7684\u5e94\u7528"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u51fd\u6570\u5f0f\u7f16\u7a0b\u5728\u56fe\u50cf\u5904\u7406\u7b97\u6cd5\u6027\u80fd\u63d0\u5347\u4e2d\u7684\u5e94\u7528<\/h1>\n<p>\u4e00\u5206\u8015\u8018\uff0c\u4e00\u5206\u6536\u83b7\uff01\u65e2\u7136\u90fd\u6253\u5f00\u8fd9\u7bc7<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300a\u51fd\u6570\u5f0f\u7f16\u7a0b\u5728\u56fe\u50cf\u5904\u7406\u7b97\u6cd5\u6027\u80fd\u63d0\u5347\u4e2d\u7684\u5e94\u7528\u300b<\/span>\uff0c\u5c31\u575a\u6301\u770b\u4e0b\u53bb\uff0c\u5b66\u4e0b\u53bb\u5427\uff01\u672c\u6587\u4e3b\u8981\u4f1a\u7ed9\u5927\u5bb6\u8bb2\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u5982\u679c\u5927\u5bb6\u5bf9\u672c\u6587\u6709\u597d\u7684\u5efa\u8bae\u6216\u8005\u770b\u5230\u6709\u4e0d\u8db3\u4e4b\u5904\uff0c\u975e\u5e38\u6b22\u8fce\u5927\u5bb6\u79ef\u6781\u63d0\u51fa\uff01\u5728\u540e\u7eed\u6587\u7ae0\u6211\u4f1a\u7ee7\u7eed\u66f4\u65b0<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\u76f8\u5173\u7684\u5185\u5bb9\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u90fd\u6709\u6240\u5e2e\u52a9\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241027\/1730022132671e0af487cff.jpg\" class=\"aligncenter\"><\/p>\n<p><strong>\u51fd\u6570\u5f0f\u7f16\u7a0b\u5728\u56fe\u50cf\u5904\u7406\u7b97\u6cd5\u6027\u80fd\u63d0\u5347\u4e2d\u7684\u5e94\u7528<\/strong><\/p>\n<p><strong>\u5f15\u8a00<\/strong><\/p>\n<p>\u51fd\u6570\u5f0f\u7f16\u7a0b\u662f\u4e00\u79cd\u7f16\u7a0b\u8303\u5f0f\uff0c\u5f3a\u8c03\u4e0d\u53ef\u53d8\u6027\u3001\u7eaf\u51fd\u6570\u548c\u4e00\u7ea7\u51fd\u6570\u3002\u901a\u8fc7\u5c06\u56fe\u50cf\u5904\u7406\u7b97\u6cd5\u8868\u793a\u4e3a\u51fd\u6570\uff0c\u6211\u4eec\u53ef\u4ee5\u663e\u8457\u63d0\u9ad8\u5176\u6027\u80fd\u3002<\/p>\n<p><strong>\u4e0d\u53ef\u53d8\u6027<\/strong><\/p>\n<p>\u51fd\u6570\u5f0f\u7f16\u7a0b\u7684\u5173\u952e\u7279\u5f81\u4e4b\u4e00\u662f\u4e0d\u53ef\u53d8\u6027\uff0c\u8fd9\u610f\u5473\u7740\u51fd\u6570\u4e0d\u4f1a\u4fee\u6539\u5176\u8f93\u5165\u3002\u5728\u56fe\u50cf\u5904\u7406\u4e2d\uff0c\u8fd9\u53ef\u4ee5\u9632\u6b62\u56fe\u50cf\u610f\u5916\u4fee\u6539\uff0c\u4ece\u800c\u63d0\u9ad8\u7b97\u6cd5\u7684\u53ef\u9760\u6027\u3002<\/p>\n<p><strong>\u7eaf\u51fd\u6570<\/strong><\/p>\n<p>\u7eaf\u51fd\u6570\u4e0d\u4f9d\u8d56\u4e8e\u5916\u90e8\u72b6\u6001\uff0c\u5176\u8f93\u51fa\u4ec5\u7531\u5176\u8f93\u5165\u51b3\u5b9a\u3002\u5728\u56fe\u50cf\u5904\u7406\u4e2d\uff0c\u8fd9\u786e\u4fdd\u4e86\u7b97\u6cd5\u7684\u786e\u5b9a\u6027\uff0c\u907f\u514d\u4e86\u96be\u4ee5\u8c03\u8bd5\u7684\u526f\u4f5c\u7528\u3002<\/p>\n<p><strong>\u4e00\u7ea7\u51fd\u6570<\/strong><\/p>\n<p>\u4e00\u7ea7\u51fd\u6570\u53ef\u4ee5\u4f5c\u4e3a\u5176\u4ed6\u51fd\u6570\u7684\u53c2\u6570\u4f20\u9012\u6216\u4f5c\u4e3a\u51fd\u6570\u7684\u8fd4\u56de\u503c\u3002\u5728\u56fe\u50cf\u5904\u7406\u4e2d\uff0c\u8fd9\u4f7f\u5f97\u6211\u4eec\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u51fd\u6570\u5e93\uff0c\u8fd9\u4e9b\u51fd\u6570\u53ef\u4ee5\u8f7b\u677e\u7ec4\u5408\u548c\u91cd\u590d\u4f7f\u7528\uff0c\u4ece\u800c\u63d0\u9ad8\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u548c\u53ef\u7ef4\u62a4\u6027\u3002<\/p>\n<p><strong>\u5e94\u7528\u793a\u4f8b<\/strong><\/p>\n<p><strong>\u5085\u91cc\u53f6\u53d8\u6362<\/strong><\/p>\n<p>\u5085\u91cc\u53f6\u53d8\u6362\u662f\u56fe\u50cf\u5904\u7406\u4e2d\u5e38\u7528\u7684\u7b97\u6cd5\uff0c\u7528\u4e8e\u5c06\u56fe\u50cf\u4ece\u65f6\u57df\u8f6c\u6362\u4e3a\u9891\u57df\u3002\u901a\u8fc7\u4f7f\u7528\u51fd\u6570\u5f0f\u7f16\u7a0b\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u5085\u91cc\u53f6\u53d8\u6362\u8868\u793a\u4e3a\u4e00\u4e2a\u53ef\u91cd\u7528\u7684\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u53ef\u4ee5\u5e94\u7528\u4e8e\u4efb\u4f55\u56fe\u50cf\uff1a<\/p>\n<pre>import numpy as np\nfrom scipy.fft import fft2, ifft2\n\ndef fourier_transform(image):\n  return fft2(image)\n\ndef inverse_fourier_transform(fourier_image):\n  return ifft2(fourier_image)\n\nimage = np.array([[1, 2], [3, 4]])\nfourier_image = fourier_transform(image)\nrestored_image = inverse_fourier_transform(fourier_image)<\/pre>\n<p><strong>\u56fe\u50cf\u6a21\u7cca<\/strong><\/p>\n<p>\u56fe\u50cf\u6a21\u7cca\u662f\u53e6\u4e00\u79cd\u5e38\u7528\u7684\u7b97\u6cd5\uff0c\u7528\u4e8e\u51cf\u5c11\u56fe\u50cf\u4e2d\u7684\u566a\u58f0\u3002\u901a\u8fc7\u4f7f\u7528\u51fd\u6570\u5f0f\u7f16\u7a0b\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u56fe\u50cf\u6a21\u7cca\u8868\u793a\u4e3a\u4e00\u4e2a\u64cd\u4f5c\u7b26\uff0c\u8be5\u64cd\u4f5c\u7b26\u53ef\u4ee5\u5e94\u7528\u4e8e\u4efb\u4f55\u56fe\u50cf\uff1a<\/p>\n<pre>import numpy as np\n\ndef blur(image, kernel):\n  return np.convolve(image, kernel, mode='same')\n\nkernel = np.array([[1, 1, 1], [1, 1, 1], [1, 1, 1]]) \/ 9\nblurry_image = blur(image, kernel)<\/pre>\n<p><strong>\u6027\u80fd\u4f18\u52bf<\/strong><\/p>\n<p>\u51fd\u6570\u5f0f\u7f16\u7a0b\u5728\u56fe\u50cf\u5904\u7406\u7b97\u6cd5\u4e2d\u63d0\u4f9b\u4e86\u4ee5\u4e0b\u6027\u80fd\u4f18\u52bf\uff1a<\/p>\n<ul>\n<li><strong>\u5e76\u884c\u6027\uff1a<\/strong>\u7eaf\u51fd\u6570\u53ef\u4ee5\u8f7b\u677e\u5e76\u884c\u6267\u884c\uff0c\u4ece\u800c\u63d0\u9ad8\u8ba1\u7b97\u6548\u7387\u3002<\/li>\n<li><strong>\u5185\u5b58\u6548\u7387\uff1a<\/strong>\u4e0d\u53ef\u53d8\u6027\u786e\u4fdd\u56fe\u50cf\u4e0d\u4f1a\u5728\u5185\u5b58\u4e2d\u8fdb\u884c\u4e0d\u5fc5\u8981\u7684\u526f\u672c\uff0c\u4ece\u800c\u51cf\u5c11\u5185\u5b58\u5f00\u9500\u3002<\/li>\n<li><strong>\u6a21\u5757\u5316\uff1a<\/strong>\u4e00\u7ea7\u51fd\u6570\u4fc3\u8fdb\u4ee3\u7801\u91cd\u7528\uff0c\u4ece\u800c\u4f7f\u7b97\u6cd5\u66f4\u52a0\u6a21\u5757\u5316\u548c\u6613\u4e8e\u7ef4\u62a4\u3002<\/li>\n<\/ul>\n<p><strong>\u7ed3\u8bba<\/strong><\/p>\n<p>\u51fd\u6570\u5f0f\u7f16\u7a0b\u4e3a\u56fe\u50cf\u5904\u7406\u7b97\u6cd5\u6027\u80fd\u7684\u63d0\u5347\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u65b9\u6cd5\u3002\u901a\u8fc7\u5229\u7528\u4e0d\u53ef\u53d8\u6027\u3001\u7eaf\u51fd\u6570\u548c\u4e00\u7ea7\u51fd\u6570\uff0c\u6211\u4eec\u53ef\u4ee5\u521b\u5efa\u9ad8\u6548\u3001\u53ef\u9760\u4e14\u6613\u4e8e\u7ef4\u62a4\u7684\u7b97\u6cd5\u3002<\/p>\n<p>\u597d\u4e86\uff0c\u672c\u6587\u5230\u6b64\u7ed3\u675f\uff0c\u5e26\u5927\u5bb6\u4e86\u89e3\u4e86\u300a\u51fd\u6570\u5f0f\u7f16\u7a0b\u5728\u56fe\u50cf\u5904\u7406\u7b97\u6cd5\u6027\u80fd\u63d0\u5347\u4e2d\u7684\u5e94\u7528\u300b\uff0c\u5e0c\u671b\u672c\u6587\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff01\u5173\u6ce8\u516c\u4f17\u53f7\uff0c\u7ed9\u5927\u5bb6\u5206\u4eab\u66f4\u591a\u6587\u7ae0\u77e5\u8bc6\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u51fd\u6570\u5f0f\u7f16\u7a0b\u5728\u56fe\u50cf\u5904\u7406\u7b97\u6cd5\u6027\u80fd\u63d0\u5347&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-203022","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/203022","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=203022"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/203022\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=203022"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=203022"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=203022"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}