{"id":1168970,"date":"2025-01-15T16:04:51","date_gmt":"2025-01-15T08:04:51","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1168970.html"},"modified":"2025-01-15T16:04:53","modified_gmt":"2025-01-15T08:04:53","slug":"%e5%a6%82%e4%bd%95python%e8%be%93%e5%87%ba%e5%9b%be%e7%89%87%e7%9a%84%e5%83%8f%e7%b4%a0","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1168970.html","title":{"rendered":"\u5982\u4f55python\u8f93\u51fa\u56fe\u7247\u7684\u50cf\u7d20"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/26070047\/80d0f945-b099-41ed-a7cc-a87c8393ca4b.webp\" alt=\"\u5982\u4f55python\u8f93\u51fa\u56fe\u7247\u7684\u50cf\u7d20\" \/><\/p>\n<p><p> \u8981\u5728Python\u4e2d\u8f93\u51fa\u56fe\u7247\u7684\u50cf\u7d20\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e9b\u5e38\u89c1\u7684\u56fe\u50cf\u5904\u7406\u5e93\uff0c\u5982Pillow\u3001OpenCV\u7b49\u3002\u8fd9\u4e9b\u5e93\u63d0\u4f9b\u4e86\u7b80\u5355\u7684\u65b9\u6cd5\u6765\u8bfb\u53d6\u3001\u5904\u7406\u548c\u8f93\u51fa\u56fe\u50cf\u7684\u50cf\u7d20\u6570\u636e\u3002<strong>\u901a\u8fc7\u4f7f\u7528Pillow\u5e93\uff0c\u53ef\u4ee5\u8f7b\u677e\u5730\u8bfb\u53d6\u56fe\u50cf\u5e76\u83b7\u53d6\u5176\u50cf\u7d20\u6570\u636e\u3001\u901a\u8fc7\u4f7f\u7528OpenCV\u5e93\uff0c\u53ef\u4ee5\u66f4\u9ad8\u6548\u5730\u5904\u7406\u56fe\u50cf\u6570\u636e\u3001\u4f7f\u7528NumPy\u6570\u7ec4\u6765\u64cd\u4f5c\u56fe\u50cf\u6570\u636e\u53ef\u4ee5\u63d0\u9ad8\u6027\u80fd<\/strong>\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528\u8fd9\u4e9b\u65b9\u6cd5\u6765\u5904\u7406\u56fe\u50cf\u50cf\u7d20\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528Pillow\u5e93<\/h3>\n<\/p>\n<p><p>Pillow\u662f\u4e00\u4e2a\u5f3a\u5927\u7684Python\u56fe\u50cf\u5904\u7406\u5e93\uff0c\u63d0\u4f9b\u4e86\u7b80\u5355\u7684API\u6765\u8bfb\u53d6\u548c\u64cd\u4f5c\u56fe\u50cf\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u4f7f\u7528Pillow\u5e93\u6765\u8f93\u51fa\u56fe\u7247\u7684\u50cf\u7d20\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u5b89\u88c5Pillow\u5e93<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u9700\u8981\u5b89\u88c5Pillow\u5e93\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install pillow<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u8bfb\u53d6\u56fe\u7247\u5e76\u8f93\u51fa\u50cf\u7d20<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528Pillow\u5e93\u8bfb\u53d6\u56fe\u7247\u5e76\u8f93\u51fa\u5176\u50cf\u7d20\u6570\u636e\u7684\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from PIL import Image<\/p>\n<h2><strong>\u6253\u5f00\u56fe\u7247<\/strong><\/h2>\n<p>image = Image.open(&quot;example.jpg&quot;)<\/p>\n<h2><strong>\u83b7\u53d6\u56fe\u7247\u7684\u5bbd\u548c\u9ad8<\/strong><\/h2>\n<p>width, height = image.size<\/p>\n<h2><strong>\u83b7\u53d6\u50cf\u7d20\u6570\u636e<\/strong><\/h2>\n<p>pixels = image.load()<\/p>\n<h2><strong>\u8f93\u51fa\u50cf\u7d20\u6570\u636e<\/strong><\/h2>\n<p>for y in range(height):<\/p>\n<p>    for x in range(width):<\/p>\n<p>        print(f&quot;Pixel at ({x}, {y}): {pixels[x, y]}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u9996\u5148\u901a\u8fc7<code>Image.open()<\/code>\u51fd\u6570\u6253\u5f00\u56fe\u7247\uff0c\u7136\u540e\u901a\u8fc7<code>image.size<\/code>\u83b7\u53d6\u56fe\u7247\u7684\u5bbd\u548c\u9ad8\u3002\u63a5\u7740\uff0c\u901a\u8fc7<code>image.load()<\/code>\u51fd\u6570\u83b7\u53d6\u50cf\u7d20\u6570\u636e\uff0c\u5e76\u4f7f\u7528\u5d4c\u5957\u7684for\u5faa\u73af\u6765\u904d\u5386\u6bcf\u4e2a\u50cf\u7d20\u5e76\u8f93\u51fa\u5176\u503c\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528OpenCV\u5e93<\/h3>\n<\/p>\n<p><p>OpenCV\u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684\u8ba1\u7b97\u673a\u89c6\u89c9\u5e93\uff0c\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u56fe\u50cf\u5904\u7406\u529f\u80fd\u3002\u4f7f\u7528OpenCV\u5e93\u53ef\u4ee5\u66f4\u9ad8\u6548\u5730\u5904\u7406\u56fe\u50cf\u6570\u636e\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u5b89\u88c5OpenCV\u5e93<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u9700\u8981\u5b89\u88c5OpenCV\u5e93\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install opencv-python<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u8bfb\u53d6\u56fe\u7247\u5e76\u8f93\u51fa\u50cf\u7d20<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528OpenCV\u5e93\u8bfb\u53d6\u56fe\u7247\u5e76\u8f93\u51fa\u5176\u50cf\u7d20\u6570\u636e\u7684\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import cv2<\/p>\n<h2><strong>\u8bfb\u53d6\u56fe\u7247<\/strong><\/h2>\n<p>image = cv2.imread(&quot;example.jpg&quot;)<\/p>\n<h2><strong>\u83b7\u53d6\u56fe\u7247\u7684\u5bbd\u548c\u9ad8<\/strong><\/h2>\n<p>height, width, _ = image.shape<\/p>\n<h2><strong>\u8f93\u51fa\u50cf\u7d20\u6570\u636e<\/strong><\/h2>\n<p>for y in range(height):<\/p>\n<p>    for x in range(width):<\/p>\n<p>        pixel = image[y, x]<\/p>\n<p>        print(f&quot;Pixel at ({x}, {y}): {pixel}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u901a\u8fc7<code>cv2.imread()<\/code>\u51fd\u6570\u8bfb\u53d6\u56fe\u7247\uff0c\u7136\u540e\u901a\u8fc7<code>image.shape<\/code>\u83b7\u53d6\u56fe\u7247\u7684\u5bbd\u548c\u9ad8\u3002\u63a5\u7740\uff0c\u4f7f\u7528\u5d4c\u5957\u7684for\u5faa\u73af\u6765\u904d\u5386\u6bcf\u4e2a\u50cf\u7d20\u5e76\u8f93\u51fa\u5176\u503c\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528NumPy\u6570\u7ec4<\/h3>\n<\/p>\n<p><p>NumPy\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u6570\u503c\u8ba1\u7b97\u5e93\uff0c\u53ef\u4ee5\u7528\u6765\u9ad8\u6548\u5730\u64cd\u4f5c\u6570\u7ec4\u6570\u636e\u3002\u7ed3\u5408NumPy\u548cPillow\u6216OpenCV\u5e93\uff0c\u53ef\u4ee5\u66f4\u65b9\u4fbf\u5730\u5904\u7406\u56fe\u50cf\u50cf\u7d20\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u7ed3\u5408Pillow\u548cNumPy<\/h4>\n<\/p>\n<p><p>\u4ee5\u4e0b\u662f\u5982\u4f55\u7ed3\u5408Pillow\u548cNumPy\u6765\u8f93\u51fa\u56fe\u7247\u7684\u50cf\u7d20\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from PIL import Image<\/p>\n<p>import numpy as np<\/p>\n<h2><strong>\u6253\u5f00\u56fe\u7247<\/strong><\/h2>\n<p>image = Image.open(&quot;example.jpg&quot;)<\/p>\n<h2><strong>\u5c06\u56fe\u7247\u8f6c\u6362\u4e3aNumPy\u6570\u7ec4<\/strong><\/h2>\n<p>image_np = np.array(image)<\/p>\n<h2><strong>\u83b7\u53d6\u56fe\u7247\u7684\u5bbd\u548c\u9ad8<\/strong><\/h2>\n<p>height, width, _ = image_np.shape<\/p>\n<h2><strong>\u8f93\u51fa\u50cf\u7d20\u6570\u636e<\/strong><\/h2>\n<p>for y in range(height):<\/p>\n<p>    for x in range(width):<\/p>\n<p>        pixel = image_np[y, x]<\/p>\n<p>        print(f&quot;Pixel at ({x}, {y}): {pixel}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u7ed3\u5408OpenCV\u548cNumPy<\/h4>\n<\/p>\n<p><p>\u4ee5\u4e0b\u662f\u5982\u4f55\u7ed3\u5408OpenCV\u548cNumPy\u6765\u8f93\u51fa\u56fe\u7247\u7684\u50cf\u7d20\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import cv2<\/p>\n<p>import numpy as np<\/p>\n<h2><strong>\u8bfb\u53d6\u56fe\u7247<\/strong><\/h2>\n<p>image = cv2.imread(&quot;example.jpg&quot;)<\/p>\n<h2><strong>\u5c06\u56fe\u7247\u8f6c\u6362\u4e3aNumPy\u6570\u7ec4<\/strong><\/h2>\n<p>image_np = np.array(image)<\/p>\n<h2><strong>\u83b7\u53d6\u56fe\u7247\u7684\u5bbd\u548c\u9ad8<\/strong><\/h2>\n<p>height, width, _ = image_np.shape<\/p>\n<h2><strong>\u8f93\u51fa\u50cf\u7d20\u6570\u636e<\/strong><\/h2>\n<p>for y in range(height):<\/p>\n<p>    for x in range(width):<\/p>\n<p>        pixel = image_np[y, x]<\/p>\n<p>        print(f&quot;Pixel at ({x}, {y}): {pixel}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4f7f\u7528NumPy\u6570\u7ec4\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u5bf9\u56fe\u50cf\u6570\u636e\u8fdb\u884c\u5404\u79cd\u64cd\u4f5c\u548c\u5904\u7406\uff0c\u4f8b\u5982\u77e9\u9635\u8fd0\u7b97\u3001\u56fe\u50cf\u53d8\u6362\u7b49\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u56fe\u50cf\u5904\u7406\u7684\u5176\u4ed6\u6280\u5de7<\/h3>\n<\/p>\n<p><p>\u5728\u56fe\u50cf\u5904\u7406\u8fc7\u7a0b\u4e2d\uff0c\u9664\u4e86\u7b80\u5355\u5730\u8f93\u51fa\u50cf\u7d20\u6570\u636e\u4e4b\u5916\uff0c\u8fd8\u6709\u4e00\u4e9b\u5e38\u7528\u7684\u6280\u5de7\u548c\u65b9\u6cd5\u53ef\u4ee5\u5e2e\u52a9\u4f60\u66f4\u9ad8\u6548\u5730\u5904\u7406\u548c\u5206\u6790\u56fe\u50cf\u6570\u636e\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u56fe\u50cf\u7070\u5ea6\u5316<\/h4>\n<\/p>\n<p><p>\u5c06\u5f69\u8272\u56fe\u50cf\u8f6c\u6362\u4e3a\u7070\u5ea6\u56fe\u50cf\u53ef\u4ee5\u51cf\u5c11\u6570\u636e\u91cf\uff0c\u5e76\u4e14\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u66f4\u5bb9\u6613\u5904\u7406\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u4f7f\u7528Pillow\u5e93\u548cOpenCV\u5e93\u5c06\u56fe\u50cf\u7070\u5ea6\u5316\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528Pillow\u5e93<\/p>\n<p>gray_image = image.convert(&quot;L&quot;)<\/p>\n<p>gray_image.show()<\/p>\n<h2><strong>\u4f7f\u7528OpenCV\u5e93<\/strong><\/h2>\n<p>gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)<\/p>\n<p>cv2.imshow(&quot;Gray Image&quot;, gray_image)<\/p>\n<p>cv2.w<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>tKey(0)<\/p>\n<p>cv2.destroyAllWindows()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u56fe\u50cf\u7f29\u653e<\/h4>\n<\/p>\n<p><p>\u5728\u5904\u7406\u5927\u56fe\u50cf\u65f6\uff0c\u53ef\u4ee5\u5148\u5c06\u56fe\u50cf\u7f29\u5c0f\u4ee5\u51cf\u5c11\u8ba1\u7b97\u91cf\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u4f7f\u7528Pillow\u5e93\u548cOpenCV\u5e93\u7f29\u653e\u56fe\u50cf\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528Pillow\u5e93<\/p>\n<p>resized_image = image.resize((width \/\/ 2, height \/\/ 2))<\/p>\n<p>resized_image.show()<\/p>\n<h2><strong>\u4f7f\u7528OpenCV\u5e93<\/strong><\/h2>\n<p>resized_image = cv2.resize(image, (width \/\/ 2, height \/\/ 2))<\/p>\n<p>cv2.imshow(&quot;Resized Image&quot;, resized_image)<\/p>\n<p>cv2.waitKey(0)<\/p>\n<p>cv2.destroyAllWindows()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001\u56fe\u50cf\u65cb\u8f6c<\/h4>\n<\/p>\n<p><p>\u65cb\u8f6c\u56fe\u50cf\u53ef\u4ee5\u7528\u4e8e\u56fe\u50cf\u589e\u5f3a\u6216\u6570\u636e\u6269\u5145\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u4f7f\u7528Pillow\u5e93\u548cOpenCV\u5e93\u65cb\u8f6c\u56fe\u50cf\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528Pillow\u5e93<\/p>\n<p>rotated_image = image.rotate(45)<\/p>\n<p>rotated_image.show()<\/p>\n<h2><strong>\u4f7f\u7528OpenCV\u5e93<\/strong><\/h2>\n<p>(h, w) = image.shape[:2]<\/p>\n<p>center = (w \/\/ 2, h \/\/ 2)<\/p>\n<p>matrix = cv2.getRotationMatrix2D(center, 45, 1.0)<\/p>\n<p>rotated_image = cv2.warpAffine(image, matrix, (w, h))<\/p>\n<p>cv2.imshow(&quot;Rotated Image&quot;, rotated_image)<\/p>\n<p>cv2.waitKey(0)<\/p>\n<p>cv2.destroyAllWindows()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>4\u3001\u56fe\u50cf\u88c1\u526a<\/h4>\n<\/p>\n<p><p>\u88c1\u526a\u56fe\u50cf\u53ef\u4ee5\u63d0\u53d6\u56fe\u50cf\u4e2d\u7684\u7279\u5b9a\u533a\u57df\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u4f7f\u7528Pillow\u5e93\u548cOpenCV\u5e93\u88c1\u526a\u56fe\u50cf\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528Pillow\u5e93<\/p>\n<p>cropped_image = image.crop((100, 100, 300, 300))<\/p>\n<p>cropped_image.show()<\/p>\n<h2><strong>\u4f7f\u7528OpenCV\u5e93<\/strong><\/h2>\n<p>cropped_image = image[100:300, 100:300]<\/p>\n<p>cv2.imshow(&quot;Cropped Image&quot;, cropped_image)<\/p>\n<p>cv2.waitKey(0)<\/p>\n<p>cv2.destroyAllWindows()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u56fe\u50cf\u50cf\u7d20\u7684\u5e38\u89c1\u64cd\u4f5c<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u5904\u7406\u56fe\u50cf\u50cf\u7d20\u65f6\uff0c\u5e38\u5e38\u9700\u8981\u8fdb\u884c\u4e00\u4e9b\u5e38\u89c1\u7684\u64cd\u4f5c\uff0c\u5982\u989c\u8272\u8f6c\u6362\u3001\u56fe\u50cf\u589e\u5f3a\u3001\u8fb9\u7f18\u68c0\u6d4b\u7b49\u3002\u4e0b\u9762\u5c06\u4ecb\u7ecd\u8fd9\u4e9b\u64cd\u4f5c\u7684\u5177\u4f53\u5b9e\u73b0\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u989c\u8272\u8f6c\u6362<\/h4>\n<\/p>\n<p><p>\u989c\u8272\u8f6c\u6362\u662f\u56fe\u50cf\u5904\u7406\u4e2d\u7684\u57fa\u672c\u64cd\u4f5c\uff0c\u53ef\u4ee5\u5c06\u56fe\u50cf\u4ece\u4e00\u79cd\u989c\u8272\u7a7a\u95f4\u8f6c\u6362\u5230\u53e6\u4e00\u79cd\u989c\u8272\u7a7a\u95f4\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u4f7f\u7528Pillow\u5e93\u548cOpenCV\u5e93\u8fdb\u884c\u989c\u8272\u8f6c\u6362\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528Pillow\u5e93<\/p>\n<p>image_rgb = image.convert(&quot;RGB&quot;)<\/p>\n<p>image_hsv = image.convert(&quot;HSV&quot;)<\/p>\n<p>image_rgb.show()<\/p>\n<p>image_hsv.show()<\/p>\n<h2><strong>\u4f7f\u7528OpenCV\u5e93<\/strong><\/h2>\n<p>image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)<\/p>\n<p>image_hsv = cv2.cvtColor(image, cv2.COLOR_BGR2HSV)<\/p>\n<p>cv2.imshow(&quot;RGB Image&quot;, image_rgb)<\/p>\n<p>cv2.imshow(&quot;HSV Image&quot;, image_hsv)<\/p>\n<p>cv2.waitKey(0)<\/p>\n<p>cv2.destroyAllWindows()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u56fe\u50cf\u589e\u5f3a<\/h4>\n<\/p>\n<p><p>\u56fe\u50cf\u589e\u5f3a\u53ef\u4ee5\u63d0\u9ad8\u56fe\u50cf\u7684\u8d28\u91cf\uff0c\u4f7f\u5176\u66f4\u9002\u5408\u4e8e\u7279\u5b9a\u7684\u5e94\u7528\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u4f7f\u7528Pillow\u5e93\u548cOpenCV\u5e93\u8fdb\u884c\u56fe\u50cf\u589e\u5f3a\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528Pillow\u5e93<\/p>\n<p>enhanced_image = image.point(lambda p: p * 1.5)<\/p>\n<p>enhanced_image.show()<\/p>\n<h2><strong>\u4f7f\u7528OpenCV\u5e93<\/strong><\/h2>\n<p>enhanced_image = cv2.convertScaleAbs(image, alpha=1.5, beta=0)<\/p>\n<p>cv2.imshow(&quot;Enhanced Image&quot;, enhanced_image)<\/p>\n<p>cv2.waitKey(0)<\/p>\n<p>cv2.destroyAllWindows()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001\u8fb9\u7f18\u68c0\u6d4b<\/h4>\n<\/p>\n<p><p>\u8fb9\u7f18\u68c0\u6d4b\u662f\u56fe\u50cf\u5904\u7406\u4e2d\u7684\u91cd\u8981\u64cd\u4f5c\uff0c\u7528\u4e8e\u68c0\u6d4b\u56fe\u50cf\u4e2d\u7684\u8fb9\u7f18\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u4f7f\u7528OpenCV\u5e93\u8fdb\u884c\u8fb9\u7f18\u68c0\u6d4b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)<\/p>\n<p>edges = cv2.Canny(gray_image, 100, 200)<\/p>\n<p>cv2.imshow(&quot;Edges&quot;, edges)<\/p>\n<p>cv2.waitKey(0)<\/p>\n<p>cv2.destroyAllWindows()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>4\u3001\u56fe\u50cf\u5e73\u6ed1<\/h4>\n<\/p>\n<p><p>\u56fe\u50cf\u5e73\u6ed1\u53ef\u4ee5\u53bb\u9664\u56fe\u50cf\u4e2d\u7684\u566a\u58f0\uff0c\u4f7f\u5176\u66f4\u52a0\u5e73\u6ed1\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u4f7f\u7528OpenCV\u5e93\u8fdb\u884c\u56fe\u50cf\u5e73\u6ed1\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">smoothed_image = cv2.GaussianBlur(image, (5, 5), 0)<\/p>\n<p>cv2.imshow(&quot;Smoothed Image&quot;, smoothed_image)<\/p>\n<p>cv2.waitKey(0)<\/p>\n<p>cv2.destroyAllWindows()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516d\u3001\u56fe\u50cf\u50cf\u7d20\u7684\u9ad8\u7ea7\u5904\u7406<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u57fa\u672c\u7684\u56fe\u50cf\u50cf\u7d20\u64cd\u4f5c\u5916\uff0c\u8fd8\u6709\u4e00\u4e9b\u9ad8\u7ea7\u7684\u56fe\u50cf\u5904\u7406\u65b9\u6cd5\u53ef\u4ee5\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u5206\u6790\u548c\u5904\u7406\u56fe\u50cf\u6570\u636e\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u56fe\u50cf\u5206\u5272<\/h4>\n<\/p>\n<p><p>\u56fe\u50cf\u5206\u5272\u662f\u5c06\u56fe\u50cf\u5206\u5272\u6210\u591a\u4e2a\u90e8\u5206\u6216\u5bf9\u8c61\u7684\u8fc7\u7a0b\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u4f7f\u7528OpenCV\u5e93\u8fdb\u884c\u56fe\u50cf\u5206\u5272\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)<\/p>\n<p>_, thresholded_image = cv2.threshold(gray_image, 127, 255, cv2.THRESH_BINARY)<\/p>\n<p>contours, _ = cv2.findContours(thresholded_image, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)<\/p>\n<p>cv2.drawContours(image, contours, -1, (0, 255, 0), 3)<\/p>\n<p>cv2.imshow(&quot;Segmented Image&quot;, image)<\/p>\n<p>cv2.waitKey(0)<\/p>\n<p>cv2.destroyAllWindows()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u56fe\u50cf\u7279\u5f81\u63d0\u53d6<\/h4>\n<\/p>\n<p><p>\u56fe\u50cf\u7279\u5f81\u63d0\u53d6\u662f\u4ece\u56fe\u50cf\u4e2d\u63d0\u53d6\u6709\u7528\u4fe1\u606f\u7684\u8fc7\u7a0b\uff0c\u7528\u4e8e\u56fe\u50cf\u8bc6\u522b\u548c\u5206\u7c7b\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u4f7f\u7528OpenCV\u5e93\u8fdb\u884c\u56fe\u50cf\u7279\u5f81\u63d0\u53d6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)<\/p>\n<p>orb = cv2.ORB_create()<\/p>\n<p>keypoints, descriptors = orb.detectAndCompute(gray_image, None)<\/p>\n<p>image_with_keypoints = cv2.drawKeypoints(image, keypoints, None, color=(0, 255, 0))<\/p>\n<p>cv2.imshow(&quot;Image with Keypoints&quot;, image_with_keypoints)<\/p>\n<p>cv2.waitKey(0)<\/p>\n<p>cv2.destroyAllWindows()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001\u56fe\u50cf\u5339\u914d<\/h4>\n<\/p>\n<p><p>\u56fe\u50cf\u5339\u914d\u662f\u5c06\u4e24\u4e2a\u56fe\u50cf\u8fdb\u884c\u5bf9\u6bd4\uff0c\u4ee5\u627e\u5230\u76f8\u4f3c\u7684\u90e8\u5206\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u4f7f\u7528OpenCV\u5e93\u8fdb\u884c\u56fe\u50cf\u5339\u914d\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u8bfb\u53d6\u4e24\u5f20\u56fe\u7247<\/p>\n<p>image1 = cv2.imread(&quot;example1.jpg&quot;)<\/p>\n<p>image2 = cv2.imread(&quot;example2.jpg&quot;)<\/p>\n<h2><strong>\u5c06\u56fe\u7247\u8f6c\u6362\u4e3a\u7070\u5ea6\u56fe\u50cf<\/strong><\/h2>\n<p>gray_image1 = cv2.cvtColor(image1, cv2.COLOR_BGR2GRAY)<\/p>\n<p>gray_image2 = cv2.cvtColor(image2, cv2.COLOR_BGR2GRAY)<\/p>\n<h2><strong>\u4f7f\u7528ORB\u7279\u5f81\u63d0\u53d6\u5668<\/strong><\/h2>\n<p>orb = cv2.ORB_create()<\/p>\n<p>keypoints1, descriptors1 = orb.detectAndCompute(gray_image1, None)<\/p>\n<p>keypoints2, descriptors2 = orb.detectAndCompute(gray_image2, None)<\/p>\n<h2><strong>\u4f7f\u7528BFMatcher\u8fdb\u884c\u7279\u5f81\u5339\u914d<\/strong><\/h2>\n<p>bf = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=True)<\/p>\n<p>matches = bf.match(descriptors1, descriptors2)<\/p>\n<p>matches = sorted(matches, key=lambda x: x.distance)<\/p>\n<h2><strong>\u7ed8\u5236\u5339\u914d\u7ed3\u679c<\/strong><\/h2>\n<p>matched_image = cv2.drawMatches(image1, keypoints1, image2, keypoints2, matches[:10], None, flags=cv2.DrawMatchesFlags_NOT_DRAW_SINGLE_POINTS)<\/p>\n<p>cv2.imshow(&quot;Matched Image&quot;, matched_image)<\/p>\n<p>cv2.waitKey(0)<\/p>\n<p>cv2.destroyAllWindows()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e03\u3001\u56fe\u50cf\u5904\u7406\u7684\u5b9e\u9645\u5e94\u7528<\/h3>\n<\/p>\n<p><p>\u56fe\u50cf\u5904\u7406\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u6709\u7740\u5e7f\u6cdb\u7684\u5e94\u7528\u9886\u57df\uff0c\u5982\u4eba\u8138\u8bc6\u522b\u3001\u8f66\u724c\u8bc6\u522b\u3001\u533b\u5b66\u56fe\u50cf\u5904\u7406\u7b49\u3002\u4ee5\u4e0b\u5c06\u4ecb\u7ecd\u51e0\u4e2a\u5b9e\u9645\u5e94\u7528\u6848\u4f8b\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u4eba\u8138\u8bc6\u522b<\/h4>\n<\/p>\n<p><p>\u4eba\u8138\u8bc6\u522b\u662f\u4e00\u79cd\u5e38\u89c1\u7684\u56fe\u50cf\u5904\u7406\u5e94\u7528\uff0c\u7528\u4e8e\u8bc6\u522b\u4eba\u8138\u5e76\u8fdb\u884c\u8eab\u4efd\u9a8c\u8bc1\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u4f7f\u7528OpenCV\u5e93\u8fdb\u884c\u4eba\u8138\u8bc6\u522b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u52a0\u8f7d\u4eba\u8138\u68c0\u6d4b\u6a21\u578b<\/p>\n<p>face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + &#39;haarcascade_frontalface_default.xml&#39;)<\/p>\n<h2><strong>\u8bfb\u53d6\u56fe\u7247<\/strong><\/h2>\n<p>image = cv2.imread(&quot;example.jpg&quot;)<\/p>\n<p>gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)<\/p>\n<h2><strong>\u68c0\u6d4b\u4eba\u8138<\/strong><\/h2>\n<p>faces = face_cascade.detectMultiScale(gray_image, scaleFactor=1.1, minNeighbors=5, minSize=(30, 30))<\/p>\n<h2><strong>\u7ed8\u5236\u4eba\u8138\u68c0\u6d4b\u7ed3\u679c<\/strong><\/h2>\n<p>for (x, y, w, h) in faces:<\/p>\n<p>    cv2.rectangle(image, (x, y), (x+w, y+h), (0, 255, 0), 2)<\/p>\n<p>cv2.imshow(&quot;Face Detection&quot;, image)<\/p>\n<p>cv2.waitKey(0)<\/p>\n<p>cv2.destroyAllWindows()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u8f66\u724c\u8bc6\u522b<\/h4>\n<\/p>\n<p><p>\u8f66\u724c\u8bc6\u522b\u662f\u4e00\u79cd\u7528\u4e8e\u8bc6\u522b\u8f66\u8f86\u8f66\u724c\u53f7\u7801\u7684\u56fe\u50cf\u5904\u7406\u5e94\u7528\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u4f7f\u7528OpenCV\u5e93\u8fdb\u884c\u8f66\u724c\u8bc6\u522b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u52a0\u8f7d\u8f66\u724c\u68c0\u6d4b\u6a21\u578b<\/p>\n<p>plate_cascade = cv2.CascadeClassifier(&#39;haarcascade_russian_plate_number.xml&#39;)<\/p>\n<h2><strong>\u8bfb\u53d6\u56fe\u7247<\/strong><\/h2>\n<p>image = cv2.imread(&quot;car.jpg&quot;)<\/p>\n<p>gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)<\/p>\n<h2><strong>\u68c0\u6d4b\u8f66\u724c<\/strong><\/h2>\n<p>plates = plate_cascade.detectMultiScale(gray_image, scaleFactor=1.1, minNeighbors=5, minSize=(30, 30))<\/p>\n<h2><strong>\u7ed8\u5236\u8f66\u724c\u68c0\u6d4b\u7ed3\u679c<\/strong><\/h2>\n<p>for (x, y, w, h) in plates:<\/p>\n<p>    cv2.rectangle(image, (x, y), (x+w, y+h), (0, 255, 0), 2)<\/p>\n<p>cv2.imshow(&quot;Plate Detection&quot;, image)<\/p>\n<p>cv2.waitKey(0)<\/p>\n<p>cv2.destroyAllWindows()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001\u533b\u5b66\u56fe\u50cf\u5904\u7406<\/h4>\n<\/p>\n<p><p>\u533b\u5b66\u56fe\u50cf\u5904\u7406\u7528\u4e8e\u5206\u6790\u548c\u5904\u7406\u533b\u5b66\u56fe\u50cf\uff0c\u5982X\u5149\u7247\u3001CT\u626b\u63cf\u7b49\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u4f7f\u7528OpenCV\u5e93\u8fdb\u884c\u7b80\u5355\u7684\u533b\u5b66\u56fe\u50cf\u5904\u7406\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u8bfb\u53d6\u533b\u5b66\u56fe\u50cf<\/p>\n<p>image = cv2.imread(&quot;medical_image.jpg&quot;, cv2.IMREAD_GRAYSCALE)<\/p>\n<h2><strong>\u8fdb\u884c\u56fe\u50cf\u589e\u5f3a<\/strong><\/h2>\n<p>enhanced_image = cv2.equalizeHist(image)<\/p>\n<h2><strong>\u663e\u793a\u5904\u7406\u7ed3\u679c<\/strong><\/h2>\n<p>cv2.imshow(&quot;Original Image&quot;, image)<\/p>\n<p>cv2.imshow(&quot;Enhanced Image&quot;, enhanced_image)<\/p>\n<p>cv2.waitKey(0)<\/p>\n<p>cv2.destroyAllWindows()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516b\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528Python\u8f93\u51fa\u56fe\u7247\u7684\u50cf\u7d20\u6570\u636e\uff0c<strong>\u901a\u8fc7\u4f7f\u7528Pillow\u5e93\uff0c\u53ef\u4ee5\u8f7b\u677e\u5730\u8bfb\u53d6\u56fe\u50cf\u5e76\u83b7\u53d6\u5176\u50cf\u7d20\u6570\u636e\u3001\u901a\u8fc7\u4f7f\u7528OpenCV\u5e93\uff0c\u53ef\u4ee5\u66f4\u9ad8\u6548\u5730\u5904\u7406\u56fe\u50cf\u6570\u636e\u3001\u4f7f\u7528NumPy\u6570\u7ec4\u6765\u64cd\u4f5c\u56fe\u50cf\u6570\u636e\u53ef\u4ee5\u63d0\u9ad8\u6027\u80fd<\/strong>\u3002\u6b64\u5916\uff0c\u6211\u4eec\u8fd8\u4ecb\u7ecd\u4e86\u56fe\u50cf\u5904\u7406\u7684\u5176\u4ed6\u6280\u5de7\u3001\u56fe\u50cf\u50cf\u7d20\u7684\u5e38\u89c1\u64cd\u4f5c\u3001\u56fe\u50cf\u50cf\u7d20\u7684\u9ad8\u7ea7\u5904\u7406\u4ee5\u53ca\u56fe\u50cf\u5904\u7406\u7684\u5b9e\u9645\u5e94\u7528\u3002\u901a\u8fc7\u5b66\u4e60\u8fd9\u4e9b\u5185\u5bb9\uff0c\u4f60\u53ef\u4ee5\u66f4\u597d\u5730\u7406\u89e3\u548c\u5e94\u7528\u56fe\u50cf\u5904\u7406\u6280\u672f\uff0c\u89e3\u51b3\u5b9e\u9645\u95ee\u9898\u3002\u5e0c\u671b\u672c\u6587\u80fd\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u8bfb\u53d6\u548c\u8f93\u51fa\u56fe\u7247\u7684\u50cf\u7d20\u503c\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528PIL\uff08Pillow\uff09\u5e93\u6765\u8bfb\u53d6\u56fe\u7247\u5e76\u83b7\u53d6\u50cf\u7d20\u503c\u3002\u9996\u5148\u9700\u8981\u5b89\u88c5Pillow\u5e93\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4<code>pip install Pillow<\/code>\u8fdb\u884c\u5b89\u88c5\u3002\u8bfb\u53d6\u56fe\u7247\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528<code>Image.open()<\/code>\u65b9\u6cd5\u6253\u5f00\u56fe\u7247\uff0c\u7136\u540e\u901a\u8fc7<code>.getpixel()<\/code>\u65b9\u6cd5\u83b7\u53d6\u7279\u5b9a\u4f4d\u7f6e\u7684\u50cf\u7d20\u503c\u3002\u4f8b\u5982\uff1a<\/p>\n<pre><code class=\"language-python\">from PIL import Image\n\n# \u6253\u5f00\u56fe\u7247\nimg = Image.open(&#39;your_image.jpg&#39;)\n\n# \u83b7\u53d6\u67d0\u4e2a\u50cf\u7d20\u7684\u503c\npixel_value = img.getpixel((x, y))\nprint(pixel_value)\n<\/code><\/pre>\n<p>\u8fd9\u6837\u5c31\u80fd\u8f93\u51fa\u6307\u5b9a\u5750\u6807\u5904\u7684\u50cf\u7d20\u503c\u3002<\/p>\n<p><strong>\u5982\u4f55\u6279\u91cf\u8bfb\u53d6\u56fe\u7247\u7684\u50cf\u7d20\u503c\uff1f<\/strong><br \/>\u5982\u679c\u9700\u8981\u5904\u7406\u591a\u4e2a\u56fe\u7247\uff0c\u53ef\u4ee5\u901a\u8fc7\u5faa\u73af\u904d\u5386\u6587\u4ef6\u5939\u4e2d\u7684\u56fe\u7247\u6587\u4ef6\u3002\u4f7f\u7528<code>os<\/code>\u5e93\u5217\u51fa\u6587\u4ef6\u5939\u4e2d\u7684\u6240\u6709\u56fe\u7247\u6587\u4ef6\uff0c\u7ed3\u5408Pillow\u5e93\u8bfb\u53d6\u6bcf\u5f20\u56fe\u7247\u7684\u50cf\u7d20\u503c\u3002\u4f8b\u5982\uff1a<\/p>\n<pre><code class=\"language-python\">import os\nfrom PIL import Image\n\nfolder_path = &#39;path\/to\/your\/images&#39;\n\nfor filename in os.listdir(folder_path):\n    if filename.endswith(&#39;.jpg&#39;) or filename.endswith(&#39;.png&#39;):\n        img = Image.open(os.path.join(folder_path, filename))\n        pixel_value = img.getpixel((x, y))\n        print(f&quot;{filename}: {pixel_value}&quot;)\n<\/code><\/pre>\n<p>\u8fd9\u6837\u5c31\u53ef\u4ee5\u8f93\u51fa\u6587\u4ef6\u5939\u4e2d\u6bcf\u5f20\u56fe\u7247\u7279\u5b9a\u5750\u6807\u7684\u50cf\u7d20\u503c\u3002<\/p>\n<p><strong>\u5982\u4f55\u53ef\u89c6\u5316\u56fe\u7247\u7684\u50cf\u7d20\u4fe1\u606f\uff1f<\/strong><br \/>\u4e3a\u4e86\u66f4\u76f4\u89c2\u5730\u67e5\u770b\u56fe\u7247\u7684\u50cf\u7d20\u4fe1\u606f\uff0c\u53ef\u4ee5\u4f7f\u7528Matplotlib\u5e93\u5c06\u56fe\u7247\u5c55\u793a\u51fa\u6765\u3002\u5728\u83b7\u53d6\u5230\u50cf\u7d20\u503c\u7684\u540c\u65f6\uff0c\u5c06\u56fe\u7247\u663e\u793a\u51fa\u6765\uff0c\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u66f4\u597d\u5730\u7406\u89e3\u50cf\u7d20\u5206\u5e03\u3002\u4ee5\u4e0b\u662f\u7b80\u5355\u7684\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<pre><code class=\"language-python\">import matplotlib.pyplot as plt\nfrom PIL import Image\n\nimg = Image.open(&#39;your_image.jpg&#39;)\nplt.imshow(img)\nplt.axis(&#39;off&#39;)  # \u4e0d\u663e\u793a\u5750\u6807\u8f74\nplt.show()\n<\/code><\/pre>\n<p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u53ef\u4ee5\u5c06\u56fe\u7247\u5728\u7a97\u53e3\u4e2d\u663e\u793a\u51fa\u6765\uff0c\u5e76\u7ed3\u5408\u50cf\u7d20\u503c\u8fdb\u884c\u5206\u6790\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u5728Python\u4e2d\u8f93\u51fa\u56fe\u7247\u7684\u50cf\u7d20\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e9b\u5e38\u89c1\u7684\u56fe\u50cf\u5904\u7406\u5e93\uff0c\u5982Pillow\u3001OpenCV\u7b49\u3002\u8fd9\u4e9b\u5e93\u63d0\u4f9b\u4e86 [&hellip;]","protected":false},"author":3,"featured_media":1168974,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1168970"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1168970"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1168970\/revisions"}],"predecessor-version":[{"id":1168975,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1168970\/revisions\/1168975"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1168974"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1168970"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1168970"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1168970"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}