{"id":977006,"date":"2024-12-27T06:26:01","date_gmt":"2024-12-26T22:26:01","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/977006.html"},"modified":"2024-12-27T06:26:04","modified_gmt":"2024-12-26T22:26:04","slug":"python%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0%e9%98%88%e5%80%bc%e5%88%86%e5%89%b2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/977006.html","title":{"rendered":"python\u5982\u4f55\u5b9e\u73b0\u9608\u503c\u5206\u5272"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24202433\/0cd68399-cf37-4959-a807-199e377d913f.webp\" alt=\"python\u5982\u4f55\u5b9e\u73b0\u9608\u503c\u5206\u5272\" \/><\/p>\n<p><p> \u5f00\u5934\u6bb5\u843d:<br \/><strong>Python\u5b9e\u73b0\u9608\u503c\u5206\u5272\u7684\u65b9\u6cd5\u4e3b\u8981\u5305\u62ec\uff1a\u624b\u52a8\u8bbe\u5b9a\u9608\u503c\u3001\u81ea\u52a8\u9608\u503c\u7b97\u6cd5\uff08\u5982\u5927\u6d25\u7b97\u6cd5\uff09\u3001\u81ea\u9002\u5e94\u9608\u503c\u65b9\u6cd5\u3002<\/strong> \u9608\u503c\u5206\u5272\u662f\u4e00\u79cd\u7b80\u5355\u800c\u6709\u6548\u7684\u56fe\u50cf\u5904\u7406\u6280\u672f\uff0c\u5b83\u901a\u8fc7\u5c06\u56fe\u50cf\u50cf\u7d20\u503c\u4e0e\u8bbe\u5b9a\u7684\u9608\u503c\u8fdb\u884c\u6bd4\u8f83\uff0c\u5c06\u56fe\u50cf\u5206\u4e3a\u524d\u666f\u548c\u80cc\u666f\u3002\u624b\u52a8\u8bbe\u5b9a\u9608\u503c\u662f\u6700\u76f4\u89c2\u7684\u65b9\u6cd5\uff0c\u4f46\u9700\u8981\u7528\u6237\u5177\u5907\u4e00\u5b9a\u7684\u4e13\u4e1a\u77e5\u8bc6\u3002\u81ea\u52a8\u9608\u503c\u7b97\u6cd5\uff0c\u5982\u5927\u6d25\u7b97\u6cd5\uff0c\u53ef\u4ee5\u6839\u636e\u56fe\u50cf\u7684\u7070\u5ea6\u76f4\u65b9\u56fe\u81ea\u52a8\u9009\u62e9\u6700\u4f73\u9608\u503c\uff0c\u81ea\u9002\u5e94\u9608\u503c\u65b9\u6cd5\u5219\u6839\u636e\u56fe\u50cf\u7684\u5c40\u90e8\u7279\u5f81\u8c03\u6574\u9608\u503c\uff0c\u9002\u7528\u4e8e\u5149\u7167\u4e0d\u5747\u5300\u7684\u56fe\u50cf\u3002\u5176\u4e2d\uff0c\u5927\u6d25\u7b97\u6cd5\u88ab\u5e7f\u6cdb\u5e94\u7528\uff0c\u56e0\u4e3a\u5176\u5728\u5904\u7406\u5168\u5c40\u5bf9\u6bd4\u5ea6\u5dee\u5f02\u8f83\u5927\u7684\u56fe\u50cf\u65f6\uff0c\u8868\u73b0\u51fa\u8272\u3002<\/p>\n<\/p>\n<p><p>\u6b63\u6587\uff1a  <\/p>\n<\/p>\n<p><p>\u4e00\u3001\u624b\u52a8\u8bbe\u5b9a\u9608\u503c<\/p>\n<\/p>\n<p><p>\u624b\u52a8\u8bbe\u5b9a\u9608\u503c\u662f\u9608\u503c\u5206\u5272\u4e2d\u6700\u57fa\u7840\u7684\u65b9\u6cd5\u3002\u7528\u6237\u6839\u636e\u56fe\u50cf\u7684\u76f4\u65b9\u56fe\u6216\u7ecf\u9a8c\uff0c\u9009\u62e9\u4e00\u4e2a\u5408\u9002\u7684\u9608\u503c\uff0c\u5c06\u50cf\u7d20\u503c\u9ad8\u4e8e\u8be5\u9608\u503c\u7684\u90e8\u5206\u8bbe\u4e3a\u524d\u666f\uff0c\u4f4e\u4e8e\u8be5\u9608\u503c\u7684\u90e8\u5206\u8bbe\u4e3a\u80cc\u666f\u3002\u8fd9\u79cd\u65b9\u6cd5\u7b80\u5355\u76f4\u63a5\uff0c\u4f46\u9700\u8981\u7528\u6237\u5bf9\u56fe\u50cf\u5185\u5bb9\u6709\u4e00\u5b9a\u7684\u7406\u89e3\u3002<\/p>\n<\/p>\n<p><p>\u624b\u52a8\u8bbe\u5b9a\u9608\u503c\u5728\u5b9e\u73b0\u4e0a\u975e\u5e38\u7b80\u5355\uff0c\u901a\u5e38\u4f7f\u7528Python\u4e2d\u7684OpenCV\u5e93\u6765\u5b8c\u6210\u3002\u4ee3\u7801\u793a\u4f8b\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import cv2<\/p>\n<h2><strong>\u8bfb\u53d6\u56fe\u50cf<\/strong><\/h2>\n<p>image = cv2.imread(&#39;image.jpg&#39;, 0)<\/p>\n<h2><strong>\u624b\u52a8\u8bbe\u5b9a\u9608\u503c<\/strong><\/h2>\n<p>threshold_value = 127<\/p>\n<p>_, thresholded_image = cv2.threshold(image, threshold_value, 255, cv2.THRESH_BINARY)<\/p>\n<h2><strong>\u663e\u793a\u7ed3\u679c<\/strong><\/h2>\n<p>cv2.imshow(&#39;Thresholded Image&#39;, thresholded_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><p>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u8bfb\u53d6\u56fe\u50cf\uff0c\u7136\u540e\u4f7f\u7528<code>cv2.threshold<\/code>\u51fd\u6570\u8fdb\u884c\u9608\u503c\u5206\u5272\u3002<code>threshold_value<\/code>\u662f\u6211\u4eec\u624b\u52a8\u8bbe\u5b9a\u7684\u9608\u503c\uff0c\u50cf\u7d20\u503c\u9ad8\u4e8e\u8be5\u9608\u503c\u7684\u90e8\u5206\u88ab\u8bbe\u4e3a255\uff08\u767d\u8272\uff09\uff0c\u4f4e\u4e8e\u8be5\u9608\u503c\u7684\u90e8\u5206\u88ab\u8bbe\u4e3a0\uff08\u9ed1\u8272\uff09\u3002\u8fd9\u79cd\u65b9\u6cd5\u7b80\u5355\u6613\u7528\uff0c\u4f46\u5bf9\u56fe\u50cf\u8d28\u91cf\u548c\u5bf9\u6bd4\u5ea6\u7684\u8981\u6c42\u8f83\u9ad8\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u81ea\u52a8\u9608\u503c\u7b97\u6cd5<\/p>\n<\/p>\n<p><p>\u81ea\u52a8\u9608\u503c\u7b97\u6cd5\u901a\u8fc7\u5206\u6790\u56fe\u50cf\u7684\u7070\u5ea6\u76f4\u65b9\u56fe\uff0c\u81ea\u52a8\u786e\u5b9a\u6700\u4f73\u7684\u9608\u503c\u3002\u5927\u6d25\u7b97\u6cd5\u662f\u5176\u4e2d\u6700\u5e38\u7528\u7684\u4e00\u79cd\u3002\u5b83\u901a\u8fc7\u6700\u5927\u5316\u7c7b\u95f4\u65b9\u5dee\uff0c\u786e\u5b9a\u4e00\u4e2a\u9608\u503c\uff0c\u4f7f\u5f97\u524d\u666f\u548c\u80cc\u666f\u4e4b\u95f4\u7684\u5bf9\u6bd4\u6700\u5927\u5316\u3002<\/p>\n<\/p>\n<p><p>\u5927\u6d25\u7b97\u6cd5\u7684\u5b9e\u73b0\u901a\u5e38\u4f7f\u7528OpenCV\u4e2d\u7684<code>cv2.threshold<\/code>\u51fd\u6570\uff0c\u4ee3\u7801\u793a\u4f8b\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import cv2<\/p>\n<h2><strong>\u8bfb\u53d6\u56fe\u50cf<\/strong><\/h2>\n<p>image = cv2.imread(&#39;image.jpg&#39;, 0)<\/p>\n<h2><strong>\u4f7f\u7528\u5927\u6d25\u7b97\u6cd5\u81ea\u52a8\u8ba1\u7b97\u9608\u503c<\/strong><\/h2>\n<p>_, thresholded_image = cv2.threshold(image, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)<\/p>\n<h2><strong>\u663e\u793a\u7ed3\u679c<\/strong><\/h2>\n<p>cv2.imshow(&#39;Otsu Thresholded Image&#39;, thresholded_image)<\/p>\n<p>cv2.waitKey(0)<\/p>\n<p>cv2.destroyAllWindows()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u6bb5\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u6ca1\u6709\u624b\u52a8\u8bbe\u7f6e\u9608\u503c\uff0c\u800c\u662f\u5c06\u5176\u8bbe\u4e3a0\uff0c\u5e76\u4f7f\u7528<code>cv2.THRESH_OTSU<\/code>\u6807\u5fd7\uff0c\u8ba9OpenCV\u81ea\u52a8\u8ba1\u7b97\u51fa\u4e00\u4e2a\u6700\u4f73\u9608\u503c\u3002\u8fd9\u79cd\u65b9\u6cd5\u9002\u7528\u4e8e\u5927\u591a\u6570\u56fe\u50cf\uff0c\u5c24\u5176\u662f\u5f53\u56fe\u50cf\u7684\u5bf9\u6bd4\u5ea6\u4e0d\u660e\u663e\u65f6\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u5206\u5272\u524d\u666f\u548c\u80cc\u666f\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u81ea\u9002\u5e94\u9608\u503c\u65b9\u6cd5<\/p>\n<\/p>\n<p><p>\u81ea\u9002\u5e94\u9608\u503c\u65b9\u6cd5\u6839\u636e\u56fe\u50cf\u7684\u5c40\u90e8\u7279\u5f81\u52a8\u6001\u8c03\u6574\u9608\u503c\uff0c\u9002\u7528\u4e8e\u5149\u7167\u4e0d\u5747\u5300\u7684\u573a\u666f\u3002\u81ea\u9002\u5e94\u9608\u503c\u65b9\u6cd5\u5e38\u7528\u7684\u6709\u5e73\u5747\u52a0\u6743\u6cd5\u548c\u9ad8\u65af\u52a0\u6743\u6cd5\u3002<\/p>\n<\/p>\n<p><p>\u5728OpenCV\u4e2d\uff0c\u81ea\u9002\u5e94\u9608\u503c\u65b9\u6cd5\u7684\u5b9e\u73b0\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import cv2<\/p>\n<h2><strong>\u8bfb\u53d6\u56fe\u50cf<\/strong><\/h2>\n<p>image = cv2.imread(&#39;image.jpg&#39;, 0)<\/p>\n<h2><strong>\u4f7f\u7528\u81ea\u9002\u5e94\u9608\u503c<\/strong><\/h2>\n<p>adaptive_thresholded_image = cv2.adaptiveThreshold(image, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C,<\/p>\n<p>                                                   cv2.THRESH_BINARY, 11, 2)<\/p>\n<h2><strong>\u663e\u793a\u7ed3\u679c<\/strong><\/h2>\n<p>cv2.imshow(&#39;Adaptive Thresholded Image&#39;, adaptive_thresholded_image)<\/p>\n<p>cv2.waitKey(0)<\/p>\n<p>cv2.destroyAllWindows()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u4f7f\u7528\u4e86<code>cv2.adaptiveThreshold<\/code>\u51fd\u6570\u3002<code>cv2.ADAPTIVE_THRESH_GAUSSIAN_C<\/code>\u8868\u793a\u4f7f\u7528\u9ad8\u65af\u52a0\u6743\u65b9\u6cd5\uff0c<code>11<\/code>\u662f\u90bb\u57df\u5927\u5c0f\uff0c<code>2<\/code>\u662f\u5e38\u6570C\uff0c\u7528\u4e8e\u8c03\u6574\u9608\u503c\u3002\u8fd9\u79cd\u65b9\u6cd5\u5728\u5904\u7406\u6709\u9634\u5f71\u6216\u5149\u7167\u53d8\u5316\u7684\u56fe\u50cf\u65f6\u975e\u5e38\u6709\u6548\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u7efc\u5408\u6bd4\u8f83<\/p>\n<\/p>\n<p><p>\u5728\u9009\u62e9\u9608\u503c\u5206\u5272\u65b9\u6cd5\u65f6\uff0c\u9700\u8981\u8003\u8651\u56fe\u50cf\u7684\u5177\u4f53\u7279\u5f81\u548c\u5e94\u7528\u573a\u666f\u3002\u624b\u52a8\u8bbe\u5b9a\u9608\u503c\u7b80\u5355\u76f4\u89c2\uff0c\u4f46\u5bf9\u7528\u6237\u7ecf\u9a8c\u8981\u6c42\u8f83\u9ad8\uff1b<strong>\u81ea\u52a8\u9608\u503c\u7b97\u6cd5\u9002\u7528\u4e8e\u5927\u591a\u6570\u60c5\u51b5\uff0c\u7279\u522b\u662f\u5927\u6d25\u7b97\u6cd5<\/strong>\uff0c\u56e0\u5176\u7a33\u5b9a\u6027\u800c\u88ab\u5e7f\u6cdb\u5e94\u7528\uff1b\u81ea\u9002\u5e94\u9608\u503c\u65b9\u6cd5\u5219\u5728\u5149\u7167\u4e0d\u5747\u5300\u7684\u73af\u5883\u4e0b\u8868\u73b0\u66f4\u597d\u3002<\/p>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u53ef\u4ee5\u6839\u636e\u9700\u8981\u9009\u62e9\u4e0d\u540c\u7684\u65b9\u6cd5\uff0c\u6216\u8005\u7ed3\u5408\u591a\u79cd\u65b9\u6cd5\uff0c\u4ee5\u83b7\u5f97\u6700\u4f73\u7684\u5206\u5272\u6548\u679c\u3002\u6bd4\u5982\uff0c\u53ef\u4ee5\u5148\u7528\u5927\u6d25\u7b97\u6cd5\u8fdb\u884c\u521d\u6b65\u5206\u5272\uff0c\u518d\u4f7f\u7528\u81ea\u9002\u5e94\u9608\u503c\u65b9\u6cd5\u8fdb\u884c\u7ec6\u5316\u5904\u7406\uff0c\u4ece\u800c\u5f97\u5230\u66f4\u7cbe\u786e\u7684\u7ed3\u679c\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001\u5e94\u7528\u6848\u4f8b<\/p>\n<\/p>\n<p><p>\u9608\u503c\u5206\u5272\u6280\u672f\u5728\u8bb8\u591a\u9886\u57df\u90fd\u6709\u5e7f\u6cdb\u5e94\u7528\uff0c\u5982\u533b\u5b66\u56fe\u50cf\u5904\u7406\u3001\u8f66\u724c\u8bc6\u522b\u3001\u6587\u672c\u63d0\u53d6\u7b49\u3002\u5728\u533b\u5b66\u56fe\u50cf\u5904\u7406\u4e2d\uff0c\u9608\u503c\u5206\u5272\u53ef\u4ee5\u7528\u4e8e\u5206\u79bb\u80bf\u7624\u548c\u6b63\u5e38\u7ec4\u7ec7\u3002\u5728\u8f66\u724c\u8bc6\u522b\u4e2d\uff0c\u9608\u503c\u5206\u5272\u7528\u4e8e\u63d0\u53d6\u8f66\u724c\u533a\u57df\u3002\u800c\u5728\u6587\u672c\u63d0\u53d6\u4e2d\uff0c\u9608\u503c\u5206\u5272\u53ef\u4ee5\u7528\u4e8e\u4ece\u626b\u63cf\u6587\u6863\u4e2d\u63d0\u53d6\u6587\u672c\u3002<\/p>\n<\/p>\n<p><p>\u5728\u8fd9\u4e9b\u5e94\u7528\u4e2d\uff0c\u9009\u62e9\u5408\u9002\u7684\u9608\u503c\u5206\u5272\u65b9\u6cd5\u5c24\u4e3a\u91cd\u8981\u3002\u901a\u5e38\uff0c\u7ed3\u5408\u56fe\u50cf\u7684\u7279\u5f81\u548c\u5e94\u7528\u7684\u5177\u4f53\u9700\u6c42\uff0c\u53ef\u4ee5\u9009\u62e9\u6700\u5408\u9002\u7684\u65b9\u6cd5\uff0c\u63d0\u9ad8\u5206\u5272\u7684\u51c6\u786e\u6027\u548c\u6548\u7387\u3002<\/p>\n<\/p>\n<p><p>\u516d\u3001Python\u5b9e\u73b0\u7ec6\u8282<\/p>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0cOpenCV\u662f\u5b9e\u73b0\u56fe\u50cf\u5904\u7406\u7684\u5e38\u7528\u5e93\u4e4b\u4e00\u3002\u9664\u4e86OpenCV\u4e4b\u5916\uff0cNumPy\u5e93\u4e5f\u7ecf\u5e38\u7528\u4e8e\u5904\u7406\u56fe\u50cf\u6570\u636e\u3002\u5728\u5b9e\u73b0\u9608\u503c\u5206\u5272\u65f6\uff0c\u9996\u5148\u9700\u8981\u5c06\u56fe\u50cf\u6570\u636e\u8bfb\u53d6\u4e3aNumPy\u6570\u7ec4\uff0c\u7136\u540e\u5229\u7528OpenCV\u7684\u76f8\u5173\u51fd\u6570\u8fdb\u884c\u5206\u5272\u3002<\/p>\n<\/p>\n<p><p>\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5728\u8fdb\u884c\u9608\u503c\u5206\u5272\u524d\uff0c\u6700\u597d\u5bf9\u56fe\u50cf\u8fdb\u884c\u9884\u5904\u7406\uff0c\u5982\u53bb\u566a\u3001\u589e\u5f3a\u5bf9\u6bd4\u5ea6\u7b49\uff0c\u4ee5\u63d0\u9ad8\u5206\u5272\u6548\u679c\u3002\u6b64\u5916\uff0c\u4e0d\u540c\u7684\u56fe\u50cf\u683c\u5f0f\u53ef\u80fd\u4f1a\u5f71\u54cd\u5206\u5272\u7ed3\u679c\uff0c\u56e0\u6b64\u5728\u8bfb\u53d6\u548c\u5904\u7406\u56fe\u50cf\u65f6\uff0c\u9700\u8981\u6ce8\u610f\u56fe\u50cf\u683c\u5f0f\u7684\u8f6c\u6362\u548c\u517c\u5bb9\u6027\u3002<\/p>\n<\/p>\n<p><p>\u4e03\u3001\u603b\u7ed3\u4e0e\u5c55\u671b<\/p>\n<\/p>\n<p><p>\u9608\u503c\u5206\u5272\u662f\u4e00\u79cd\u7b80\u5355\u800c\u6709\u6548\u7684\u56fe\u50cf\u5904\u7406\u6280\u672f\u3002\u901a\u8fc7\u5408\u7406\u9009\u62e9\u9608\u503c\u548c\u5206\u5272\u65b9\u6cd5\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u63d0\u53d6\u56fe\u50cf\u4e2d\u7684\u76ee\u6807\u5bf9\u8c61\u3002\u968f\u7740\u56fe\u50cf\u5904\u7406\u6280\u672f\u7684\u53d1\u5c55\uff0c\u9608\u503c\u5206\u5272\u65b9\u6cd5\u4e5f\u5728\u4e0d\u65ad\u6539\u8fdb\u548c\u521b\u65b0\u3002\u672a\u6765\uff0c\u53ef\u4ee5\u9884\u89c1\uff0c\u7ed3\u5408\u6df1\u5ea6\u5b66\u4e60\u548c<a href=\"https:\/\/docs.pingcode.com\/tag\/AI\" target=\"_blank\">\u4eba\u5de5\u667a\u80fd<\/a>\u6280\u672f\uff0c\u9608\u503c\u5206\u5272\u5c06\u4f1a\u53d8\u5f97\u66f4\u52a0\u667a\u80fd\u5316\u548c\u81ea\u52a8\u5316\uff0c\u4e3a\u5404\u884c\u5404\u4e1a\u63d0\u4f9b\u66f4\u591a\u7684\u652f\u6301\u548c\u53ef\u80fd\u6027\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u9009\u62e9\u5408\u9002\u7684\u9608\u503c\u8fdb\u884c\u5206\u5272\uff1f<\/strong><br \/>\u9009\u62e9\u5408\u9002\u7684\u9608\u503c\u5bf9\u4e8e\u56fe\u50cf\u5206\u5272\u7684\u6548\u679c\u81f3\u5173\u91cd\u8981\u3002\u53ef\u4ee5\u901a\u8fc7\u76f4\u65b9\u56fe\u5206\u6790\u89c2\u5bdf\u56fe\u50cf\u7684\u7070\u5ea6\u5206\u5e03\uff0c\u5e76\u6839\u636e\u5206\u5e03\u7684\u5cf0\u503c\u6765\u786e\u5b9a\u521d\u6b65\u9608\u503c\u3002\u6b64\u5916\uff0c\u53ef\u4ee5\u5c1d\u8bd5Otsu\u65b9\u6cd5\uff0c\u8be5\u65b9\u6cd5\u81ea\u52a8\u8ba1\u7b97\u6700\u4f73\u9608\u503c\uff0c\u4ee5\u6700\u5927\u5316\u7c7b\u95f4\u65b9\u5dee\uff0c\u4ece\u800c\u63d0\u9ad8\u5206\u5272\u6548\u679c\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u4f7f\u7528\u54ea\u4e9b\u5e93\u6765\u5b9e\u73b0\u9608\u503c\u5206\u5272\uff1f<\/strong><br \/>Python\u4e2d\u6709\u591a\u4e2a\u5f3a\u5927\u7684\u5e93\u53ef\u7528\u4e8e\u5b9e\u73b0\u9608\u503c\u5206\u5272\uff0c\u5176\u4e2d\u6700\u5e38\u7528\u7684\u662fOpenCV\u548cScikit-image\u3002OpenCV\u63d0\u4f9b\u4e86\u591a\u79cd\u9608\u503c\u5206\u5272\u65b9\u6cd5\uff0c\u5982\u7b80\u5355\u9608\u503c\u3001OTSU\u548c\u81ea\u9002\u5e94\u9608\u503c\u3002Scikit-image\u540c\u6837\u4e5f\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u56fe\u50cf\u5904\u7406\u529f\u80fd\uff0c\u9002\u5408\u8fdb\u884c\u66f4\u590d\u6742\u7684\u56fe\u50cf\u5206\u5272\u64cd\u4f5c\u3002<\/p>\n<p><strong>\u9608\u503c\u5206\u5272\u7684\u5e94\u7528\u573a\u666f\u6709\u54ea\u4e9b\uff1f<\/strong><br \/>\u9608\u503c\u5206\u5272\u5e7f\u6cdb\u5e94\u7528\u4e8e\u533b\u5b66\u56fe\u50cf\u5904\u7406\u3001\u7269\u4f53\u68c0\u6d4b\u3001\u56fe\u50cf\u5206\u6790\u7b49\u9886\u57df\u3002\u4f8b\u5982\uff0c\u5728\u533b\u5b66\u56fe\u50cf\u4e2d\uff0c\u53ef\u4ee5\u7528\u6765\u63d0\u53d6\u80bf\u7624\u533a\u57df\uff1b\u5728\u5de5\u4e1a\u68c0\u6d4b\u4e2d\uff0c\u53ef\u4ee5\u7528\u4e8e\u68c0\u6d4b\u4ea7\u54c1\u7f3a\u9677\u3002\u9608\u503c\u5206\u5272\u65b9\u6cd5\u7b80\u5355\u4e14\u9ad8\u6548\uff0c\u9002\u5408\u5904\u7406\u5bf9\u6bd4\u5ea6\u660e\u663e\u7684\u56fe\u50cf\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5f00\u5934\u6bb5\u843d:Python\u5b9e\u73b0\u9608\u503c\u5206\u5272\u7684\u65b9\u6cd5\u4e3b\u8981\u5305\u62ec\uff1a\u624b\u52a8\u8bbe\u5b9a\u9608\u503c\u3001\u81ea\u52a8\u9608\u503c\u7b97\u6cd5\uff08\u5982\u5927\u6d25\u7b97\u6cd5\uff09\u3001\u81ea\u9002\u5e94\u9608\u503c\u65b9\u6cd5\u3002 [&hellip;]","protected":false},"author":3,"featured_media":977012,"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\/977006"}],"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=977006"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/977006\/revisions"}],"predecessor-version":[{"id":977017,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/977006\/revisions\/977017"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/977012"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=977006"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=977006"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=977006"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}