{"id":1860,"date":"2026-05-28T19:55:42","date_gmt":"2026-05-28T11:55:42","guid":{"rendered":"https:\/\/shr1mp.top\/?p=1860"},"modified":"2026-05-28T19:58:05","modified_gmt":"2026-05-28T11:58:05","slug":"arnold%e7%8c%ab%e8%84%b8%e9%9a%90%e5%86%99%e7%ae%97%e6%b3%95","status":"publish","type":"post","link":"https:\/\/shr1mp.top\/index.php\/2026\/05\/28\/arnold%e7%8c%ab%e8%84%b8%e9%9a%90%e5%86%99%e7%ae%97%e6%b3%95\/","title":{"rendered":"Arnold\u732b\u8138\u9690\u5199\u7b97\u6cd5"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u4ee5\u4e00\u6b21\u5faa\u73af\u4e3a\u4f8b\uff1a<\/p>\n\n\n\n<h2 id=\"\u62c9\u4f38\u8fc7\u7a0b\" class=\"wp-block-heading\">&#8220;\u62c9\u4f38\u8fc7\u7a0b&#8221;<\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<h3 id=\"\u57fa\u672c\u7b97\u6cd5\" class=\"wp-block-heading has-medium-font-size\">\u57fa\u672c\u7b97\u6cd5<\/h3>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">\u73b0\u6709\u53c2\u6570a\u3001b\u4ee5\u53ca\u8fed\u4ee3\u6b21\u6570T<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5bf9\u4e8e\u6bcf\u4e2a\u50cf\u7d20\u5750\u6807 (x,y) \uff0c\u8ba1\u7b97\u65b0\u5750\u6807 (x\u2032,y\u2032) \uff1a<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">x\u2032=(x+a\u22c5y)mod N<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">y\u2032=(b\u22c5x+(ab+1)\u22c5y)mod N\u200b<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ed6\u7684\u672c\u8d28\u5c31\u662f\u4e00\u4e2a\u89c4\u5b9a\u7684\u77e9\u9635\u53bb\u4e58\u50cf\u7d20\u5750\u6807\u7684\u77e9\u9635<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/origin.picgo.net\/2026\/05\/28\/-2026-05-28-1947056b46f343e88fcca1.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/origin.picgo.net\/2026\/05\/28\/-2026-05-28-1947056b46f343e88fcca1.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\"\/><\/div><\/figure>\n\n\n\n<h3 id=\"\u5bf9\u4e8e-\u7b97\u51fa\u6765\u7684\u65b0\u5750\u6807\u4e0d\u4f1a\u91cd\u590d-\u7684\u8bf4\u660e\" class=\"wp-block-heading has-medium-font-size\">\u5bf9\u4e8e\u201c\u7b97\u51fa\u6765\u7684\u65b0\u5750\u6807\u4e0d\u4f1a\u91cd\u590d\u201d\u7684\u8bf4\u660e\uff1a<\/h3>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">\u6838\u5fc3\u5c31\u662f\u884c\u5217\u5f0f             det(A)=1<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/origin.picgo.net\/2026\/05\/28\/-2026-05-28-194748c039088712d0153c.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/origin.picgo.net\/2026\/05\/28\/-2026-05-28-194748c039088712d0153c.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\"\/><\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u5c06A\u77e9\u9635\u7528\u9006\u77e9\u9635\u62b5\u6d88\u7684\u65b9\u6cd5\u79fb\u5230x&#8217;y&#8217;\u90a3\u8fb9<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/origin.picgo.net\/2026\/05\/28\/-2026-05-28-1947552d27b7519b132270.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/origin.picgo.net\/2026\/05\/28\/-2026-05-28-1947552d27b7519b132270.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\"\/><\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u53cd\u5411\u6c42\u89e3x\u4e0ey<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/origin.picgo.net\/2026\/05\/28\/-2026-05-28-194802cc238e2c71c81e8d.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/origin.picgo.net\/2026\/05\/28\/-2026-05-28-194802cc238e2c71c81e8d.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\"\/><\/div><\/figure>\n\n\n\n<p class=\"has-text-align-center has-vivid-red-color has-text-color has-link-color has-medium-font-size wp-elements-162205cf6809fd5213faa2b920eb08fd wp-block-paragraph\"><strong>\u8fd9\u540c\u65f6\u4e5f\u8bf4\u660e\u8fd9\u79cd\u7b97\u6cd5\u53ef\u4ee5\u9006\u8fd0\u884c\uff0c\u4e5f\u5c31\u662f\u53ef\u4ee5\u53cd\u5411\u89e3<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u6027\u8d28<\/th><th>\u7ed3\u8bba<\/th><\/tr><\/thead><tbody><tr><td><strong>\u5355\u5c04<\/strong><\/td><td>$T(x_1, y_1) = T(x_2, y_2) \\Rightarrow (x_1, y_1) = (x_2, y_2)$<\/td><\/tr><tr><td><strong>\u6ee1\u5c04<\/strong><\/td><td>\u6bcf\u4e2a\u76ee\u6807\u4f4d\u7f6e $(x&#8217;, y&#8217;)$ \u90fd\u6709\u539f\u50cf $(x, y)$<\/td><\/tr><tr><td><strong>\u53cc\u5c04<\/strong><\/td><td>\u65e2\u662f\u5355\u5c04\u53c8\u662f\u6ee1\u5c04\uff0c\u4e00\u4e00\u5bf9\u5e94<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 id=\"\u622a\u53d6\" class=\"wp-block-heading\">&#8220;\u622a\u53d6&#8221;<\/h2>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">\u4e5f\u5c31\u662f\u53d6\u6a21\u64cd\u4f5c\uff0c\u8fd9\u91cc\u7565<\/p>\n\n\n\n<h2 id=\"\u5faa\u73af\" class=\"wp-block-heading\">&#8220;\u5faa\u73af&#8221;<\/h2>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">\u91cd\u590d\u4e0a\u8ff0\u64cd\u4f5c\u8fdb\u884c\u5faa\u73af<\/p>\n\n\n\n<h2 id=\"\u52a0\u5bc6\u4ee3\u7801\" class=\"wp-block-heading\">\u52a0\u5bc6\u4ee3\u7801\uff1a<\/h2>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>import numpy as np\n\ndef arnold_transform(img, a=1, b=1, times=1):\n    \"\"\"\n    Arnold \u6b63\u5411\u53d8\u6362\uff08\u7f6e\u4e71\uff09\n    \n    \u53c2\u6570:\n        img: \u8f93\u5165\u56fe\u50cf (N, N) \u7684 numpy \u6570\u7ec4\n        a, b: Arnold \u53d8\u6362\u53c2\u6570\n        times: \u8fed\u4ee3\u6b21\u6570\n    \n    \u8fd4\u56de:\n        \u7f6e\u4e71\u540e\u7684\u56fe\u50cf\n    \"\"\"\n    N = img.shape&#91;0]  # \u5047\u8bbe\u662f\u6b63\u65b9\u5f62\u56fe\u50cf\n    result = img.copy()\n    \n    for _ in range(times):\n        new_img = np.zeros_like(result)\n        \n        for x in range(N):\n            for y in range(N):\n                # \u8ba1\u7b97\u65b0\u4f4d\u7f6e\n                nx = (x + a * y) % N\n                ny = (b * x + (a * b + 1) * y) % N\n                \n                # \u50cf\u7d20\u642c\u5bb6\uff1a\u4ece (x,y) \u642c\u5230 (nx, ny)\n                new_img&#91;nx, ny] = result&#91;x, y]\n        \n        result = new_img\n    \n    return result\n\n\ndef arnold_inverse(img, a=1, b=1, times=1):\n    \"\"\"\n    Arnold \u9006\u5411\u53d8\u6362\uff08\u8fd8\u539f\uff09\n    \"\"\"\n    N = img.shape&#91;0]\n    result = img.copy()\n    \n    for _ in range(times):\n        new_img = np.zeros_like(result)\n        \n        for x in range(N):\n            for y in range(N):\n                # \u8ba1\u7b97\u539f\u4f4d\u7f6e\uff08\u9006\u5411\u516c\u5f0f\uff09\n                nx = ((a * b + 1) * x - a * y) % N\n                ny = (-b * x + y) % N\n                \n                # \u50cf\u7d20\u642c\u5bb6\uff1a\u4ece (x,y) \u642c\u56de (nx, ny)\n                new_img&#91;nx, ny] = result&#91;x, y]\n        \n        result = new_img\n    \n    return result<\/code><\/pre>\n\n\n\n<h3 id=\"\u89e3\u5bc6\u4ee3\u7801\" class=\"wp-block-heading has-medium-font-size\">\u89e3\u5bc6\u4ee3\u7801\uff1a<\/h3>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>import matplotlib.pyplot as plt\nimport cv2\nimport numpy as np\nfrom PIL import Image\n\nimg = cv2.imread('flag.png')\n\ndef arnold_encode(image, shuffle_times, a, b):\n    arnold_image = np.zeros(shape=image.shape)\n    h, w = image.shape&#91;0], image.shape&#91;1]\n    N = h   # \u6216N=w\n\n    for time in range(shuffle_times):\n        for ori_x in range(h):\n            for ori_y in range(w):\n                new_x = (1*ori_x + b*ori_y)% N\n                new_y = (a*ori_x + (a*b+1)*ori_y) % N\n                arnold_image&#91;new_x, new_y, :] = image&#91;ori_x, ori_y, :]\n\n        image = np.copy(arnold_image)\n\n    cv2.imwrite('flag_arnold_encode.png', arnold_image, &#91;int(cv2.IMWRITE_PNG_COMPRESSION), 0])\n    return arnold_image\n\ndef arnold_decode(image, shuffle_times, a, b):\n    decode_image = np.zeros(shape=image.shape)\n    h, w = image.shape&#91;0], image.shape&#91;1]\n    N = h  # \u6216N=w\n\n    for time in range(shuffle_times):\n        for ori_x in range(h):\n            for ori_y in range(w):\n                new_x = ((a * b + 1) * ori_x + (-b) * ori_y) % N\n                new_y = ((-a) * ori_x + ori_y) % N\n                decode_image&#91;new_x, new_y, :] = image&#91;ori_x, ori_y, :]\n\n    cv2.imwrite('flag.png', decode_image, &#91;int(cv2.IMWRITE_PNG_COMPRESSION), 0])\n    return decode_image\n\n# arnold_encode(img, 1, 2, 3)\narnold_decode(img, 1, 29294, 7302244)<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u4e00\u6b21\u5faa\u73af\u4e3a\u4f8b\uff1a &#8220;\u62c9\u4f38\u8fc7\u7a0b&#8221; \u57fa\u672c\u7b97\u6cd5 \u73b0\u6709\u53c2\u6570a\u3001b\u4ee5\u53ca\u8fed\u4ee3\u6b21\u6570T \u5bf9\u4e8e\u6bcf\u4e2a\u50cf\u7d20\u5750 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1868,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_gspb_post_css":"","footnotes":""},"categories":[11,24],"tags":[],"class_list":["post-1860","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-11","category-24"],"_links":{"self":[{"href":"https:\/\/shr1mp.top\/index.php\/wp-json\/wp\/v2\/posts\/1860","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shr1mp.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shr1mp.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shr1mp.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shr1mp.top\/index.php\/wp-json\/wp\/v2\/comments?post=1860"}],"version-history":[{"count":7,"href":"https:\/\/shr1mp.top\/index.php\/wp-json\/wp\/v2\/posts\/1860\/revisions"}],"predecessor-version":[{"id":1867,"href":"https:\/\/shr1mp.top\/index.php\/wp-json\/wp\/v2\/posts\/1860\/revisions\/1867"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/shr1mp.top\/index.php\/wp-json\/wp\/v2\/media\/1868"}],"wp:attachment":[{"href":"https:\/\/shr1mp.top\/index.php\/wp-json\/wp\/v2\/media?parent=1860"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shr1mp.top\/index.php\/wp-json\/wp\/v2\/categories?post=1860"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shr1mp.top\/index.php\/wp-json\/wp\/v2\/tags?post=1860"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}