{"id":65233,"date":"2026-01-24T17:25:02","date_gmt":"2026-01-24T09:25:02","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/65233.html"},"modified":"2026-01-24T17:25:02","modified_gmt":"2026-01-24T09:25:02","slug":"%e5%b0%8f%e7%99%bd%e4%bb%8e%e9%9b%b6%e5%bc%80%e5%a7%8b%e5%8b%87%e9%97%af%e4%ba%ba%e5%b7%a5%e6%99%ba%e8%83%bd%ef%bc%9a%e8%ae%a1%e7%ae%97%e6%9c%ba%e8%a7%86%e8%a7%89%e5%88%9d%e7%ba%a7%e7%af%87%ef%bc%88","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/65233.html","title":{"rendered":"\u5c0f\u767d\u4ece\u96f6\u5f00\u59cb\u52c7\u95ef\u4eba\u5de5\u667a\u80fd\uff1a\u8ba1\u7b97\u673a\u89c6\u89c9\u521d\u7ea7\u7bc7\uff08\u521d\u8bc6Opencv\u4e0b\uff09"},"content":{"rendered":"<h2>\u5f15\u8a00<\/h2>\n<p>\u00a0\u00a0\u5728\u8ba1\u7b97\u673a\u89c6\u89c9\u4e2d&#xff0c;\u8f6e\u5ed3\u68c0\u6d4b\u4e0e\u6a21\u677f\u5339\u914d\u662f\u4e24\u9879\u57fa\u7840\u7684\u56fe\u50cf\u5206\u6790\u6280\u672f\u3002\u8f6e\u5ed3\u68c0\u6d4b\u901a\u8fc7\u63d0\u53d6\u76ee\u6807\u7684\u5f62\u72b6\u8fb9\u754c&#xff0c;\u5c06\u56fe\u50cf\u7b80\u5316\u4e3a\u51e0\u4f55\u8f6e\u5ed3&#xff0c;\u662f\u5b9e\u73b0\u7269\u4f53\u5f62\u72b6\u5206\u6790\u3001\u5c3a\u5bf8\u6d4b\u91cf\u7684\u5173\u952e\u6b65\u9aa4\u3002\u6a21\u677f\u5339\u914d\u5219\u901a\u8fc7\u5728\u56fe\u50cf\u4e2d\u6ed1\u52a8\u5df2\u77e5\u6a21\u677f\u8fdb\u884c\u6bd4\u5bf9&#xff0c;\u76f4\u63a5\u5b9a\u4f4d\u7279\u5b9a\u76ee\u6807&#xff0c;\u9002\u7528\u4e8e\u5143\u4ef6\u5b9a\u4f4d\u3001\u56fa\u5b9a\u56fe\u6848\u8bc6\u522b\u7b49\u4efb\u52a1\u3002\u5b83\u4eec\u5e38\u534f\u540c\u5de5\u4f5c&#xff0c;\u5982\u7528\u8f6e\u5ed3\u5feb\u901f\u7b5b\u9009\u533a\u57df&#xff0c;\u518d\u7528\u6a21\u677f\u7cbe\u786e\u5339\u914d&#xff0c;\u5171\u540c\u4e3a\u66f4\u590d\u6742\u7684\u89c6\u89c9\u4efb\u52a1\u63d0\u4f9b\u53ef\u9760\u652f\u6301\u3002\u63a5\u4e0b\u6765\u5c31\u8ba9\u6211\u4eec\u4e00\u8d77\u5b66\u4e60\u8fd9\u4e24\u6837\u6280\u672f\u3002<\/p>\n<h3>\u4e00\u3001\u8f6e\u5ed3\u68c0\u6d4b&#xff1a;\u56fe\u50cf\u7684\u201c\u63cf\u8fb9\u201d\u827a\u672f<\/h3>\n<h4>1\u3001\u4ec0\u4e48\u662f\u8f6e\u5ed3\u68c0\u6d4b&#xff1f;<\/h4>\n<p>\u00a0\u00a0\u00a0\u8f6e\u5ed3\u68c0\u6d4b\u7684\u6838\u5fc3\u76ee\u6807\u662f\u4ece\u6570\u5b57\u56fe\u50cf\u4e2d\u8bc6\u522b\u5e76\u63d0\u53d6\u51fa\u5176\u4e2d\u7269\u4f53\u6216\u533a\u57df\u7684\u8fb9\u754c\u7ebf\u3002\u5176\u76ee\u7684\u662f\u627e\u51fa\u8fde\u7eed\u4e14\u901a\u5e38\u95ed\u5408\u7684\u8f6e\u5ed3\u66f2\u7ebf&#xff0c;\u4ece\u800c\u52fe\u52d2\u51fa\u7269\u4f53\u7684\u5b8c\u6574\u5916\u90e8\u5f62\u72b6\u6216\u5185\u90e8\u7ed3\u6784\u8fb9\u754c\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u7c7b\u4f3c\u4e8e\u4e3a\u56fe\u50cf\u4e2d\u611f\u5174\u8da3\u7684\u7269\u4f53\u8fdb\u884c\u201c\u63cf\u8fb9\u201d\u6216\u201c\u52fe\u52d2\u5916\u5f62\u201d&#xff0c;\u5176\u7ed3\u679c\u662f\u7531\u4e00\u7cfb\u5217\u8fde\u7eed\u70b9\u6784\u6210\u7684\u3001\u53ef\u7528\u4e8e\u8fdb\u4e00\u6b65\u5206\u6790\u7684\u5c01\u95ed\u6216\u5f00\u653e\u8f6e\u5ed3\u96c6\u5408\u3002\u5b83\u4f7f\u7a0b\u5e8f\u80fd\u591f\u5bf9\u56fe\u50cf\u4e2d\u7684\u76ee\u6807\u8fdb\u884c\u5b9a\u4f4d\u3001\u6d4b\u91cf\u548c\u5206\u79bb\u64cd\u4f5c\u3002\u5728OpenCV\u7b49\u5e38\u7528\u5e93\u4e2d&#xff0c;\u901a\u5e38\u901a\u8fc7cv2.findContours()\u7b49\u6838\u5fc3\u51fd\u6570\u6765\u5b9e\u73b0\u8fd9\u4e00\u529f\u80fd\u3002<\/p>\n<p>image, contours, hierarchy &#061; cv2.findContours(img, mode, method)<br \/>\n\u53c2\u6570&#xff1a;<br \/>\nimg&#xff1a;\u8f93\u5165\u56fe\u50cf&#xff0c;\u5fc5\u987b\u662f\u4e8c\u503c\u56fe\u50cf&#xff08;\u53ea\u67090\u548c255\u4e24\u79cd\u50cf\u7d20\u503c&#xff09;\u3002<\/p>\n<p>mode&#xff1a;\u8f6e\u5ed3\u68c0\u7d22\u6a21\u5f0f&#xff0c;\u5e38\u7528\u6709\u4ee5\u4e0b\u51e0\u79cd&#xff1a;<\/p>\n<p>cv2.RETR_EXTERNAL&#xff1a;\u53ea\u68c0\u6d4b\u6700\u5916\u5c42\u8f6e\u5ed3<\/p>\n<p>cv2.RETR_TREE&#xff1a;\u68c0\u6d4b\u6240\u6709\u8f6e\u5ed3\u5e76\u5efa\u7acb\u5b8c\u6574\u7684\u5c42\u6b21\u7ed3\u6784&#xff08;\u6700\u5e38\u7528&#xff09;<\/p>\n<p>method&#xff1a;\u8f6e\u5ed3\u8fd1\u4f3c\u65b9\u6cd5&#xff1a;<\/p>\n<p>cv2.CHAIN_APPROX_NONE&#xff1a;\u4fdd\u5b58\u8f6e\u5ed3\u4e0a\u6240\u6709\u70b9<\/p>\n<p>cv2.CHAIN_APPROX_SIMPLE&#xff1a;\u53ea\u4fdd\u5b58\u8f6e\u5ed3\u7684\u62d0\u70b9&#xff08;\u5982\u77e9\u5f62\u53ea\u4fdd\u5b584\u4e2a\u9876\u70b9&#xff09;<\/p>\n<p>\u8fd4\u56de\u503c&#xff1a;<br \/>\nimage&#xff1a;\u5904\u7406\u540e\u7684\u56fe\u50cf<\/p>\n<p>contours&#xff1a;\u68c0\u6d4b\u5230\u7684\u8f6e\u5ed3\u5217\u8868&#xff0c;\u6bcf\u4e2a\u8f6e\u5ed3\u7531\u4e00\u7cfb\u5217\u70b9\u7ec4\u6210<\/p>\n<p>hierarchy&#xff1a;\u8f6e\u5ed3\u7684\u5c42\u6b21\u5173\u7cfb\u4fe1\u606f<\/p>\n<h4>2\u3001\u56fe\u50cf\u9884\u5904\u7406<\/h4>\n<p>\u00a0\u00a0\u5728\u8fdb\u884c\u8f6e\u5ed3\u68c0\u6d4b\u4e4b\u524d&#xff0c;\u56fe\u50cf\u5fc5\u987b\u7ecf\u8fc7\u9884\u5904\u7406\u8f6c\u6362\u4e3a\u4e8c\u503c\u56fe\u50cf&#xff0c;\u8fd9\u662f\u56e0\u4e3a\u8f6e\u5ed3\u68c0\u6d4b\u7b97\u6cd5\u9700\u8981\u660e\u786e\u533a\u5206\u524d\u666f\u76ee\u6807\u4e0e\u80cc\u666f\u3002\u5904\u7406\u6d41\u7a0b\u5305\u542b\u4e09\u4e2a\u5173\u952e\u6b65\u9aa4&#xff1a;\u9996\u5148&#xff0c;\u4f7f\u7528cv2.imread()\u51fd\u6570\u8bfb\u53d6\u539f\u59cb\u5f69\u8272\u56fe\u50cf&#xff0c;\u63a5\u7740&#xff0c;\u901a\u8fc7cv2.cvtColor()\u51fd\u6570\u5e76\u5c06\u8f6c\u6362\u4ee3\u7801\u8bbe\u4e3aCOLOR_BGR2GRAY&#xff0c;\u5c06\u5f69\u8272\u56fe\u50cf\u8f6c\u6362\u4e3a\u7070\u5ea6\u56fe\u50cf&#xff0c;\u8fd9\u91cc\u6d88\u9664\u4e86\u989c\u8272\u4fe1\u606f&#xff0c;\u5c06\u4e09\u7ef4\u7684\u50cf\u7d20\u77e9\u9635\u7b80\u5316\u4e3a\u4ec5\u5305\u542b\u4eae\u5ea6\u4fe1\u606f\u7684\u4e8c\u7ef4\u77e9\u9635&#xff0c;\u6700\u540e&#xff0c;\u7528cv2.threshold()\u51fd\u6570\u5bf9\u7070\u5ea6\u56fe\u8fdb\u884c\u4e8c\u503c\u5316\u64cd\u4f5c&#xff0c;\u901a\u8fc7\u8bbe\u5b9a\u4e00\u4e2a\u9608\u503c&#xff08;\u4f8b\u5982\u4f8b\u5b50\u4e2d\u7684120&#xff09;&#xff0c;\u5c06\u7070\u5ea6\u56fe\u4e2d\u6240\u6709\u4f4e\u4e8e\u6b64\u9608\u503c\u7684\u50cf\u7d20\u70b9\u7f6e\u4e3a0&#xff08;\u9ed1\u8272&#xff09;&#xff0c;\u9ad8\u4e8e\u6216\u7b49\u4e8e\u9608\u503c\u7684\u50cf\u7d20\u70b9\u7f6e\u4e3a255&#xff08;\u767d\u8272&#xff09;&#xff0c;\u4ece\u800c\u751f\u6210\u4e00\u4e2a\u9ed1\u767d\u5206\u660e\u3001\u53ea\u6709\u524d\u666f\u548c\u80cc\u666f\u7684\u4e24\u503c\u56fe\u50cf\u4e3a\u540e\u7eed\u51c6\u786e\u7684\u8f6e\u5ed3\u67e5\u627e\u5960\u5b9a\u57fa\u7840\u3002<\/p>\n<p>import cv2<\/p>\n<p># \u8bfb\u53d6\u56fe\u50cf<br \/>\nphone &#061; cv2.imread(&#039;phone.png&#039;)<br \/>\n# \u8f6c\u6362\u4e3a\u7070\u5ea6\u56fe<br \/>\nphone_gray &#061; cv2.cvtColor(phone, cv2.COLOR_BGR2GRAY)<br \/>\n# \u4e8c\u503c\u5316\u5904\u7406<br \/>\nret, phone_binary &#061; cv2.threshold(phone_gray, 120, 255, cv2.THRESH_BINARY)<\/p>\n<h4>3\u3001\u68c0\u6d4b\u5e76\u7ed8\u5236\u8f6e\u5ed3<\/h4>\n<p>\u00a0\u00a0\u63a5\u4e0b\u6765\u6211\u4eec\u8981\u68c0\u6d4b\u5e76\u7ed8\u5236\u8f6e\u5ed3&#xff0c;\u8fd9\u4e2a\u64cd\u4f5c\u9700\u8981\u4e24\u4e2a\u5173\u952e\u51fd\u6570\u3002\u9996\u5148&#xff0c;\u8c03\u7528cv2.findContours()\u51fd\u6570\u5728\u4e8c\u503c\u56fe\u50cf\u4e0a\u67e5\u627e\u8f6e\u5ed3\u3002\u5176\u4e2d&#xff0c;\u53c2\u6570cv2.RETR_TREE\u8868\u793a\u68c0\u7d22\u6240\u6709\u8f6e\u5ed3\u5e76\u5efa\u7acb\u5b8c\u6574\u7684\u5c42\u7ea7\u5173\u7cfb\u6811&#xff0c;cv2.CHAIN_APPROX_NONE\u5219\u5b58\u50a8\u8f6e\u5ed3\u4e0a\u6240\u6709\u7684\u70b9&#xff0c;\u4e0d\u8fdb\u884c\u8fd1\u4f3c\u538b\u7f29\u3002\u8be5\u51fd\u6570\u8fd4\u56de\u8f6e\u5ed3\u5217\u8868\u548c\u5c42\u7ea7\u4fe1\u606f\u3002\u6211\u4eec\u901a\u5e38\u5148\u521b\u5efa\u4e00\u4e2a\u526f\u672c\u4ee5\u907f\u514d\u4fee\u6539\u539f\u56fe\u3002\u63a5\u7740&#xff0c;\u4f7f\u7528cv2.drawContours()\u51fd\u6570\u8fdb\u884c\u7ed8\u5236&#xff0c;\u5c06contours\u5217\u8868\u4f20\u5165&#xff0c;\u8bbe\u5b9acontourIdx&#061;-1\u4ee5\u753b\u51fa\u6240\u6709\u8f6e\u5ed3&#xff0c;\u5e76\u6307\u5b9a\u7ed8\u5236\u989c\u8272\u4e3a\u7eff\u8272(0, 255, 0)&#xff0c;\u7ebf\u6761\u7c97\u7ec6\u4e3a2\u50cf\u7d20\u3002\u6700\u540e&#xff0c;\u901a\u8fc7cv2.imshow()\u663e\u793a\u7ed8\u5236\u7ed3\u679c\u3002<\/p>\n<p># \u68c0\u6d4b\u8f6e\u5ed3<br \/>\ncontours, hierarchy &#061; cv2.findContours(phone_binary, cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE)[-2:]<\/p>\n<p># \u5728\u539f\u56fe\u4e0a\u7ed8\u5236\u6240\u6709\u8f6e\u5ed3<br \/>\nimage_copy &#061; phone.copy()<br \/>\ncv2.drawContours(image&#061;image_copy, contours&#061;contours,<br \/>\n                 contourIdx&#061;-1, color&#061;(0, 255, 0), thickness&#061;2)<br \/>\ncv2.imshow(&#039;Contours_show&#039;, image_copy)<br \/>\ncv2.waitKey(0)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"853\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124092457-69748fe9d8be3.png\" width=\"1078\" \/><\/p>\n<h3>\u4e8c\u3001\u8f6e\u5ed3\u7279\u5f81&#xff1a;\u4e86\u89e3\u4f60\u7684\u201c\u8f6e\u5ed3\u201d<\/h3>\n<p>\u00a0 \u5728\u6211\u4eec\u83b7\u53d6\u8f6e\u5ed3\u540e&#xff0c;\u6211\u4eec\u9700\u8981\u5206\u6790\u5b83\u4eec\u7684\u7279\u5f81&#xff0c;\u6bd4\u5982\u9762\u79ef\u3001\u5468\u957f\u7b49&#xff0c;\u4ee5\u4fbf\u8fdb\u4e00\u6b65\u7b5b\u9009\u548c\u5904\u7406\u3002<\/p>\n<h4>1\u3001\u8f6e\u5ed3\u9762\u79ef<\/h4>\n<p>\u00a0\u00a0\u5728OpenCV\u5e93\u4e2d&#xff0c;\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528cv2.contourArea()\u51fd\u6570\u8ba1\u7b97\u8f6e\u5ed3\u7684\u9762\u79ef\u3002\u9762\u79ef\u662f\u8f6e\u5ed3\u7684\u4e00\u4e2a\u57fa\u7840\u51e0\u4f55\u7279\u5f81&#xff0c;\u7528\u4e8e\u6839\u636e\u5b9e\u9645\u5c3a\u5bf8\u9700\u6c42\u4ece\u56fe\u50cf\u4e2d\u7b5b\u9009\u51fa\u7b26\u5408\u6761\u4ef6\u7684\u8f6e\u5ed3&#xff0c;\u4f8b\u5982\u8fc7\u6ee4\u6389\u566a\u70b9\u6216\u9009\u4e2d\u7279\u5b9a\u5927\u5c0f\u7684\u76ee\u6807\u7269\u4f53\u3002<\/p>\n<p>area &#061; cv2.contourArea(contour)<\/p>\n<h4>2\u3001\u8f6e\u5ed3\u5468\u957f<\/h4>\n<p>\u00a0 \u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528cv2.arcLength()\u51fd\u6570\u53ef\u4ee5\u8ba1\u7b97\u8f6e\u5ed3\u7684\u5468\u957f\u3002\u5176closed\u53c2\u6570\u7528\u4e8e\u6307\u5b9a\u8f6e\u5ed3\u662f\u5426\u4e3a\u5c01\u95ed\u66f2\u7ebf\u3002\u5468\u957f\u662f\u53e6\u4e00\u4e2a\u6838\u5fc3\u7684\u8f6e\u5ed3\u7279\u5f81&#xff0c;\u5e38\u4e0e\u9762\u79ef\u7ed3\u5408\u7528\u4e8e\u5f62\u72b6\u5206\u6790&#xff0c;\u4f8b\u5982\u8ba1\u7b97\u8f6e\u5ed3\u7684\u5706\u5ea6&#xff0c;\u6216\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u4f30\u7b97\u7269\u4f53\u7684\u8fb9\u754c\u957f\u5ea6\u3002<\/p>\n<p>perimeter &#061; cv2.arcLength(contour, closed&#061;True)<\/p>\n<p>\u00a0 \u90a3\u63a5\u4e0b\u6765\u8ba9\u6211\u4eec\u6309\u9762\u79ef\u7b5b\u9009\u8f6e\u5ed3&#xff1a;\u6211\u4eec\u53ea\u60f3\u663e\u793a\u9762\u79ef\u5927\u4e8e10000\u7684\u8f6e\u5ed3<\/p>\n<p>large_contours &#061; []<br \/>\nfor cnt in contours:<br \/>\n    if cv2.contourArea(cnt) &gt; 10000:<br \/>\n        large_contours.append(cnt)<\/p>\n<p>image_copy &#061; phone.copy()<br \/>\ncv2.drawContours(image_copy, large_contours, -1, (0, 255, 0), 3)<br \/>\ncv2.imshow(&#039;Large_Contours&#039;, image_copy)<br \/>\ncv2.waitKey(0)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"706\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124092458-69748fea7d9d2.png\" width=\"1173\" \/><\/p>\n<h3>\u4e09\u3001\u8f6e\u5ed3\u8fd1\u4f3c&#xff1a;\u7b80\u5316\u8f6e\u5ed3\u5f62\u72b6<\/h3>\n<h4>1\u3001\u4e3a\u4ec0\u4e48\u8981\u8fd1\u4f3c&#xff1f;<\/h4>\n<p>\u00a0\u00a0\u56e0\u4e3a\u4ece\u5b9e\u9645\u56fe\u50cf\u4e2d\u68c0\u6d4b\u51fa\u7684\u8f6e\u5ed3\u5f80\u5f80\u5305\u542b\u8fc7\u591a\u7684\u5197\u4f59\u70b9&#xff0c;\u5bfc\u81f4\u5f62\u72b6\u63cf\u8ff0\u8fc7\u4e8e\u590d\u6742\u4e14\u8ba1\u7b97\u6548\u7387\u4f4e\u4e0b\u3002\u8fd9\u65f6\u6211\u4eec\u901a\u8fc7\u7528\u66f4\u5c11\u7684\u70b9\u6765\u903c\u8fd1\u539f\u59cb\u8f6e\u5ed3&#xff0c;\u53ef\u4ee5\u5728\u57fa\u672c\u4fdd\u6301\u5176\u6838\u5fc3\u51e0\u4f55\u5f62\u72b6\u7684\u524d\u63d0\u4e0b&#xff0c;\u7b80\u5316\u6570\u636e\u3002\u8fd9\u79cd\u7b80\u5316\u5bf9\u4e8e\u540e\u7eed\u7684\u5f62\u72b6\u8bc6\u522b\u3001\u5339\u914d\u548c\u5b58\u50a8\u81f3\u5173\u91cd\u8981&#xff0c;\u5b83\u80fd\u63d0\u9ad8\u7b97\u6cd5\u6548\u7387\u5e76\u51cf\u5c11\u566a\u58f0\u5e26\u6765\u7684\u5e72\u6270\u3002<\/p>\n<h4>2\u3001\u8fd1\u4f3c\u65b9\u6cd5<\/h4>\n<p>\u00a0\u00a0cv2.approxPolyDP() \u662f\u5b9e\u73b0\u8f6e\u5ed3\u8fd1\u4f3c\u7684\u6838\u5fc3\u51fd\u6570\u3002\u5176\u5173\u952e\u53c2\u6570 epsilon \u4e3a\u8fd1\u4f3c\u7cbe\u5ea6&#xff0c;\u901a\u5e38\u8bbe\u7f6e\u4e3a\u8f6e\u5ed3\u5468\u957f\u7684\u4e00\u4e2a\u767e\u5206\u6bd4\u3002\u901a\u8fc7\u8c03\u6574\u8be5\u503c&#xff0c;\u53ef\u4ee5\u63a7\u5236\u8fd1\u4f3c\u7684\u7a0b\u5ea6&#xff1a;epsilon \u503c\u8d8a\u5c0f&#xff0c;\u5f97\u5230\u7684\u591a\u8fb9\u5f62\u9876\u70b9\u8d8a\u591a&#xff0c;\u5f62\u72b6\u8d8a\u63a5\u8fd1\u539f\u59cb\u8f6e\u5ed3&#xff0c;\u503c\u8d8a\u5927&#xff0c;\u5219\u9876\u70b9\u8d8a\u5c11&#xff0c;\u5f62\u72b6\u8d8a\u7b80\u5316&#xff0c;\u76f4\u81f3\u5931\u53bb\u5173\u952e\u7279\u5f81\u3002<\/p>\n<p>epsilon &#061; 0.01 * cv2.arcLength(contour, True)  # \u8fd1\u4f3c\u7cbe\u5ea6<br \/>\napprox &#061; cv2.approxPolyDP(contour, epsilon, True)  # \u8fdb\u884c\u8fd1\u4f3c<\/p>\n<p>\u00a0 \u8f6e\u5ed3\u8fd1\u4f3c\u793a\u4f8b&#xff1a;<\/p>\n<p># \u83b7\u53d6\u6700\u5927\u9762\u79ef\u7684\u8f6e\u5ed3<br \/>\ncontours_with_area &#061; [(cnt, cv2.contourArea(cnt)) for cnt in contours]<br \/>\nsorted_contours &#061; sorted(contours_with_area, key&#061;lambda x: x[1], reverse&#061;True)<br \/>\nlargest_contour &#061; sorted_contours[0][0]<\/p>\n<p># \u5bf9\u6700\u5927\u8f6e\u5ed3\u8fdb\u884c\u8fd1\u4f3c<br \/>\nepsilon &#061; 0.01 * cv2.arcLength(largest_contour, True)<br \/>\napprox &#061; cv2.approxPolyDP(largest_contour, epsilon, True)<\/p>\n<p># \u7ed8\u5236\u8fd1\u4f3c\u540e\u7684\u8f6e\u5ed3<br \/>\nphone_new &#061; phone.copy()<br \/>\ncv2.drawContours(phone_new, [approx], -1, (0, 255, 0), 3)<br \/>\ncv2.imshow(&#039;Approximated_Contour&#039;, phone_new)<br \/>\ncv2.waitKey(0)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"792\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124092458-69748feaeb9a9.png\" width=\"1032\" \/><\/p>\n<h3>\u56db\u3001\u8f6e\u5ed3\u7684\u5916\u63a5\u5f62\u72b6<\/h3>\n<h4>1\u3001\u5916\u63a5\u5706<\/h4>\n<p>\u00a0\u00a0cv2.minEnclosingCircle() \u51fd\u6570\u7528\u4e8e\u8ba1\u7b97\u8f6e\u5ed3\u7684\u6700\u5c0f\u5916\u63a5\u5706&#xff0c;\u8fd4\u56de\u5706\u5fc3\u5750\u6807\u548c\u534a\u5f84\u3002\u8be5\u5706\u662f\u80fd\u5b8c\u5168\u5305\u56f4\u8f6e\u5ed3\u7684\u6700\u5c0f\u7684\u5706&#xff0c;\u5e38\u7528\u4e8e\u5b9a\u4f4d\u548c\u6d4b\u91cf\u3002\u6211\u4eec\u5728\u4ee3\u7801\u91cc\u83b7\u53d6\u7684\u6d6e\u70b9\u6570\u7ed3\u679c\u9700\u8f6c\u6362\u4e3a\u6574\u6570&#xff0c;\u4ee5\u4fbf\u4f7f\u7528 cv2.circle() \u51fd\u6570\u5728\u56fe\u50cf\u4e0a\u7ed8\u5236\u51fa\u8be5\u5706\u5f62&#xff0c;\u4ece\u800c\u76f4\u89c2\u5730\u53ef\u89c6\u5316\u8f6e\u5ed3\u7684\u5916\u63a5\u8303\u56f4\u3002<\/p>\n<p># \u8ba1\u7b97\u6700\u5c0f\u5916\u63a5\u5706\u5e76\u7ed8\u5236&#xff08;\u4f7f\u7528\u6700\u5927\u8f6e\u5ed3&#xff09;<br \/>\n(x, y), radius &#061; cv2.minEnclosingCircle(largest_contour)<br \/>\ncircle_image &#061; phone.copy()<br \/>\ncv2.circle(circle_image, (int(x), int(y)), int(radius), (0, 255, 0), 2)<br \/>\ncv2.imshow(&#039;Min_Enclosing_Circle&#039;, circle_image)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"667\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124092459-69748feb72ab5.png\" width=\"862\" \/><\/p>\n<h4>2\u3001\u5916\u63a5\u77e9\u5f62<\/h4>\n<p>\u00a0\u00a0cv2.boundingRect()\u51fd\u6570\u7528\u4e8e\u8ba1\u7b97\u8f6e\u5ed3\u7684\u76f4\u7acb\u5916\u63a5\u77e9\u5f62&#xff0c;\u8fd4\u56de\u5176\u5de6\u4e0a\u89d2\u9876\u70b9\u5750\u6807\u3001\u5bbd\u5ea6\u548c\u9ad8\u5ea6\u3002\u8be5\u77e9\u5f62\u662f\u80fd\u5b8c\u5168\u5305\u56f4\u8f6e\u5ed3\u7684\u6700\u5c0f\u6b63\u77e9\u5f62&#xff0c;\u5e38\u7528\u4e8e\u76ee\u6807\u7684\u5feb\u901f\u5b9a\u4f4d\u548c\u533a\u57df\u63d0\u53d6\u3002\u968f\u540e&#xff0c;\u7528cv2.rectangle()\u5e76\u4f20\u5165\u77e9\u5f62\u7684\u4e24\u4e2a\u5bf9\u89d2\u70b9&#xff0c;\u5373\u53ef\u5728\u56fe\u50cf\u4e0a\u7ed8\u5236\u51fa\u8be5\u7eff\u8272\u8fb9\u6846&#xff0c;\u4ece\u800c\u76f4\u89c2\u5730\u6807\u5b9a\u8f6e\u5ed3\u7684\u8303\u56f4\u3002<\/p>\n<p># \u8ba1\u7b97\u5916\u63a5\u77e9\u5f62\u5e76\u7ed8\u5236<br \/>\nx, y, w, h &#061; cv2.boundingRect(largest_contour)<br \/>\nrect_image &#061; phone.copy()<br \/>\ncv2.rectangle(rect_image, (x, y), (x &#043; w, y &#043; h), (0, 255, 0), 2)<br \/>\ncv2.imshow(&#039;Bounding_Rectangle&#039;, rect_image)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"775\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124092459-69748febe22f1.png\" width=\"910\" \/><\/p>\n<h3>\u4e94\u3001\u6a21\u677f\u5339\u914d&#xff1a;\u56fe\u50cf\u4e2d\u7684\u201c\u627e\u832c\u201d\u6e38\u620f<\/h3>\n<h4>1\u3001\u4ec0\u4e48\u662f\u6a21\u677f\u5339\u914d&#xff1f;<\/h4>\n<p>\u00a0\u00a0\u6a21\u677f\u5339\u914d\u662f\u5728\u6e90\u56fe\u50cf\u4e2d\u5bfb\u627e\u4e0e\u7ed9\u5b9a\u6a21\u677f\u56fe\u50cf\u6700\u76f8\u4f3c\u7684\u533a\u57df\u3002\u5176\u6838\u5fc3\u601d\u60f3\u662f\u5c06\u6a21\u677f\u4f5c\u4e3a\u6ed1\u52a8\u7a97\u53e3&#xff0c;\u904d\u5386\u6e90\u56fe\u50cf\u8fdb\u884c\u6bd4\u8f83&#xff0c;\u901a\u8fc7\u7279\u5b9a\u7684\u65b9\u6cd5\u8ba1\u7b97\u76f8\u4f3c\u5ea6\u3002\u4f7f\u7528\u7684\u6838\u5fc3\u51fd\u6570\u662fcv2.matchTemplate()&#xff0c;\u5b83\u8f93\u5165\u6e90\u56fe\u50cf\u3001\u6a21\u677f\u56fe\u50cf\u548c\u5339\u914d\u65b9\u6cd5&#xff0c;\u8f93\u51fa\u4e00\u4e2a\u7ed3\u679c\u77e9\u9635&#xff0c;\u5176\u4e2d\u7684\u6781\u503c\u70b9\u4f4d\u7f6e\u5373\u6307\u793a\u4e86\u6700\u4f73\u5339\u914d\u533a\u57df\u3002<\/p>\n<p>res &#061; cv2.matchTemplate(image, templ, method)<\/p>\n<p>\u5339\u914d\u65b9\u6cd5&#xff1a;<br \/>\ncv2.TM_SQDIFF_NORMED&#xff1a;\u5f52\u4e00\u5316\u5e73\u65b9\u5dee\u5339\u914d&#xff0c;\u503c\u8d8a\u5c0f\u5339\u914d\u8d8a\u597d<\/p>\n<p>cv2.TM_CCORR_NORMED&#xff1a;\u5f52\u4e00\u5316\u76f8\u5173\u5339\u914d&#xff0c;\u503c\u8d8a\u5927\u5339\u914d\u8d8a\u597d<\/p>\n<p>cv2.TM_CCOEFF_NORMED&#xff1a;\u5f52\u4e00\u5316\u76f8\u5173\u7cfb\u6570\u5339\u914d&#xff0c;\u6700\u5e38\u7528&#xff0c;\u503c\u8d8a\u5927\u5339\u914d\u8d8a\u597d<\/p>\n<p>\u00a0 \u6a21\u677f\u5339\u914d\u7684\u5de5\u4f5c\u539f\u7406&#xff1a;\u9996\u5148\u5c06\u6a21\u677f\u56fe\u50cf\u653e\u5728\u539f\u56fe\u7684\u6bcf\u4e2a\u53ef\u80fd\u4f4d\u7f6e&#xff0c;\u63a5\u7740\u5728\u6bcf\u4e2a\u4f4d\u7f6e\u8ba1\u7b97\u76f8\u4f3c\u5ea6\u5206\u6570&#xff0c;\u627e\u5230\u5206\u6570\u6700\u9ad8\u7684\u4f4d\u7f6e&#xff0c;\u8be5\u4f4d\u7f6e\u5c31\u662f\u6700\u4f73\u5339\u914d\u533a\u57df\u3002<\/p>\n<h4>\u6848\u4f8b&#xff1a;\u5728\u53ef\u4e50\u7f50\u56fe\u7247\u4e2d\u627e\u5546\u6807<\/h4>\n<p>import cv2<\/p>\n<p># \u8bfb\u53d6\u56fe\u50cf\u548c\u6a21\u677f<br \/>\nkele &#061; cv2.imread(&#039;kele.png&#039;)          # \u539f\u56fe<br \/>\ntemplate &#061; cv2.imread(&#039;template.png&#039;)  # \u6a21\u677f<\/p>\n<p># \u83b7\u53d6\u6a21\u677f\u5c3a\u5bf8<br \/>\nh, w &#061; template.shape[:2]<\/p>\n<p># \u8fdb\u884c\u6a21\u677f\u5339\u914d<br \/>\nres &#061; cv2.matchTemplate(kele, template, cv2.TM_CCOEFF_NORMED)<\/p>\n<p># \u627e\u5230\u6700\u4f73\u5339\u914d\u4f4d\u7f6e<br \/>\nmin_val, max_val, min_loc, max_loc &#061; cv2.minMaxLoc(res)<br \/>\ntop_left &#061; max_loc<br \/>\nbottom_right &#061; (top_left[0] &#043; w, top_left[1] &#043; h)<\/p>\n<p># \u5728\u539f\u56fe\u4e0a\u6807\u8bb0\u5339\u914d\u533a\u57df<br \/>\nkele_template &#061; cv2.rectangle(kele, top_left, bottom_right, (0, 255, 0), 2)<\/p>\n<p># \u663e\u793a\u7ed3\u679c<br \/>\ncv2.imshow(&#039;Template_Matching_Result&#039;, kele_template)<br \/>\ncv2.waitKey(0)<br \/>\ncv2.destroyAllWindows()<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"768\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124092500-69748fec583f1.png\" width=\"1179\" \/><\/p>\n<p>\u00a0 \u5230\u8fd9\u91cc\u6211\u4eec\u5c31\u5b66\u5b8c\u4e86opencv\u4e2d\u7684\u57fa\u7840\u5185\u5bb9\u4e86&#xff0c;\u63a5\u4e0b\u6765\u5c06\u4f1a\u5728\u540e\u9762\u7684\u6587\u7ae0\u91cc\u5f00\u59cb\u5b66\u4e60\u8fdb\u9636\u7684\u66f4\u590d\u6742\u7684\u8ba1\u7b97\u673a\u89c6\u89c9\u64cd\u4f5c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f15\u8a00\u5728\u8ba1\u7b97\u673a\u89c6\u89c9\u4e2d&#xff0c;\u8f6e\u5ed3\u68c0\u6d4b\u4e0e\u6a21\u677f\u5339\u914d\u662f\u4e24\u9879\u57fa\u7840\u7684\u56fe\u50cf\u5206\u6790\u6280\u672f\u3002\u8f6e\u5ed3\u68c0\u6d4b\u901a\u8fc7\u63d0\u53d6\u76ee\u6807\u7684\u5f62\u72b6\u8fb9\u754c&#xff0c;\u5c06\u56fe\u50cf\u7b80\u5316\u4e3a\u51e0\u4f55\u8f6e\u5ed3&#xff0c;\u662f\u5b9e\u73b0\u7269\u4f53\u5f62\u72b6\u5206\u6790\u3001\u5c3a\u5bf8\u6d4b\u91cf\u7684\u5173\u952e\u6b65\u9aa4\u3002\u6a21\u677f\u5339\u914d\u5219\u901a\u8fc7\u5728\u56fe\u50cf\u4e2d\u6ed1\u52a8\u5df2\u77e5\u6a21\u677f\u8fdb\u884c\u6bd4\u5bf9&#xff0c;\u76f4\u63a5\u5b9a\u4f4d\u7279\u5b9a\u76ee\u6807&#xff0c;\u9002\u7528\u4e8e\u5143\u4ef6\u5b9a\u4f4d\u3001\u56fa\u5b9a\u56fe\u6848\u8bc6\u522b\u7b49\u4efb\u52a1\u3002\u5b83\u4eec\u5e38\u534f\u540c\u5de5\u4f5c&#xff0c;\u5982\u7528\u8f6e\u5ed3\u5feb\u901f\u7b5b\u9009\u533a\u57df&#xff0c;\u518d\u7528\u6a21\u677f\u7cbe\u786e\u5339\u914d&#xff0c;\u5171\u540c\u4e3a\u66f4\u590d\u6742\u7684\u89c6\u89c9\u4efb\u52a1\u63d0\u4f9b\u53ef\u9760\u652f\u6301\u3002\u63a5\u4e0b\u6765\u5c31\u8ba9\u6211\u4eec\u4e00\u8d77\u5b66<\/p>\n","protected":false},"author":2,"featured_media":65227,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1460,50,523],"topic":[],"class_list":["post-65233","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-opencv","tag-50","tag-523"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5c0f\u767d\u4ece\u96f6\u5f00\u59cb\u52c7\u95ef\u4eba\u5de5\u667a\u80fd\uff1a\u8ba1\u7b97\u673a\u89c6\u89c9\u521d\u7ea7\u7bc7\uff08\u521d\u8bc6Opencv\u4e0b\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/65233.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5c0f\u767d\u4ece\u96f6\u5f00\u59cb\u52c7\u95ef\u4eba\u5de5\u667a\u80fd\uff1a\u8ba1\u7b97\u673a\u89c6\u89c9\u521d\u7ea7\u7bc7\uff08\u521d\u8bc6Opencv\u4e0b\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5f15\u8a00\u5728\u8ba1\u7b97\u673a\u89c6\u89c9\u4e2d&#xff0c;\u8f6e\u5ed3\u68c0\u6d4b\u4e0e\u6a21\u677f\u5339\u914d\u662f\u4e24\u9879\u57fa\u7840\u7684\u56fe\u50cf\u5206\u6790\u6280\u672f\u3002\u8f6e\u5ed3\u68c0\u6d4b\u901a\u8fc7\u63d0\u53d6\u76ee\u6807\u7684\u5f62\u72b6\u8fb9\u754c&#xff0c;\u5c06\u56fe\u50cf\u7b80\u5316\u4e3a\u51e0\u4f55\u8f6e\u5ed3&#xff0c;\u662f\u5b9e\u73b0\u7269\u4f53\u5f62\u72b6\u5206\u6790\u3001\u5c3a\u5bf8\u6d4b\u91cf\u7684\u5173\u952e\u6b65\u9aa4\u3002\u6a21\u677f\u5339\u914d\u5219\u901a\u8fc7\u5728\u56fe\u50cf\u4e2d\u6ed1\u52a8\u5df2\u77e5\u6a21\u677f\u8fdb\u884c\u6bd4\u5bf9&#xff0c;\u76f4\u63a5\u5b9a\u4f4d\u7279\u5b9a\u76ee\u6807&#xff0c;\u9002\u7528\u4e8e\u5143\u4ef6\u5b9a\u4f4d\u3001\u56fa\u5b9a\u56fe\u6848\u8bc6\u522b\u7b49\u4efb\u52a1\u3002\u5b83\u4eec\u5e38\u534f\u540c\u5de5\u4f5c&#xff0c;\u5982\u7528\u8f6e\u5ed3\u5feb\u901f\u7b5b\u9009\u533a\u57df&#xff0c;\u518d\u7528\u6a21\u677f\u7cbe\u786e\u5339\u914d&#xff0c;\u5171\u540c\u4e3a\u66f4\u590d\u6742\u7684\u89c6\u89c9\u4efb\u52a1\u63d0\u4f9b\u53ef\u9760\u652f\u6301\u3002\u63a5\u4e0b\u6765\u5c31\u8ba9\u6211\u4eec\u4e00\u8d77\u5b66\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/65233.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-24T09:25:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124092457-69748fe9d8be3.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/65233.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/65233.html\",\"name\":\"\u5c0f\u767d\u4ece\u96f6\u5f00\u59cb\u52c7\u95ef\u4eba\u5de5\u667a\u80fd\uff1a\u8ba1\u7b97\u673a\u89c6\u89c9\u521d\u7ea7\u7bc7\uff08\u521d\u8bc6Opencv\u4e0b\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-24T09:25:02+00:00\",\"dateModified\":\"2026-01-24T09:25:02+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/65233.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/65233.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/65233.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5c0f\u767d\u4ece\u96f6\u5f00\u59cb\u52c7\u95ef\u4eba\u5de5\u667a\u80fd\uff1a\u8ba1\u7b97\u673a\u89c6\u89c9\u521d\u7ea7\u7bc7\uff08\u521d\u8bc6Opencv\u4e0b\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5c0f\u767d\u4ece\u96f6\u5f00\u59cb\u52c7\u95ef\u4eba\u5de5\u667a\u80fd\uff1a\u8ba1\u7b97\u673a\u89c6\u89c9\u521d\u7ea7\u7bc7\uff08\u521d\u8bc6Opencv\u4e0b\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/65233.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5c0f\u767d\u4ece\u96f6\u5f00\u59cb\u52c7\u95ef\u4eba\u5de5\u667a\u80fd\uff1a\u8ba1\u7b97\u673a\u89c6\u89c9\u521d\u7ea7\u7bc7\uff08\u521d\u8bc6Opencv\u4e0b\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5f15\u8a00\u5728\u8ba1\u7b97\u673a\u89c6\u89c9\u4e2d&#xff0c;\u8f6e\u5ed3\u68c0\u6d4b\u4e0e\u6a21\u677f\u5339\u914d\u662f\u4e24\u9879\u57fa\u7840\u7684\u56fe\u50cf\u5206\u6790\u6280\u672f\u3002\u8f6e\u5ed3\u68c0\u6d4b\u901a\u8fc7\u63d0\u53d6\u76ee\u6807\u7684\u5f62\u72b6\u8fb9\u754c&#xff0c;\u5c06\u56fe\u50cf\u7b80\u5316\u4e3a\u51e0\u4f55\u8f6e\u5ed3&#xff0c;\u662f\u5b9e\u73b0\u7269\u4f53\u5f62\u72b6\u5206\u6790\u3001\u5c3a\u5bf8\u6d4b\u91cf\u7684\u5173\u952e\u6b65\u9aa4\u3002\u6a21\u677f\u5339\u914d\u5219\u901a\u8fc7\u5728\u56fe\u50cf\u4e2d\u6ed1\u52a8\u5df2\u77e5\u6a21\u677f\u8fdb\u884c\u6bd4\u5bf9&#xff0c;\u76f4\u63a5\u5b9a\u4f4d\u7279\u5b9a\u76ee\u6807&#xff0c;\u9002\u7528\u4e8e\u5143\u4ef6\u5b9a\u4f4d\u3001\u56fa\u5b9a\u56fe\u6848\u8bc6\u522b\u7b49\u4efb\u52a1\u3002\u5b83\u4eec\u5e38\u534f\u540c\u5de5\u4f5c&#xff0c;\u5982\u7528\u8f6e\u5ed3\u5feb\u901f\u7b5b\u9009\u533a\u57df&#xff0c;\u518d\u7528\u6a21\u677f\u7cbe\u786e\u5339\u914d&#xff0c;\u5171\u540c\u4e3a\u66f4\u590d\u6742\u7684\u89c6\u89c9\u4efb\u52a1\u63d0\u4f9b\u53ef\u9760\u652f\u6301\u3002\u63a5\u4e0b\u6765\u5c31\u8ba9\u6211\u4eec\u4e00\u8d77\u5b66","og_url":"https:\/\/www.wsisp.com\/helps\/65233.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-24T09:25:02+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124092457-69748fe9d8be3.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/65233.html","url":"https:\/\/www.wsisp.com\/helps\/65233.html","name":"\u5c0f\u767d\u4ece\u96f6\u5f00\u59cb\u52c7\u95ef\u4eba\u5de5\u667a\u80fd\uff1a\u8ba1\u7b97\u673a\u89c6\u89c9\u521d\u7ea7\u7bc7\uff08\u521d\u8bc6Opencv\u4e0b\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-24T09:25:02+00:00","dateModified":"2026-01-24T09:25:02+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/65233.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/65233.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/65233.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5c0f\u767d\u4ece\u96f6\u5f00\u59cb\u52c7\u95ef\u4eba\u5de5\u667a\u80fd\uff1a\u8ba1\u7b97\u673a\u89c6\u89c9\u521d\u7ea7\u7bc7\uff08\u521d\u8bc6Opencv\u4e0b\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/65233","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=65233"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/65233\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/65227"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=65233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=65233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=65233"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=65233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}