{"id":1116884,"date":"2025-01-08T18:20:47","date_gmt":"2025-01-08T10:20:47","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1116884.html"},"modified":"2025-01-08T18:20:50","modified_gmt":"2025-01-08T10:20:50","slug":"python%e5%a6%82%e4%bd%95%e5%af%b9%e5%9b%be%e7%89%87%e8%bf%9b%e8%a1%8c%e4%ba%8c%e5%80%bc%e5%8c%96%e6%98%be%e7%a4%ba-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1116884.html","title":{"rendered":"python\u5982\u4f55\u5bf9\u56fe\u7247\u8fdb\u884c\u4e8c\u503c\u5316\u663e\u793a"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25081028\/664a84ab-102e-438c-bc82-91ca9db05762.webp\" alt=\"python\u5982\u4f55\u5bf9\u56fe\u7247\u8fdb\u884c\u4e8c\u503c\u5316\u663e\u793a\" \/><\/p>\n<p><p> <strong>Python\u5bf9\u56fe\u7247\u8fdb\u884c\u4e8c\u503c\u5316\u663e\u793a\u7684\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528OpenCV\u3001PIL\u548cScikit-image\u5e93\u3002<\/strong> \u5728\u8fd9\u4e09\u79cd\u65b9\u6cd5\u4e2d\uff0cOpenCV\u662f\u6700\u5e38\u7528\u7684\uff0c\u56e0\u4e3a\u5b83\u529f\u80fd\u5f3a\u5927\u4e14\u9ad8\u6548\uff0cPIL\u9002\u5408\u7b80\u5355\u7684\u56fe\u50cf\u5904\u7406\uff0c\u800cScikit-image\u5219\u63d0\u4f9b\u4e86\u66f4\u591a\u7684\u56fe\u50cf\u5904\u7406\u7b97\u6cd5\u3002\u5728\u8fd9\u91cc\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528\u8fd9\u4e09\u79cd\u65b9\u6cd5\u5bf9\u56fe\u7247\u8fdb\u884c\u4e8c\u503c\u5316\u5904\u7406\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528OpenCV\u8fdb\u884c\u4e8c\u503c\u5316\u5904\u7406<\/h3>\n<\/p>\n<p><p>OpenCV\uff08Open Source Computer Vision Library\uff09\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u8ba1\u7b97\u673a\u89c6\u89c9\u548c<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u8f6f\u4ef6\u5e93\u3002\u5b83\u63d0\u4f9b\u4e86\u5927\u91cf\u7684\u56fe\u50cf\u5904\u7406\u529f\u80fd\uff0c\u5305\u62ec\u56fe\u50cf\u4e8c\u503c\u5316\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5OpenCV<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u4f60\u9700\u8981\u5b89\u88c5OpenCV\u5e93\u3002\u5982\u679c\u4f60\u8fd8\u6ca1\u6709\u5b89\u88c5\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\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. \u8bfb\u53d6\u548c\u663e\u793a\u56fe\u50cf<\/h4>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u4f7f\u7528OpenCV\u8bfb\u53d6\u548c\u663e\u793a\u56fe\u50cf\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import cv2<\/p>\n<p>import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u8bfb\u53d6\u56fe\u50cf<\/strong><\/h2>\n<p>image = cv2.imread(&#39;path_to_your_image.jpg&#39;, cv2.IMREAD_GRAYSCALE)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u50cf<\/strong><\/h2>\n<p>plt.imshow(image, cmap=&#39;gray&#39;)<\/p>\n<p>plt.title(&#39;Original Image&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u5e94\u7528\u4e8c\u503c\u5316\u5904\u7406<\/h4>\n<\/p>\n<p><p>\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528OpenCV\u7684<code>cv2.threshold<\/code>\u51fd\u6570\u6765\u8fdb\u884c\u4e8c\u503c\u5316\u5904\u7406\u3002\u8be5\u51fd\u6570\u6709\u591a\u4e2a\u53c2\u6570\uff0c\u4f46\u6700\u91cd\u8981\u7684\u662f\u9608\u503c\u548c\u6700\u5927\u503c\u3002\u9608\u503c\u7528\u4e8e\u51b3\u5b9a\u50cf\u7d20\u503c\u662f\u5426\u88ab\u7f6e\u4e3a0\u6216\u6700\u5927\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u5e94\u7528\u4e8c\u503c\u5316\u5904\u7406<\/p>\n<p>ret, binary_image = cv2.threshold(image, 127, 255, cv2.THRESH_BINARY)<\/p>\n<h2><strong>\u663e\u793a\u4e8c\u503c\u5316\u56fe\u50cf<\/strong><\/h2>\n<p>plt.imshow(binary_image, cmap=&#39;gray&#39;)<\/p>\n<p>plt.title(&#39;Binary Image&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u9608\u503c\u8bbe\u7f6e\u4e3a127\uff0c\u6700\u5927\u503c\u8bbe\u7f6e\u4e3a255\u3002\u5982\u679c\u50cf\u7d20\u503c\u5927\u4e8e127\uff0c\u5219\u5c06\u5176\u7f6e\u4e3a255\uff0c\u5426\u5219\u7f6e\u4e3a0\u3002<\/p>\n<\/p>\n<p><h4>4. \u81ea\u9002\u5e94\u9608\u503c\u5904\u7406<\/h4>\n<\/p>\n<p><p>OpenCV\u8fd8\u63d0\u4f9b\u4e86\u81ea\u9002\u5e94\u9608\u503c\u5904\u7406\u65b9\u6cd5\uff0c\u8fd9\u5728\u5904\u7406\u5149\u7167\u4e0d\u5747\u5300\u7684\u56fe\u50cf\u65f6\u975e\u5e38\u6709\u7528\u3002\u81ea\u9002\u5e94\u9608\u503c\u5904\u7406\u6839\u636e\u56fe\u50cf\u7684\u5c40\u90e8\u53d8\u5316\u6765\u8ba1\u7b97\u9608\u503c\uff0c\u800c\u4e0d\u662f\u4f7f\u7528\u5168\u5c40\u9608\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u5e94\u7528\u81ea\u9002\u5e94\u9608\u503c\u5904\u7406<\/p>\n<p>adaptive_thresh = cv2.adaptiveThreshold(image, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY, 11, 2)<\/p>\n<h2><strong>\u663e\u793a\u81ea\u9002\u5e94\u9608\u503c\u5904\u7406\u540e\u7684\u56fe\u50cf<\/strong><\/h2>\n<p>plt.imshow(adaptive_thresh, cmap=&#39;gray&#39;)<\/p>\n<p>plt.title(&#39;Adaptive Threshold Image&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>cv2.ADAPTIVE_THRESH_GAUSSIAN_C<\/code>\u8868\u793a\u4f7f\u7528\u9ad8\u65af\u52a0\u6743\u7684\u81ea\u9002\u5e94\u9608\u503c\u65b9\u6cd5\uff0c\u5757\u5927\u5c0f\u4e3a11\uff0c\u5e38\u6570C\u4e3a2\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528PIL\u8fdb\u884c\u4e8c\u503c\u5316\u5904\u7406<\/h3>\n<\/p>\n<p><p>PIL\uff08Python Imaging Library\uff09\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u56fe\u50cf\u5904\u7406\u5e93\uff0c\u867d\u7136\u5b83\u5df2\u7ecf\u88abPillow\u5e93\u66ff\u4ee3\uff0c\u4f46Pillow\u517c\u5bb9PIL\u7684\u6240\u6709\u529f\u80fd\u3002\u6211\u4eec\u5c06\u4f7f\u7528Pillow\u5e93\u8fdb\u884c\u56fe\u50cf\u4e8c\u503c\u5316\u5904\u7406\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5Pillow<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u4f60\u9700\u8981\u5b89\u88c5Pillow\u5e93\u3002\u5982\u679c\u4f60\u8fd8\u6ca1\u6709\u5b89\u88c5\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\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. \u8bfb\u53d6\u548c\u663e\u793a\u56fe\u50cf<\/h4>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u4f7f\u7528Pillow\u8bfb\u53d6\u548c\u663e\u793a\u56fe\u50cf\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from PIL import Image<\/p>\n<p>import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u8bfb\u53d6\u56fe\u50cf<\/strong><\/h2>\n<p>image = Image.open(&#39;path_to_your_image.jpg&#39;).convert(&#39;L&#39;)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u50cf<\/strong><\/h2>\n<p>plt.imshow(image, cmap=&#39;gray&#39;)<\/p>\n<p>plt.title(&#39;Original Image&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u5e94\u7528\u4e8c\u503c\u5316\u5904\u7406<\/h4>\n<\/p>\n<p><p>\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528Pillow\u7684<code>point<\/code>\u65b9\u6cd5\u6765\u8fdb\u884c\u4e8c\u503c\u5316\u5904\u7406\u3002\u8be5\u65b9\u6cd5\u5141\u8bb8\u6211\u4eec\u5e94\u7528\u4e00\u4e2a\u51fd\u6570\u5230\u56fe\u50cf\u7684\u6bcf\u4e2a\u50cf\u7d20\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u5b9a\u4e49\u4e8c\u503c\u5316\u51fd\u6570<\/p>\n<p>def binarize(image, threshold):<\/p>\n<p>    return image.point(lambda p: p &gt; threshold and 255)<\/p>\n<h2><strong>\u5e94\u7528\u4e8c\u503c\u5316\u5904\u7406<\/strong><\/h2>\n<p>binary_image = binarize(image, 127)<\/p>\n<h2><strong>\u663e\u793a\u4e8c\u503c\u5316\u56fe\u50cf<\/strong><\/h2>\n<p>plt.imshow(binary_image, cmap=&#39;gray&#39;)<\/p>\n<p>plt.title(&#39;Binary Image&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u9608\u503c\u8bbe\u7f6e\u4e3a127\u3002\u5982\u679c\u50cf\u7d20\u503c\u5927\u4e8e127\uff0c\u5219\u5c06\u5176\u7f6e\u4e3a255\uff0c\u5426\u5219\u7f6e\u4e3a0\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528Scikit-image\u8fdb\u884c\u4e8c\u503c\u5316\u5904\u7406<\/h3>\n<\/p>\n<p><p>Scikit-image\u662f\u4e00\u4e2a\u57fa\u4e8eScipy\u6784\u5efa\u7684\u56fe\u50cf\u5904\u7406\u5e93\uff0c\u63d0\u4f9b\u4e86\u8bb8\u591a\u9ad8\u7ea7\u7684\u56fe\u50cf\u5904\u7406\u529f\u80fd\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5Scikit-image<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u4f60\u9700\u8981\u5b89\u88c5Scikit-image\u5e93\u3002\u5982\u679c\u4f60\u8fd8\u6ca1\u6709\u5b89\u88c5\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install scikit-image<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u8bfb\u53d6\u548c\u663e\u793a\u56fe\u50cf<\/h4>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u4f7f\u7528Scikit-image\u8bfb\u53d6\u548c\u663e\u793a\u56fe\u50cf\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from skimage import io, color<\/p>\n<p>import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u8bfb\u53d6\u56fe\u50cf<\/strong><\/h2>\n<p>image = io.imread(&#39;path_to_your_image.jpg&#39;)<\/p>\n<p>gray_image = color.rgb2gray(image)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u50cf<\/strong><\/h2>\n<p>plt.imshow(gray_image, cmap=&#39;gray&#39;)<\/p>\n<p>plt.title(&#39;Original Image&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u5e94\u7528\u4e8c\u503c\u5316\u5904\u7406<\/h4>\n<\/p>\n<p><p>\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528Scikit-image\u7684<code>threshold_otsu<\/code>\u65b9\u6cd5\u6765\u8ba1\u7b97\u5168\u5c40\u9608\u503c\uff0c\u7136\u540e\u4f7f\u7528\u8be5\u9608\u503c\u8fdb\u884c\u4e8c\u503c\u5316\u5904\u7406\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from skimage.filters import threshold_otsu<\/p>\n<h2><strong>\u8ba1\u7b97\u5168\u5c40\u9608\u503c<\/strong><\/h2>\n<p>thresh = threshold_otsu(gray_image)<\/p>\n<h2><strong>\u5e94\u7528\u4e8c\u503c\u5316\u5904\u7406<\/strong><\/h2>\n<p>binary_image = gray_image &gt; thresh<\/p>\n<h2><strong>\u663e\u793a\u4e8c\u503c\u5316\u56fe\u50cf<\/strong><\/h2>\n<p>plt.imshow(binary_image, cmap=&#39;gray&#39;)<\/p>\n<p>plt.title(&#39;Binary Image&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>threshold_otsu<\/code>\u65b9\u6cd5\u81ea\u52a8\u8ba1\u7b97\u4e00\u4e2a\u6700\u4f18\u7684\u5168\u5c40\u9608\u503c\uff0c\u7136\u540e\u6211\u4eec\u4f7f\u7528\u8be5\u9608\u503c\u5c06\u56fe\u50cf\u8fdb\u884c\u4e8c\u503c\u5316\u3002<\/p>\n<\/p>\n<p><h4>4. \u81ea\u9002\u5e94\u9608\u503c\u5904\u7406<\/h4>\n<\/p>\n<p><p>Scikit-image\u8fd8\u63d0\u4f9b\u4e86\u81ea\u9002\u5e94\u9608\u503c\u5904\u7406\u65b9\u6cd5\uff0c\u8fd9\u5728\u5904\u7406\u5149\u7167\u4e0d\u5747\u5300\u7684\u56fe\u50cf\u65f6\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from skimage.filters import threshold_local<\/p>\n<h2><strong>\u8ba1\u7b97\u5c40\u90e8\u9608\u503c<\/strong><\/h2>\n<p>block_size = 35<\/p>\n<p>local_thresh = threshold_local(gray_image, block_size, offset=10)<\/p>\n<h2><strong>\u5e94\u7528\u4e8c\u503c\u5316\u5904\u7406<\/strong><\/h2>\n<p>binary_local = gray_image &gt; local_thresh<\/p>\n<h2><strong>\u663e\u793a\u81ea\u9002\u5e94\u9608\u503c\u5904\u7406\u540e\u7684\u56fe\u50cf<\/strong><\/h2>\n<p>plt.imshow(binary_local, cmap=&#39;gray&#39;)<\/p>\n<p>plt.title(&#39;Adaptive Threshold Image&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>threshold_local<\/code>\u65b9\u6cd5\u8ba1\u7b97\u5c40\u90e8\u9608\u503c\uff0c\u5757\u5927\u5c0f\u4e3a35\uff0c\u504f\u79fb\u91cf\u4e3a10\u3002<\/p>\n<\/p>\n<p><h3>\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528Python\u5bf9\u56fe\u7247\u8fdb\u884c\u4e8c\u503c\u5316\u663e\u793a\u7684\u65b9\u6cd5\uff0c\u5305\u62ec\u4f7f\u7528OpenCV\u3001Pillow\u548cScikit-image\u5e93\u3002<strong>OpenCV\u9002\u5408\u5904\u7406\u590d\u6742\u7684\u56fe\u50cf\u5904\u7406\u4efb\u52a1\uff0cPillow\u9002\u5408\u7b80\u5355\u7684\u56fe\u50cf\u5904\u7406\uff0c\u800cScikit-image\u63d0\u4f9b\u4e86\u66f4\u591a\u7684\u56fe\u50cf\u5904\u7406\u7b97\u6cd5\u3002<\/strong> \u901a\u8fc7\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u4f60\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5de5\u5177\u6765\u8fdb\u884c\u56fe\u50cf\u4e8c\u503c\u5316\u5904\u7406\u3002\u65e0\u8bba\u4f60\u9009\u62e9\u54ea\u79cd\u65b9\u6cd5\uff0c\u4e86\u89e3\u6bcf\u79cd\u65b9\u6cd5\u7684\u4f18\u7f3a\u70b9\u548c\u9002\u7528\u573a\u666f\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u5e0c\u671b\u672c\u6587\u80fd\u591f\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u7406\u89e3\u548c\u5e94\u7528Python\u8fdb\u884c\u56fe\u50cf\u4e8c\u503c\u5316\u5904\u7406\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u4f7f\u7528Python\u8fdb\u884c\u56fe\u7247\u7684\u4e8c\u503c\u5316\u5904\u7406\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u56fe\u50cf\u5904\u7406\u5e93\u5982OpenCV\u548cPIL\uff08Pillow\uff09\u6765\u5b9e\u73b0\u56fe\u7247\u7684\u4e8c\u503c\u5316\u3002\u9996\u5148\u9700\u8981\u5b89\u88c5\u76f8\u5e94\u7684\u5e93\uff0c\u4f8b\u5982\u4f7f\u7528<code>pip install opencv-python<\/code>\u548c<code>pip install Pillow<\/code>\u3002\u63a5\u4e0b\u6765\uff0c\u8bfb\u53d6\u56fe\u7247\u540e\uff0c\u901a\u8fc7\u8bbe\u5b9a\u9608\u503c\u5c06\u56fe\u7247\u8f6c\u6362\u4e3a\u9ed1\u767d\u8272\uff0c\u901a\u5e38\u4f7f\u7528<code>cv2.threshold()<\/code>\u51fd\u6570\u6216<code>Image.convert(&#39;1&#39;)<\/code>\u65b9\u6cd5\u6765\u5b8c\u6210\u8fd9\u4e00\u64cd\u4f5c\u3002<\/p>\n<p><strong>\u4e8c\u503c\u5316\u5904\u7406\u7684\u5e94\u7528\u573a\u666f\u6709\u54ea\u4e9b\uff1f<\/strong><br \/>\u4e8c\u503c\u5316\u5904\u7406\u5728\u8bb8\u591a\u573a\u666f\u4e2d\u90fd\u975e\u5e38\u6709\u7528\uff0c\u4f8b\u5982\u5728\u6587\u6863\u56fe\u50cf\u5904\u7406\u3001\u8fb9\u7f18\u68c0\u6d4b\u548c\u7279\u5f81\u63d0\u53d6\u4e2d\u3002\u5b83\u53ef\u4ee5\u5e2e\u52a9\u63d0\u9ad8\u56fe\u50cf\u7684\u5bf9\u6bd4\u5ea6\uff0c\u4f7f\u5f97\u540e\u7eed\u7684\u56fe\u50cf\u5206\u6790\u548c\u673a\u5668\u5b66\u4e60\u4efb\u52a1\u53d8\u5f97\u66f4\u52a0\u5bb9\u6613\u548c\u9ad8\u6548\u3002\u6b64\u5916\uff0c\u4e8c\u503c\u5316\u5728OCR\uff08\u5149\u5b66\u5b57\u7b26\u8bc6\u522b\uff09\u548c\u56fe\u50cf\u538b\u7f29\u4e2d\u4e5f\u8d77\u7740\u5173\u952e\u4f5c\u7528\u3002<\/p>\n<p><strong>\u5728\u4e8c\u503c\u5316\u8fc7\u7a0b\u4e2d\uff0c\u5982\u4f55\u9009\u62e9\u5408\u9002\u7684\u9608\u503c\uff1f<\/strong><br \/>\u9009\u62e9\u5408\u9002\u7684\u9608\u503c\u5bf9\u4e8e\u4e8c\u503c\u5316\u7684\u6548\u679c\u81f3\u5173\u91cd\u8981\u3002\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u6cd5\u6765\u786e\u5b9a\u6700\u4f73\u9608\u503c\uff0c\u4f8b\u5982\u4f7f\u7528Otsu\u2019s\u65b9\u6cd5\uff0c\u8be5\u65b9\u6cd5\u80fd\u591f\u81ea\u52a8\u8ba1\u7b97\u51fa\u4e00\u4e2a\u5168\u5c40\u9608\u503c\uff0c\u6700\u5927\u5316\u7c7b\u95f4\u65b9\u5dee\uff0c\u4ece\u800c\u533a\u5206\u524d\u666f\u548c\u80cc\u666f\u3002\u4e5f\u53ef\u4ee5\u901a\u8fc7\u8bd5\u9a8c\u4e0d\u540c\u7684\u9608\u503c\u5e76\u67e5\u770b\u6548\u679c\u6765\u627e\u5230\u6700\u9002\u5408\u7279\u5b9a\u56fe\u50cf\u7684\u9608\u503c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u5bf9\u56fe\u7247\u8fdb\u884c\u4e8c\u503c\u5316\u663e\u793a\u7684\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528OpenCV\u3001PIL\u548cScikit-image\u5e93\u3002 \u5728\u8fd9\u4e09\u79cd\u65b9\u6cd5 [&hellip;]","protected":false},"author":3,"featured_media":1116895,"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\/1116884"}],"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=1116884"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1116884\/revisions"}],"predecessor-version":[{"id":1116896,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1116884\/revisions\/1116896"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1116895"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1116884"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1116884"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1116884"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}