{"id":1024779,"date":"2024-12-30T14:16:36","date_gmt":"2024-12-30T06:16:36","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1024779.html"},"modified":"2024-12-30T14:16:38","modified_gmt":"2024-12-30T06:16:38","slug":"python%e5%a6%82%e4%bd%95%e8%af%bb%e5%85%a5jpg%e6%96%87%e4%bb%b6-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1024779.html","title":{"rendered":"python\u5982\u4f55\u8bfb\u5165jpg\u6587\u4ef6"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/12\/d2e7ac78-32a7-4306-8ec0-6c7eefd3d40b.webp?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"python\u5982\u4f55\u8bfb\u5165jpg\u6587\u4ef6\" \/><\/p>\n<p><p> <strong>Python\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u6cd5\u8bfb\u5165JPG\u6587\u4ef6\uff0c\u4f8b\u5982\u4f7f\u7528Pillow\u5e93\u3001OpenCV\u5e93\u3001scikit-image\u5e93\u7b49\u3002<\/strong>\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u901a\u8fc7\u8fd9\u51e0\u79cd\u65b9\u6cd5\u6765\u8bfb\u5165JPG\u6587\u4ef6\uff0c\u5e76\u5bf9\u5176\u4e2d\u4e00\u79cd\u65b9\u6cd5\u8fdb\u884c\u8be6\u7ec6\u63cf\u8ff0\u3002\u4ee5\u4e0b\u662f\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528Pillow\u5e93\u8bfb\u5165JPG\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>Pillow\u662fPython Imaging Library (PIL)\u7684\u4e00\u4e2a\u5206\u652f\u548c\u6539\u8fdb\u7248\u672c\uff0c\u652f\u6301\u5927\u91cf\u7684\u56fe\u50cf\u6587\u4ef6\u683c\u5f0f\u3002<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5Pillow\u5e93\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-bash\">pip install Pillow<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u4f7f\u7528Pillow\u8bfb\u5165JPG\u6587\u4ef6\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">from PIL import Image<\/p>\n<h2><strong>\u6253\u5f00JPG\u6587\u4ef6<\/strong><\/h2>\n<p>image = Image.open(&#39;path_to_your_image.jpg&#39;)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u50cf<\/strong><\/h2>\n<p>image.show()<\/p>\n<h2><strong>\u83b7\u53d6\u56fe\u50cf\u7684\u5927\u5c0f<\/strong><\/h2>\n<p>width, height = image.size<\/p>\n<p>print(f&quot;Width: {width}, Height: {height}&quot;)<\/p>\n<h2><strong>\u83b7\u53d6\u56fe\u50cf\u7684\u50cf\u7d20\u503c<\/strong><\/h2>\n<p>pixels = list(image.getdata())<\/p>\n<p>print(pixels[:10])  # \u6253\u5370\u524d10\u4e2a\u50cf\u7d20\u503c<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u4ee3\u7801\uff0c\u6211\u4eec\u53ef\u4ee5\u8f7b\u677e\u5730\u8bfb\u53d6JPG\u6587\u4ef6\uff0c\u5e76\u83b7\u53d6\u56fe\u50cf\u7684\u5927\u5c0f\u548c\u50cf\u7d20\u503c\u7b49\u4fe1\u606f\u3002<strong>Pillow\u5e93\u7684\u4f18\u52bf\u5728\u4e8e\u5b83\u7684\u7b80\u5355\u6613\u7528\u548c\u5f3a\u5927\u7684\u56fe\u50cf\u5904\u7406\u529f\u80fd<\/strong>\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528OpenCV\u5e93\u8bfb\u5165JPG\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>OpenCV\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u8ba1\u7b97\u673a\u89c6\u89c9\u5e93\uff0c\u5e7f\u6cdb\u5e94\u7528\u4e8e\u56fe\u50cf\u5904\u7406\u548c\u8ba1\u7b97\u673a\u89c6\u89c9\u9886\u57df\u3002<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5OpenCV\u5e93\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-bash\">pip install opencv-python<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u4f7f\u7528OpenCV\u8bfb\u5165JPG\u6587\u4ef6\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">import cv2<\/p>\n<h2><strong>\u8bfb\u53d6JPG\u6587\u4ef6<\/strong><\/h2>\n<p>image = cv2.imread(&#39;path_to_your_image.jpg&#39;)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u50cf<\/strong><\/h2>\n<p>cv2.imshow(&#39;Image&#39;, 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<h2><strong>\u83b7\u53d6\u56fe\u50cf\u7684\u5927\u5c0f<\/strong><\/h2>\n<p>height, width, channels = image.shape<\/p>\n<p>print(f&quot;Width: {width}, Height: {height}, Channels: {channels}&quot;)<\/p>\n<h2><strong>\u83b7\u53d6\u56fe\u50cf\u7684\u50cf\u7d20\u503c<\/strong><\/h2>\n<p>pixels = image.flatten()<\/p>\n<p>print(pixels[:10])  # \u6253\u5370\u524d10\u4e2a\u50cf\u7d20\u503c<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>OpenCV\u4e0d\u4ec5\u80fd\u591f\u8bfb\u53d6\u548c\u663e\u793a\u56fe\u50cf\uff0c\u8fd8\u53ef\u4ee5\u8fdb\u884c\u5404\u79cd\u590d\u6742\u7684\u56fe\u50cf\u5904\u7406\u64cd\u4f5c\uff0c\u5982\u8fb9\u7f18\u68c0\u6d4b\u3001\u56fe\u50cf\u53d8\u6362\u7b49\u3002<strong>OpenCV\u5e93\u7684\u4f18\u52bf\u5728\u4e8e\u5b83\u7684\u9ad8\u6548\u6027\u548c\u4e30\u5bcc\u7684\u529f\u80fd<\/strong>\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528scikit-image\u5e93\u8bfb\u5165JPG\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>scikit-image\u662f\u4e00\u4e2a\u57fa\u4e8eSciPy\u7684\u56fe\u50cf\u5904\u7406\u5e93\uff0c\u63d0\u4f9b\u4e86\u5927\u91cf\u7684\u56fe\u50cf\u5904\u7406\u7b97\u6cd5\u3002<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5scikit-image\u5e93\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-bash\">pip install scikit-image<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u4f7f\u7528scikit-image\u8bfb\u5165JPG\u6587\u4ef6\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">from skimage import io<\/p>\n<h2><strong>\u8bfb\u53d6JPG\u6587\u4ef6<\/strong><\/h2>\n<p>image = io.imread(&#39;path_to_your_image.jpg&#39;)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u50cf<\/strong><\/h2>\n<p>io.imshow(image)<\/p>\n<p>io.show()<\/p>\n<h2><strong>\u83b7\u53d6\u56fe\u50cf\u7684\u5927\u5c0f<\/strong><\/h2>\n<p>height, width, channels = image.shape<\/p>\n<p>print(f&quot;Width: {width}, Height: {height}, Channels: {channels}&quot;)<\/p>\n<h2><strong>\u83b7\u53d6\u56fe\u50cf\u7684\u50cf\u7d20\u503c<\/strong><\/h2>\n<p>pixels = image.flatten()<\/p>\n<p>print(pixels[:10])  # \u6253\u5370\u524d10\u4e2a\u50cf\u7d20\u503c<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>scikit-image\u5e93\u63d0\u4f9b\u4e86\u7b80\u6d01\u7684\u63a5\u53e3\u548c\u4e30\u5bcc\u7684\u56fe\u50cf\u5904\u7406\u7b97\u6cd5\uff0c\u975e\u5e38\u9002\u5408\u79d1\u7814\u548c\u5de5\u7a0b\u5e94\u7528\u3002<strong>scikit-image\u5e93\u7684\u4f18\u52bf\u5728\u4e8e\u5176\u4e0eSciPy\u751f\u6001\u7cfb\u7edf\u7684\u826f\u597d\u96c6\u6210<\/strong>\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u4f7f\u7528Matplotlib\u5e93\u8bfb\u5165JPG\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>Matplotlib\u662f\u4e00\u4e2a\u7ed8\u56fe\u5e93\uff0c\u4f46\u4e5f\u53ef\u4ee5\u7528\u6765\u8bfb\u53d6\u548c\u663e\u793a\u56fe\u50cf\u3002<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5Matplotlib\u5e93\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-bash\">pip install matplotlib<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u4f7f\u7528Matplotlib\u8bfb\u5165JPG\u6587\u4ef6\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>import matplotlib.image as mpimg<\/p>\n<h2><strong>\u8bfb\u53d6JPG\u6587\u4ef6<\/strong><\/h2>\n<p>image = mpimg.imread(&#39;path_to_your_image.jpg&#39;)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u50cf<\/strong><\/h2>\n<p>plt.imshow(image)<\/p>\n<p>plt.axis(&#39;off&#39;)  # \u4e0d\u663e\u793a\u5750\u6807\u8f74<\/p>\n<p>plt.show()<\/p>\n<h2><strong>\u83b7\u53d6\u56fe\u50cf\u7684\u5927\u5c0f<\/strong><\/h2>\n<p>height, width, channels = image.shape<\/p>\n<p>print(f&quot;Width: {width}, Height: {height}, Channels: {channels}&quot;)<\/p>\n<h2><strong>\u83b7\u53d6\u56fe\u50cf\u7684\u50cf\u7d20\u503c<\/strong><\/h2>\n<p>pixels = image.flatten()<\/p>\n<p>print(pixels[:10])  # \u6253\u5370\u524d10\u4e2a\u50cf\u7d20\u503c<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u867d\u7136Matplotlib\u4e3b\u8981\u7528\u4e8e\u6570\u636e\u53ef\u89c6\u5316\uff0c\u4f46\u5b83\u4e5f\u63d0\u4f9b\u4e86\u57fa\u672c\u7684\u56fe\u50cf\u8bfb\u53d6\u548c\u663e\u793a\u529f\u80fd\u3002<strong>Matplotlib\u5e93\u7684\u4f18\u52bf\u5728\u4e8e\u5176\u5f3a\u5927\u7684\u53ef\u89c6\u5316\u80fd\u529b<\/strong>\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u4f7f\u7528imageio\u5e93\u8bfb\u5165JPG\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>imageio\u662f\u4e00\u4e2a\u63d0\u4f9b\u56fe\u50cf\u548c\u89c6\u9891\u8bfb\u53d6\u4e0e\u5199\u5165\u529f\u80fd\u7684\u5e93\uff0c\u652f\u6301\u591a\u79cd\u6587\u4ef6\u683c\u5f0f\u3002<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5imageio\u5e93\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-bash\">pip install imageio<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u4f7f\u7528imageio\u8bfb\u5165JPG\u6587\u4ef6\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">import imageio<\/p>\n<h2><strong>\u8bfb\u53d6JPG\u6587\u4ef6<\/strong><\/h2>\n<p>image = imageio.imread(&#39;path_to_your_image.jpg&#39;)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u50cf\uff08\u9700\u8981\u989d\u5916\u5b89\u88c5\u5c55\u793a\u5e93\uff09<\/strong><\/h2>\n<p>import matplotlib.pyplot as plt<\/p>\n<p>plt.imshow(image)<\/p>\n<p>plt.axis(&#39;off&#39;)<\/p>\n<p>plt.show()<\/p>\n<h2><strong>\u83b7\u53d6\u56fe\u50cf\u7684\u5927\u5c0f<\/strong><\/h2>\n<p>height, width, channels = image.shape<\/p>\n<p>print(f&quot;Width: {width}, Height: {height}, Channels: {channels}&quot;)<\/p>\n<h2><strong>\u83b7\u53d6\u56fe\u50cf\u7684\u50cf\u7d20\u503c<\/strong><\/h2>\n<p>pixels = image.flatten()<\/p>\n<p>print(pixels[:10])  # \u6253\u5370\u524d10\u4e2a\u50cf\u7d20\u503c<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>imageio\u5e93\u652f\u6301\u591a\u79cd\u56fe\u50cf\u548c\u89c6\u9891\u683c\u5f0f\uff0c\u9002\u5408\u9700\u8981\u5904\u7406\u591a\u79cd\u5a92\u4f53\u6587\u4ef6\u7684\u5e94\u7528\u3002<strong>imageio\u5e93\u7684\u4f18\u52bf\u5728\u4e8e\u5176\u901a\u7528\u6027\u548c\u7075\u6d3b\u6027<\/strong>\u3002<\/p>\n<\/p>\n<p><h3>\u8be6\u7ec6\u63cf\u8ff0Pillow\u5e93\u7684\u4f7f\u7528<\/h3>\n<\/p>\n<p><p>Pillow\u5e93\u662fPython\u4e2d\u6700\u5e38\u7528\u7684\u56fe\u50cf\u5904\u7406\u5e93\u4e4b\u4e00\u3002\u5b83\u4e0d\u4ec5\u652f\u6301\u5927\u91cf\u7684\u56fe\u50cf\u6587\u4ef6\u683c\u5f0f\uff0c\u8fd8\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u56fe\u50cf\u5904\u7406\u529f\u80fd\uff0c\u5982\u7f29\u653e\u3001\u65cb\u8f6c\u3001\u526a\u88c1\u3001\u6ee4\u955c\u5e94\u7528\u7b49\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u56fe\u50cf\u5904\u7406\u64cd\u4f5c\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u7f29\u653e\u56fe\u50cf<\/strong><\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">from PIL import Image<\/p>\n<p>image = Image.open(&#39;path_to_your_image.jpg&#39;)<\/p>\n<p>resized_image = image.resize((100, 100))  # \u7f29\u653e\u5230100x100\u50cf\u7d20<\/p>\n<p>resized_image.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u65cb\u8f6c\u56fe\u50cf<\/strong><\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">rotated_image = image.rotate(45)  # \u65cb\u8f6c45\u5ea6<\/p>\n<p>rotated_image.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u526a\u88c1\u56fe\u50cf<\/strong><\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">cropped_image = image.crop((100, 100, 400, 400))  # \u526a\u88c1\u533a\u57df\u4e3a(\u5de6, \u4e0a, \u53f3, \u4e0b)<\/p>\n<p>cropped_image.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"4\">\n<li><strong>\u5e94\u7528\u6ee4\u955c<\/strong><\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">from PIL import ImageFilter<\/p>\n<p>blurred_image = image.filter(ImageFilter.BLUR)  # \u5e94\u7528\u6a21\u7cca\u6ee4\u955c<\/p>\n<p>blurred_image.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"5\">\n<li><strong>\u4fdd\u5b58\u56fe\u50cf<\/strong><\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">image.save(&#39;new_image.jpg&#39;)  # \u4fdd\u5b58\u56fe\u50cf\u4e3a\u65b0\u7684\u6587\u4ef6<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u8fd9\u4e9b\u793a\u4f8b\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230Pillow\u5e93\u5728\u56fe\u50cf\u5904\u7406\u65b9\u9762\u7684\u5f3a\u5927\u529f\u80fd\u548c\u7075\u6d3b\u6027\u3002\u65e0\u8bba\u662f\u7b80\u5355\u7684\u56fe\u50cf\u8bfb\u53d6\u548c\u663e\u793a\uff0c\u8fd8\u662f\u590d\u6742\u7684\u56fe\u50cf\u5904\u7406\u64cd\u4f5c\uff0cPillow\u5e93\u90fd\u80fd\u8f7b\u677e\u80dc\u4efb\u3002<\/p>\n<\/p>\n<p><h3>\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u672c\u6587\u7684\u4ecb\u7ecd\uff0c\u6211\u4eec\u8be6\u7ec6\u8bb2\u89e3\u4e86Python\u8bfb\u5165JPG\u6587\u4ef6\u7684\u591a\u79cd\u65b9\u6cd5\uff0c\u5305\u62ec\u4f7f\u7528Pillow\u3001OpenCV\u3001scikit-image\u3001Matplotlib\u548cimageio\u5e93\u3002\u6bcf\u79cd\u65b9\u6cd5\u90fd\u6709\u5176\u72ec\u7279\u7684\u4f18\u52bf\u548c\u9002\u7528\u573a\u666f\uff0c\u8bfb\u8005\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5e93\u8fdb\u884c\u56fe\u50cf\u5904\u7406\u3002\u5e0c\u671b\u672c\u6587\u5bf9\u60a8\u6709\u6240\u5e2e\u52a9\uff0c\u795d\u60a8\u5728Python\u56fe\u50cf\u5904\u7406\u7684\u9053\u8def\u4e0a\u53d6\u5f97\u66f4\u597d\u7684\u6210\u7ee9\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u8bfb\u53d6jpg\u6587\u4ef6\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u8bfb\u53d6jpg\u6587\u4ef6\u901a\u5e38\u53ef\u4ee5\u4f7f\u7528PIL\uff08Pillow\uff09\u5e93\u6216OpenCV\u5e93\u3002\u901a\u8fc7PIL\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528<code>Image.open()<\/code>\u65b9\u6cd5\u8f7b\u677e\u6253\u5f00jpg\u6587\u4ef6\uff0c\u800cOpenCV\u5219\u63d0\u4f9b\u4e86<code>cv2.imread()<\/code>\u51fd\u6570\u6765\u8bfb\u53d6\u56fe\u50cf\u3002\u8fd9\u4e24\u79cd\u65b9\u5f0f\u90fd\u80fd\u6709\u6548\u5730\u5904\u7406\u56fe\u50cf\u6570\u636e\uff0c\u7528\u6237\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5e93\u3002<\/p>\n<p><strong>\u8bfb\u53d6jpg\u6587\u4ef6\u65f6\u9700\u8981\u6ce8\u610f\u54ea\u4e9b\u4e8b\u9879\uff1f<\/strong><br \/>\u5728\u8bfb\u53d6jpg\u6587\u4ef6\u65f6\uff0c\u786e\u4fdd\u6587\u4ef6\u8def\u5f84\u6b63\u786e\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u5982\u679c\u6587\u4ef6\u8def\u5f84\u4e0d\u6b63\u786e\uff0cPython\u5c06\u65e0\u6cd5\u627e\u5230\u8be5\u6587\u4ef6\u3002\u6b64\u5916\uff0c\u5904\u7406\u8f83\u5927\u7684jpg\u6587\u4ef6\u65f6\uff0c\u53ef\u80fd\u9700\u8981\u8003\u8651\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\uff0c\u786e\u4fdd\u7cfb\u7edf\u6709\u8db3\u591f\u7684\u8d44\u6e90\u6765\u52a0\u8f7d\u548c\u5904\u7406\u56fe\u50cf\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728\u8bfb\u53d6jpg\u6587\u4ef6\u540e\u8fdb\u884c\u56fe\u50cf\u5904\u7406\uff1f<\/strong><br \/>\u8bfb\u53d6jpg\u6587\u4ef6\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528PIL\u5e93\u6216OpenCV\u5e93\u8fdb\u884c\u5404\u79cd\u56fe\u50cf\u5904\u7406\u64cd\u4f5c\u3002\u4f8b\u5982\uff0c\u4f7f\u7528PIL\u5e93\u53ef\u4ee5\u8fdb\u884c\u56fe\u50cf\u526a\u88c1\u3001\u65cb\u8f6c\u3001\u8c03\u6574\u5927\u5c0f\u7b49\u64cd\u4f5c\uff0c\u800cOpenCV\u5219\u63d0\u4f9b\u4e86\u66f4\u591a\u7684\u56fe\u50cf\u5206\u6790\u529f\u80fd\uff0c\u5982\u8fb9\u7f18\u68c0\u6d4b\u3001\u7279\u5f81\u63d0\u53d6\u7b49\u3002\u9009\u62e9\u9002\u5408\u7684\u5e93\u548c\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u5b9e\u73b0\u6240\u9700\u7684\u56fe\u50cf\u5904\u7406\u6548\u679c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u6cd5\u8bfb\u5165JPG\u6587\u4ef6\uff0c\u4f8b\u5982\u4f7f\u7528Pillow\u5e93\u3001OpenCV\u5e93\u3001scikit-image\u5e93 [&hellip;]","protected":false},"author":3,"featured_media":1024785,"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\/1024779"}],"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=1024779"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1024779\/revisions"}],"predecessor-version":[{"id":1024789,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1024779\/revisions\/1024789"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1024785"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1024779"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1024779"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1024779"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}