{"id":1011364,"date":"2024-12-27T11:29:20","date_gmt":"2024-12-27T03:29:20","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1011364.html"},"modified":"2024-12-27T11:29:22","modified_gmt":"2024-12-27T03:29:22","slug":"%e5%a6%82%e4%bd%95%e7%94%a8python%e4%bb%a3%e7%a0%81%e5%86%99%e5%ad%97","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1011364.html","title":{"rendered":"\u5982\u4f55\u7528python\u4ee3\u7801\u5199\u5b57"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25085528\/4162c297-7322-4043-ab13-a7334d56356f.webp\" alt=\"\u5982\u4f55\u7528python\u4ee3\u7801\u5199\u5b57\" \/><\/p>\n<p><p> <strong>\u8981\u5728Python\u4e2d\u5199\u5b57\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u4e2a\u5e93\uff0c\u5982Matplotlib\u3001Pillow\u3001OpenCV\u7b49\u3002\u5176\u4e2d\uff0cPillow\u548cOpenCV\u6700\u5e38\u7528\uff0c\u56e0\u4e3a\u5b83\u4eec\u63d0\u4f9b\u4e86\u7075\u6d3b\u7684\u56fe\u50cf\u5904\u7406\u529f\u80fd\u3001\u652f\u6301\u591a\u79cd\u5b57\u4f53\u683c\u5f0f\u3001\u80fd\u591f\u5728\u4e0d\u540c\u80cc\u666f\u4e0a\u7ed8\u5236\u6587\u672c\u3002\u4ee5\u4e0b\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Pillow\u5e93\u5728\u56fe\u50cf\u4e0a\u5199\u5b57\u3002<\/strong><\/p>\n<\/p>\n<p><p>Pillow\u662fPython Imaging Library\uff08PIL\uff09\u7684\u4e00\u4e2a\u5206\u652f\uff0c\u63d0\u4f9b\u4e86\u56fe\u50cf\u521b\u5efa\u3001\u4fee\u6539\u548c\u4fdd\u5b58\u7684\u529f\u80fd\u3002\u8981\u5728\u56fe\u50cf\u4e0a\u5199\u5b57\uff0c\u9996\u5148\u9700\u8981\u5b89\u88c5Pillow\u5e93\u3002\u53ef\u4ee5\u4f7f\u7528\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><p>\u63a5\u4e0b\u6765\u662f\u4f7f\u7528Pillow\u5728\u56fe\u50cf\u4e0a\u5199\u5b57\u7684\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u521b\u5efa\u56fe\u50cf\u5e76\u5199\u5b57<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u521b\u5efa\u56fe\u50cf<\/strong><\/p>\n<\/p>\n<p><p>\u8981\u5728\u56fe\u50cf\u4e0a\u5199\u5b57\uff0c\u9996\u5148\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u56fe\u50cf\u3002\u53ef\u4ee5\u4f7f\u7528Pillow\u7684<code>Image<\/code>\u6a21\u5757\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u56fe\u50cf\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from PIL import Image<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2aRGB\u6a21\u5f0f\u7684\u56fe\u50cf\uff0c\u5c3a\u5bf8\u4e3a200x100\uff0c\u80cc\u666f\u4e3a\u767d\u8272<\/strong><\/h2>\n<p>image = Image.new(&#39;RGB&#39;, (200, 100), color = (255, 255, 255))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u52a0\u8f7d\u5b57\u4f53<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u56fe\u50cf\u4e0a\u5199\u5b57\u9700\u8981\u6307\u5b9a\u5b57\u4f53\u3002Pillow\u63d0\u4f9b\u4e86<code>ImageFont<\/code>\u6a21\u5757\u6765\u52a0\u8f7d\u5b57\u4f53\u3002\u53ef\u4ee5\u4f7f\u7528\u7cfb\u7edf\u5b57\u4f53\u6216\u4e0b\u8f7d\u5e76\u4f7f\u7528\u81ea\u5b9a\u4e49\u5b57\u4f53\u3002\u4ee5\u4e0b\u662f\u52a0\u8f7d\u5b57\u4f53\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from PIL import ImageFont<\/p>\n<h2><strong>\u6307\u5b9a\u5b57\u4f53\u6587\u4ef6\u548c\u5927\u5c0f<\/strong><\/h2>\n<p>font = ImageFont.truetype(&#39;arial.ttf&#39;, size=24)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u6ca1\u6709\u6307\u5b9a\u5b57\u4f53\u6587\u4ef6\uff0cPillow\u5c06\u4f7f\u7528\u9ed8\u8ba4\u5b57\u4f53\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c<code>arial.ttf<\/code>\u662fWindows\u7cfb\u7edf\u7684\u9ed8\u8ba4\u5b57\u4f53\u6587\u4ef6\uff0c\u5176\u4ed6\u64cd\u4f5c\u7cfb\u7edf\u53ef\u80fd\u9700\u8981\u66f4\u6539\u4e3a\u7cfb\u7edf\u652f\u6301\u7684\u5b57\u4f53\u6587\u4ef6\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7ed8\u5236\u6587\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528Pillow\u7684<code>ImageDraw<\/code>\u6a21\u5757\u53ef\u4ee5\u5728\u56fe\u50cf\u4e0a\u7ed8\u5236\u6587\u672c\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u5728\u56fe\u50cf\u4e0a\u7ed8\u5236\u6587\u672c\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from PIL import ImageDraw<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u7ed8\u56fe\u5bf9\u8c61<\/strong><\/h2>\n<p>draw = ImageDraw.Draw(image)<\/p>\n<h2><strong>\u5728\u56fe\u50cf\u4e0a\u7ed8\u5236\u6587\u672c<\/strong><\/h2>\n<p>text = &quot;Hello, Python!&quot;<\/p>\n<p>text_position = (10, 40)<\/p>\n<p>text_color = (0, 0, 0)  # \u9ed1\u8272<\/p>\n<p>draw.text(text_position, text, font=font, fill=text_color)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4fdd\u5b58\u56fe\u50cf<\/strong><\/p>\n<\/p>\n<p><p>\u5b8c\u6210\u6587\u672c\u7ed8\u5236\u540e\uff0c\u53ef\u4ee5\u5c06\u56fe\u50cf\u4fdd\u5b58\u5230\u6587\u4ef6\u4e2d\u3002\u4ee5\u4e0b\u662f\u4fdd\u5b58\u56fe\u50cf\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4fdd\u5b58\u56fe\u50cf\u5230\u6587\u4ef6<\/p>\n<p>image.save(&#39;output_image.png&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4e8c\u3001\u4f7f\u7528OpenCV\u5728\u56fe\u50cf\u4e0a\u5199\u5b57<\/h3>\n<\/p>\n<p><p>OpenCV\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u8ba1\u7b97\u673a\u89c6\u89c9\u5e93\uff0c\u4e5f\u53ef\u4ee5\u7528\u6765\u5728\u56fe\u50cf\u4e0a\u5199\u5b57\u3002OpenCV\u7684\u6587\u672c\u7ed8\u5236\u529f\u80fd\u53ef\u4ee5\u4e0ePillow\u7ed3\u5408\u4f7f\u7528\u4ee5\u83b7\u5f97\u66f4\u597d\u7684\u6548\u679c\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5OpenCV<\/strong><\/p>\n<\/p>\n<p><p>\u9996\u5148\u9700\u8981\u5b89\u88c5OpenCV\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install opencv-python<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5728\u56fe\u50cf\u4e0a\u5199\u5b57<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528OpenCV\u7684<code>cv2.putText<\/code>\u51fd\u6570\u53ef\u4ee5\u5728\u56fe\u50cf\u4e0a\u5199\u5b57\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import cv2<\/p>\n<p>import numpy as np<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u767d\u8272\u80cc\u666f\u7684\u56fe\u50cf<\/strong><\/h2>\n<p>image = np.ones((100, 200, 3), dtype=np.uint8) * 255<\/p>\n<h2><strong>\u8bbe\u7f6e\u6587\u672c<\/strong><\/h2>\n<p>text = &quot;Hello, OpenCV!&quot;<\/p>\n<p>text_position = (10, 60)<\/p>\n<p>font = cv2.FONT_HERSHEY_SIMPLEX<\/p>\n<p>font_scale = 0.5<\/p>\n<p>text_color = (0, 0, 0)  # \u9ed1\u8272<\/p>\n<p>thickness = 1<\/p>\n<h2><strong>\u5728\u56fe\u50cf\u4e0a\u7ed8\u5236\u6587\u672c<\/strong><\/h2>\n<p>cv2.putText(image, text, text_position, font, font_scale, text_color, thickness)<\/p>\n<h2><strong>\u4fdd\u5b58\u56fe\u50cf<\/strong><\/h2>\n<p>cv2.imwrite(&#39;output_opencv_image.png&#39;, image)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4e09\u3001\u5b57\u4f53\u548c\u989c\u8272\u7684\u9009\u62e9<\/h3>\n<\/p>\n<p><p>\u9009\u62e9\u5408\u9002\u7684\u5b57\u4f53\u548c\u989c\u8272\u5bf9\u4e8e\u5728\u56fe\u50cf\u4e0a\u5199\u5b57\u975e\u5e38\u91cd\u8981\u3002\u5b57\u4f53\u6587\u4ef6\u53ef\u4ee5\u4ece\u7f51\u4e0a\u4e0b\u8f7d\uff0c\u901a\u5e38\u4ee5<code>.ttf<\/code>\u6216<code>.otf<\/code>\u683c\u5f0f\u63d0\u4f9b\u3002\u989c\u8272\u53ef\u4ee5\u4f7f\u7528RGB\u683c\u5f0f\u6307\u5b9a\uff0c\u6bcf\u79cd\u989c\u8272\u7684\u53d6\u503c\u8303\u56f4\u4e3a0\u5230255\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b57\u4f53<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528Pillow\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7<code>ImageFont.truetype<\/code>\u52a0\u8f7d\u81ea\u5b9a\u4e49\u5b57\u4f53\u6587\u4ef6\u3002\u5bf9\u4e8eOpenCV\uff0c\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u7684\u5b57\u4f53\u5e38\u91cf\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u989c\u8272<\/strong><\/p>\n<\/p>\n<p><p>\u989c\u8272\u5728Pillow\u4e2d\u901a\u8fc7<code>fill<\/code>\u53c2\u6570\u6307\u5b9a\uff0c\u5728OpenCV\u4e2d\u901a\u8fc7<code>color<\/code>\u53c2\u6570\u6307\u5b9a\u3002\u53ef\u4ee5\u4f7f\u7528RGB\u683c\u5f0f\u5b9a\u4e49\u989c\u8272\uff0c\u4f8b\u5982\u7ea2\u8272<code>(255, 0, 0)<\/code>\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u56db\u3001\u5b9e\u7528\u6848\u4f8b\u4e0e\u6280\u5de7<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5728\u4e0d\u540c\u80cc\u666f\u4e0a\u5199\u5b57<\/strong><\/p>\n<\/p>\n<p><p>\u53ef\u4ee5\u4f7f\u7528Pillow\u6216OpenCV\u521b\u5efa\u4e0d\u540c\u989c\u8272\u6216\u900f\u660e\u5ea6\u7684\u80cc\u666f\uff0c\u4f8b\u5982\u521b\u5efa\u4e00\u4e2a\u6e10\u53d8\u80cc\u666f\u6216\u900f\u660e\u80cc\u666f\u3002\u8fd9\u9700\u8981\u521b\u5efa\u81ea\u5b9a\u4e49\u56fe\u50cf\uff0c\u5e76\u6839\u636e\u9700\u8981\u8c03\u6574\u989c\u8272\u548c\u900f\u660e\u5ea6\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5904\u7406\u591a\u884c\u6587\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u679c\u9700\u8981\u5728\u56fe\u50cf\u4e0a\u5199\u591a\u884c\u6587\u672c\uff0c\u53ef\u4ee5\u5c06\u6bcf\u884c\u6587\u672c\u5206\u5f00\u5904\u7406\uff0c\u8c03\u6574\u6587\u672c\u4f4d\u7f6e\u4ee5\u9002\u5e94\u56fe\u50cf\u5c3a\u5bf8\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6587\u672c\u65cb\u8f6c\u548c\u7f29\u653e<\/strong><\/p>\n<\/p>\n<p><p>\u5728Pillow\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u53d8\u6362\u56fe\u50cf\u5b9e\u73b0\u6587\u672c\u65cb\u8f6c\u548c\u7f29\u653e\u3002\u5728OpenCV\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u53d8\u6362\u77e9\u9635\u8fdb\u884c\u65cb\u8f6c\u548c\u7f29\u653e\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f18\u5316\u6587\u672c\u6548\u679c<\/strong><\/p>\n<\/p>\n<p><p>\u53ef\u4ee5\u901a\u8fc7\u8c03\u6574\u5b57\u4f53\u5927\u5c0f\u3001\u989c\u8272\u3001\u900f\u660e\u5ea6\u548c\u4f4d\u7f6e\u4f18\u5316\u6587\u672c\u6548\u679c\u3002\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u901a\u8fc7\u6dfb\u52a0\u8fb9\u6846\u3001\u9634\u5f71\u7b49\u6548\u679c\u589e\u5f3a\u6587\u672c\u7684\u53ef\u8bfb\u6027\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u53ef\u4ee5\u5728Python\u4e2d\u5b9e\u73b0\u57fa\u672c\u7684\u6587\u672c\u7ed8\u5236\uff0c\u6ee1\u8db3\u5927\u591a\u6570\u7b80\u5355\u56fe\u50cf\u5904\u7406\u9700\u6c42\u3002\u5bf9\u4e8e\u66f4\u590d\u6742\u7684\u56fe\u50cf\u5904\u7406\u4efb\u52a1\uff0c\u53ef\u4ee5\u7ed3\u5408\u5176\u4ed6\u56fe\u50cf\u5904\u7406\u5e93\u548c\u5de5\u5177\uff0c\u4ee5\u5b9e\u73b0\u66f4\u9ad8\u7ea7\u7684\u6548\u679c\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u7528Python\u5b9e\u73b0\u6587\u5b57\u7ed8\u5236\uff1f<\/strong><br \/>\u4f7f\u7528Python\u7ed8\u5236\u6587\u5b57\u901a\u5e38\u53ef\u4ee5\u501f\u52a9\u51e0\u4e2a\u5e93\u6765\u5b8c\u6210\uff0c\u6bd4\u5982Pillow\u3001Matplotlib\u6216Pygame\u3002Pillow\u662f\u4e00\u4e2a\u56fe\u50cf\u5904\u7406\u5e93\uff0c\u80fd\u591f\u8f7b\u677e\u5730\u5728\u56fe\u50cf\u4e0a\u6dfb\u52a0\u6587\u5b57\u3002\u9996\u5148\u9700\u8981\u5b89\u88c5Pillow\u5e93\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4<code>pip install Pillow<\/code>\u6765\u8fdb\u884c\u5b89\u88c5\u3002\u63a5\u7740\uff0c\u901a\u8fc7\u4ee5\u4e0b\u4ee3\u7801\u793a\u4f8b\u53ef\u4ee5\u5728\u56fe\u50cf\u4e0a\u7ed8\u5236\u6587\u5b57\uff1a<\/p>\n<pre><code class=\"language-python\">from PIL import Image, ImageDraw, ImageFont\n\n# \u521b\u5efa\u4e00\u4e2a\u7a7a\u767d\u56fe\u50cf\nimage = Image.new(&#39;RGB&#39;, (200, 100), color=&#39;white&#39;)\ndraw = ImageDraw.Draw(image)\n\n# \u5b9a\u4e49\u5b57\u4f53\u548c\u5927\u5c0f\nfont = ImageFont.truetype(&#39;arial.ttf&#39;, 24)\n\n# \u5728\u56fe\u50cf\u4e0a\u7ed8\u5236\u6587\u672c\ndraw.text((10, 25), &quot;Hello, Python!&quot;, fill=&#39;black&#39;, font=font)\n\n# \u4fdd\u5b58\u56fe\u50cf\nimage.save(&#39;output.png&#39;)\n<\/code><\/pre>\n<p><strong>\u4f7f\u7528Python\u7ed8\u5236\u6587\u5b57\u65f6\u9700\u8981\u6ce8\u610f\u54ea\u4e9b\u4e8b\u9879\uff1f<\/strong><br \/>\u5728\u7ed8\u5236\u6587\u5b57\u65f6\uff0c\u8981\u786e\u4fdd\u6240\u4f7f\u7528\u7684\u5b57\u4f53\u6587\u4ef6\u5b58\u5728\u4e8e\u6307\u5b9a\u8def\u5f84\u3002\u5bf9\u4e8e\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5b57\u4f53\u7684\u8def\u5f84\u53ef\u80fd\u4f1a\u6709\u6240\u4e0d\u540c\u3002\u6b64\u5916\uff0c\u9009\u62e9\u9002\u5f53\u7684\u5b57\u4f53\u5927\u5c0f\u548c\u989c\u8272\u53ef\u4ee5\u63d0\u5347\u6700\u7ec8\u56fe\u50cf\u7684\u89c6\u89c9\u6548\u679c\u3002\u786e\u4fdd\u56fe\u50cf\u7684\u5927\u5c0f\u80fd\u591f\u5bb9\u7eb3\u6240\u7ed8\u5236\u7684\u6587\u5b57\uff0c\u907f\u514d\u6587\u5b57\u88ab\u622a\u65ad\u3002<\/p>\n<p><strong>Python\u4e2d\u662f\u5426\u6709\u5176\u4ed6\u5e93\u53ef\u4ee5\u7528\u4e8e\u6587\u5b57\u7ed8\u5236\uff1f<\/strong><br \/>\u9664\u4e86Pillow\u4e4b\u5916\uff0cMatplotlib\u4e5f\u53ef\u4ee5\u7528\u6765\u7ed8\u5236\u6587\u5b57\uff0c\u5c24\u5176\u662f\u5728\u6570\u636e\u53ef\u89c6\u5316\u65b9\u9762\u3002\u5b83\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u529f\u80fd\u6765\u521b\u5efa\u5404\u79cd\u56fe\u8868\uff0c\u5e76\u53ef\u4ee5\u5728\u8fd9\u4e9b\u56fe\u8868\u4e0a\u6dfb\u52a0\u6ce8\u91ca\u548c\u6807\u7b7e\u3002Pygame\u5219\u66f4\u9002\u5408\u6e38\u620f\u5f00\u53d1\u548c\u56fe\u5f62\u5e94\u7528\uff0c\u80fd\u591f\u5728\u6e38\u620f\u7a97\u53e3\u4e2d\u7ed8\u5236\u6587\u672c\u548c\u56fe\u5f62\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728\u4e0d\u540c\u7684\u80cc\u666f\u4e0a\u7ed8\u5236\u6587\u672c\u4ee5\u589e\u5f3a\u53ef\u8bfb\u6027\uff1f<\/strong><br \/>\u4e3a\u4e86\u786e\u4fdd\u6587\u672c\u5728\u5404\u79cd\u80cc\u666f\u4e0a\u90fd\u80fd\u6e05\u6670\u53ef\u8bfb\uff0c\u53ef\u4ee5\u8003\u8651\u6dfb\u52a0\u9634\u5f71\u6216\u534a\u900f\u660e\u7684\u80cc\u666f\u6846\u3002\u901a\u8fc7\u8c03\u6574\u6587\u5b57\u7684\u989c\u8272\u4e0e\u80cc\u666f\u7684\u5bf9\u6bd4\u5ea6\uff0c\u6216\u8005\u4f7f\u7528\u63cf\u8fb9\u6548\u679c\uff0c\u4e5f\u80fd\u63d0\u5347\u6587\u672c\u7684\u53ef\u89c1\u6027\u3002\u4f8b\u5982\uff0c\u5728Pillow\u4e2d\uff0c\u53ef\u4ee5\u5148\u7ed8\u5236\u4e00\u4e2a\u7a0d\u5927\u7684\u9ed1\u8272\u77e9\u5f62\uff0c\u7136\u540e\u518d\u7ed8\u5236\u4e0a\u9762\u7684\u767d\u8272\u6587\u5b57\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u5728Python\u4e2d\u5199\u5b57\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u4e2a\u5e93\uff0c\u5982Matplotlib\u3001Pillow\u3001OpenCV\u7b49\u3002\u5176\u4e2d\uff0cPillo [&hellip;]","protected":false},"author":3,"featured_media":1011376,"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\/1011364"}],"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=1011364"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1011364\/revisions"}],"predecessor-version":[{"id":1011378,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1011364\/revisions\/1011378"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1011376"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1011364"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1011364"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1011364"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}