{"id":1012078,"date":"2024-12-27T11:35:43","date_gmt":"2024-12-27T03:35:43","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1012078.html"},"modified":"2024-12-27T11:36:01","modified_gmt":"2024-12-27T03:36:01","slug":"oj-python%e5%a6%82%e4%bd%95%e8%af%bb%e5%85%a5%e6%95%b0%e6%8d%ae","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1012078.html","title":{"rendered":"oj python\u5982\u4f55\u8bfb\u5165\u6570\u636e"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25085949\/36b1b4dc-2038-43f1-96e6-9a583dce3959.webp\" alt=\"oj python\u5982\u4f55\u8bfb\u5165\u6570\u636e\" \/><\/p>\n<p><p> \u5728Python\u4e2d\u4f7f\u7528OpenCV\uff08\u7b80\u79f0oj\uff09\u8bfb\u53d6\u6570\u636e\u65f6\uff0c\u4e3b\u8981\u6d89\u53ca\u56fe\u50cf\u6216\u89c6\u9891\u6587\u4ef6\u7684\u8bfb\u53d6\u3002<strong>\u4f7f\u7528OpenCV\u7684<code>cv2.imread()<\/code>\u51fd\u6570\u8bfb\u53d6\u56fe\u50cf\u3001<code>cv2.VideoCapture()<\/code>\u8bfb\u53d6\u89c6\u9891<\/strong>\u7b49\u662f\u5e38\u89c1\u65b9\u6cd5\u3002\u4e0b\u9762\u6211\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528\u8fd9\u4e9b\u65b9\u6cd5\u6765\u8bfb\u53d6\u6570\u636e\uff0c\u5e76\u6df1\u5165\u63a2\u8ba8\u5176\u5e94\u7528\u573a\u666f\u548c\u6ce8\u610f\u4e8b\u9879\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001IMREAD\u8bfb\u53d6\u56fe\u50cf<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528OpenCV\u8bfb\u53d6\u56fe\u50cf\u662f\u6570\u636e\u5904\u7406\u548c\u8ba1\u7b97\u673a\u89c6\u89c9\u4efb\u52a1\u7684\u7b2c\u4e00\u6b65\u3002<code>cv2.imread()<\/code>\u51fd\u6570\u662f\u8bfb\u53d6\u56fe\u50cf\u6587\u4ef6\u7684\u6838\u5fc3\u51fd\u6570\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u8bfb\u53d6\u56fe\u50cf\u6587\u4ef6<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528<code>cv2.imread(filename, flags)<\/code>\u53ef\u4ee5\u8bfb\u53d6\u56fe\u50cf\u6587\u4ef6\uff0c\u5176\u4e2d<code>filename<\/code>\u662f\u56fe\u50cf\u6587\u4ef6\u7684\u8def\u5f84\uff0c<code>flags<\/code>\u6307\u5b9a\u5982\u4f55\u8bfb\u53d6\u56fe\u50cf\u3002<\/p>\n<\/p>\n<ul>\n<li><code>cv2.IMREAD_COLOR<\/code>\uff1a\u4ee5\u5f69\u8272\u56fe\u50cf\u8bfb\u53d6\uff0c\u5ffd\u7565\u900f\u660e\u5ea6\u3002<\/li>\n<li><code>cv2.IMREAD_GRAYSCALE<\/code>\uff1a\u4ee5\u7070\u5ea6\u56fe\u50cf\u8bfb\u53d6\u3002<\/li>\n<li><code>cv2.IMREAD_UNCHANGED<\/code>\uff1a\u8bfb\u53d6\u56fe\u50cf\u7684\u539f\u59cb\u6570\u636e\uff0c\u5305\u62ecalpha\u901a\u9053\u3002<\/li>\n<\/ul>\n<p><p>\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import cv2<\/p>\n<h2><strong>\u8bfb\u53d6\u5f69\u8272\u56fe\u50cf<\/strong><\/h2>\n<p>img_color = cv2.imread(&#39;path\/to\/image.jpg&#39;, cv2.IMREAD_COLOR)<\/p>\n<h2><strong>\u8bfb\u53d6\u7070\u5ea6\u56fe\u50cf<\/strong><\/h2>\n<p>img_gray = cv2.imread(&#39;path\/to\/image.jpg&#39;, cv2.IMREAD_GRAYSCALE)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u56fe\u50cf\u8bfb\u53d6\u7684\u6ce8\u610f\u4e8b\u9879<\/strong><\/p>\n<\/p>\n<ul>\n<li><strong>\u8def\u5f84\u95ee\u9898<\/strong>\uff1a\u786e\u4fdd\u63d0\u4f9b\u7684\u8def\u5f84\u662f\u6b63\u786e\u7684\uff0c\u5c24\u5176\u5728\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u95f4\u4f7f\u7528\u65f6\u3002<\/li>\n<li><strong>\u6587\u4ef6\u683c\u5f0f<\/strong>\uff1aOpenCV\u652f\u6301\u591a\u79cd\u683c\u5f0f\uff0c\u5982JPEG\u3001PNG\u3001BMP\u7b49\uff0c\u4f46\u786e\u4fdd\u6587\u4ef6\u683c\u5f0f\u6b63\u786e\u3002<\/li>\n<li><strong>\u6587\u4ef6\u5b58\u5728\u6027<\/strong>\uff1a\u5728\u8bfb\u53d6\u4e4b\u524d\u68c0\u67e5\u6587\u4ef6\u662f\u5426\u5b58\u5728\uff0c\u4ee5\u907f\u514d\u7a0b\u5e8f\u5d29\u6e83\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u4e8c\u3001VIDEOCAPTURE\u8bfb\u53d6\u89c6\u9891<\/h3>\n<\/p>\n<p><p>\u5bf9\u4e8e\u89c6\u9891\u6587\u4ef6\u7684\u8bfb\u53d6\uff0c<code>cv2.VideoCapture()<\/code>\u662f\u4e3b\u8981\u5de5\u5177\u3002\u5b83\u4e0d\u4ec5\u53ef\u4ee5\u8bfb\u53d6\u89c6\u9891\u6587\u4ef6\uff0c\u8fd8\u80fd\u6355\u83b7\u6444\u50cf\u5934\u7684\u5b9e\u65f6\u89c6\u9891\u6d41\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u8bfb\u53d6\u89c6\u9891\u6587\u4ef6<\/strong><\/p>\n<\/p>\n<p><p>\u901a\u8fc7<code>cv2.VideoCapture(filename)<\/code>\u53ef\u4ee5\u6253\u5f00\u89c6\u9891\u6587\u4ef6\uff0c\u5e76\u9010\u5e27\u8bfb\u53d6\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import cv2<\/p>\n<h2><strong>\u6253\u5f00\u89c6\u9891\u6587\u4ef6<\/strong><\/h2>\n<p>cap = cv2.VideoCapture(&#39;path\/to\/video.mp4&#39;)<\/p>\n<p>while cap.isOpened():<\/p>\n<p>    ret, frame = cap.read()<\/p>\n<p>    if not ret:<\/p>\n<p>        break<\/p>\n<p>    # \u5728\u6b64\u5904\u7406\u6bcf\u4e00\u5e27<\/p>\n<p>    cv2.imshow(&#39;Frame&#39;, frame)<\/p>\n<p>    if cv2.w<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>tKey(1) &amp; 0xFF == ord(&#39;q&#39;):<\/p>\n<p>        break<\/p>\n<p>cap.release()<\/p>\n<p>cv2.destroyAllWindows()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6355\u83b7\u6444\u50cf\u5934\u89c6\u9891\u6d41<\/strong><\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u5c06<code>cv2.VideoCapture()<\/code>\u7684\u53c2\u6570\u8bbe\u4e3a0\uff0c\u53ef\u4ee5\u6253\u5f00\u9ed8\u8ba4\u6444\u50cf\u5934\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import cv2<\/p>\n<h2><strong>\u6253\u5f00\u9ed8\u8ba4\u6444\u50cf\u5934<\/strong><\/h2>\n<p>cap = cv2.VideoCapture(0)<\/p>\n<p>while True:<\/p>\n<p>    ret, frame = cap.read()<\/p>\n<p>    if not ret:<\/p>\n<p>        break<\/p>\n<p>    # \u663e\u793a\u5b9e\u65f6\u89c6\u9891\u6d41<\/p>\n<p>    cv2.imshow(&#39;Live&#39;, frame)<\/p>\n<p>    if cv2.waitKey(1) &amp; 0xFF == ord(&#39;q&#39;):<\/p>\n<p>        break<\/p>\n<p>cap.release()<\/p>\n<p>cv2.destroyAllWindows()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u89c6\u9891\u8bfb\u53d6\u7684\u6ce8\u610f\u4e8b\u9879<\/strong><\/p>\n<\/p>\n<ul>\n<li><strong>\u8bbe\u5907\u7d22\u5f15<\/strong>\uff1a\u5bf9\u4e8e\u591a\u4e2a\u6444\u50cf\u5934\uff0c\u4f7f\u7528\u4e0d\u540c\u7684\u7d22\u5f15\uff08\u59821, 2\uff09\u6765\u8bbf\u95ee\u4e0d\u540c\u7684\u8bbe\u5907\u3002<\/li>\n<li><strong>\u89c6\u9891\u683c\u5f0f\u652f\u6301<\/strong>\uff1a\u786e\u4fdd\u89c6\u9891\u6587\u4ef6\u7684\u7f16\u7801\u683c\u5f0f\u4e3aOpenCV\u652f\u6301\u7684\u683c\u5f0f\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u4e09\u3001\u4f7f\u7528NUMPY\u4e0eOPENCV\u7ed3\u5408<\/h3>\n<\/p>\n<p><p>OpenCV\u8bfb\u53d6\u7684\u56fe\u50cf\u548c\u89c6\u9891\u5e27\u6570\u636e\u662f\u4ee5NumPy\u6570\u7ec4\u7684\u5f62\u5f0f\u5b58\u50a8\u7684\uff0c\u8fd9\u4f7f\u5f97\u4e0eNumPy\u7684\u7ed3\u5408\u975e\u5e38\u4fbf\u5229\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u56fe\u50cf\u5904\u7406<\/strong><\/p>\n<\/p>\n<p><p>\u8bfb\u53d6\u540e\uff0c\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528NumPy\u5bf9\u56fe\u50cf\u8fdb\u884c\u5904\u7406\u3002\u4f8b\u5982\uff0c\u56fe\u50cf\u88c1\u526a\u3001\u901a\u9053\u5206\u79bb\u7b49\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import cv2<\/p>\n<p>import numpy as np<\/p>\n<p>img = cv2.imread(&#39;path\/to\/image.jpg&#39;)<\/p>\n<h2><strong>\u88c1\u526a\u56fe\u50cf<\/strong><\/h2>\n<p>cropped_img = img[50:200, 100:300]<\/p>\n<h2><strong>\u5206\u79bb\u989c\u8272\u901a\u9053<\/strong><\/h2>\n<p>b, g, r = cv2.split(img)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u89c6\u9891\u5904\u7406<\/strong><\/p>\n<\/p>\n<p><p>\u5bf9\u4e8e\u89c6\u9891\uff0c\u53ef\u4ee5\u5728\u8bfb\u53d6\u6bcf\u4e00\u5e27\u540e\uff0c\u4f7f\u7528NumPy\u8fdb\u884c\u5904\u7406\u3002\u4f8b\u5982\uff0c\u5e27\u5dee\u6cd5\u68c0\u6d4b\u8fd0\u52a8\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import cv2<\/p>\n<p>import numpy as np<\/p>\n<p>cap = cv2.VideoCapture(&#39;path\/to\/video.mp4&#39;)<\/p>\n<p>ret, frame1 = cap.read()<\/p>\n<p>ret, frame2 = cap.read()<\/p>\n<p>while cap.isOpened():<\/p>\n<p>    diff = cv2.absdiff(frame1, frame2)<\/p>\n<p>    gray = cv2.cvtColor(diff, cv2.COLOR_BGR2GRAY)<\/p>\n<p>    blur = cv2.GaussianBlur(gray, (5, 5), 0)<\/p>\n<p>    _, thresh = cv2.threshold(blur, 20, 255, cv2.THRESH_BINARY)<\/p>\n<p>    dilated = cv2.dilate(thresh, None, iterations=3)<\/p>\n<p>    contours, _ = cv2.findContours(dilated, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)<\/p>\n<p>    for contour in contours:<\/p>\n<p>        if cv2.contourArea(contour) &lt; 900:<\/p>\n<p>            continue<\/p>\n<p>        x, y, w, h = cv2.boundingRect(contour)<\/p>\n<p>        cv2.rectangle(frame1, (x, y), (x + w, y + h), (0, 255, 0), 2)<\/p>\n<p>    cv2.imshow(&#39;feed&#39;, frame1)<\/p>\n<p>    frame1 = frame2<\/p>\n<p>    ret, frame2 = cap.read()<\/p>\n<p>    if cv2.waitKey(40) == 27:<\/p>\n<p>        break<\/p>\n<p>cap.release()<\/p>\n<p>cv2.destroyAllWindows()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u56db\u3001\u5e38\u89c1\u95ee\u9898\u4e0e\u89e3\u51b3\u65b9\u6848<\/h3>\n<\/p>\n<p><p>\u5728\u4f7f\u7528OpenCV\u8bfb\u53d6\u6570\u636e\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\uff0c\u4e0b\u9762\u5217\u51fa\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u53ca\u5176\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u65e0\u6cd5\u8bfb\u53d6\u6587\u4ef6<\/strong><\/p>\n<\/p>\n<ul>\n<li><strong>\u8def\u5f84\u95ee\u9898<\/strong>\uff1a\u68c0\u67e5\u8def\u5f84\u662f\u5426\u6b63\u786e\uff0c\u7279\u522b\u662f\u5728Windows\u7cfb\u7edf\u4e2d\u9700\u8981\u6ce8\u610f\u53cd\u659c\u6760\u7684\u95ee\u9898\u3002<\/li>\n<li><strong>\u6743\u9650\u95ee\u9898<\/strong>\uff1a\u786e\u4fdd\u6709\u6743\u9650\u8bbf\u95ee\u6587\u4ef6\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u6444\u50cf\u5934\u65e0\u6cd5\u6253\u5f00<\/strong><\/p>\n<\/p>\n<ul>\n<li><strong>\u8bbe\u5907\u5360\u7528<\/strong>\uff1a\u786e\u8ba4\u6444\u50cf\u5934\u6ca1\u6709\u88ab\u5176\u4ed6\u7a0b\u5e8f\u5360\u7528\u3002<\/li>\n<li><strong>\u8bbe\u5907\u7d22\u5f15<\/strong>\uff1a\u5c1d\u8bd5\u4e0d\u540c\u7684\u8bbe\u5907\u7d22\u5f15\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u56fe\u50cf\u663e\u793a\u5f02\u5e38<\/strong><\/p>\n<\/p>\n<ul>\n<li><strong>\u901a\u9053\u987a\u5e8f<\/strong>\uff1aOpenCV\u9ed8\u8ba4\u4f7f\u7528BGR\u987a\u5e8f\uff0c\u800c\u5176\u4ed6\u5e93\u5982Matplotlib\u4f7f\u7528RGB\u987a\u5e8f\uff0c\u6ce8\u610f\u8f6c\u6362\u3002<\/li>\n<\/ul>\n<p><pre><code class=\"language-python\">import cv2<\/p>\n<p>import matplotlib.pyplot as plt<\/p>\n<p>img = cv2.imread(&#39;path\/to\/image.jpg&#39;)<\/p>\n<p>img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)<\/p>\n<p>plt.imshow(img_rgb)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4e94\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u4f7f\u7528OpenCV\u8bfb\u53d6\u6570\u636e\u662f\u8fdb\u884c\u56fe\u50cf\u5904\u7406\u548c\u8ba1\u7b97\u673a\u89c6\u89c9\u7684\u57fa\u7840\u3002<strong><code>cv2.imread()<\/code>\u548c<code>cv2.VideoCapture()<\/code>\u662f\u8bfb\u53d6\u56fe\u50cf\u548c\u89c6\u9891\u7684\u4e3b\u8981\u65b9\u6cd5<\/strong>\uff0c\u5e76\u4e14\u4e0eNumPy\u7ed3\u5408\u4f7f\u7528\u53ef\u4ee5\u5b9e\u73b0\u5f3a\u5927\u7684\u6570\u636e\u5904\u7406\u529f\u80fd\u3002\u5728\u4f7f\u7528\u8fc7\u7a0b\u4e2d\uff0c\u6ce8\u610f\u8def\u5f84\u3001\u6743\u9650\u3001\u683c\u5f0f\u652f\u6301\u7b49\u95ee\u9898\uff0c\u53ef\u4ee5\u6709\u6548\u907f\u514d\u5e38\u89c1\u9519\u8bef\uff0c\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u3002\u901a\u8fc7\u7075\u6d3b\u4f7f\u7528OpenCV\u63d0\u4f9b\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u5b9e\u73b0\u4e30\u5bcc\u7684\u56fe\u50cf\u548c\u89c6\u9891\u5904\u7406\u4efb\u52a1\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u4ece\u6587\u4ef6\u8bfb\u53d6\u6570\u636e\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u7684<code>open()<\/code>\u51fd\u6570\u6765\u6253\u5f00\u6587\u4ef6\uff0c\u7136\u540e\u4f7f\u7528<code>read()<\/code>\u3001<code>readline()<\/code>\u6216<code>readlines()<\/code>\u65b9\u6cd5\u6765\u8bfb\u53d6\u6570\u636e\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u8bfb\u53d6\u6574\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9\uff1a<\/p>\n<pre><code class=\"language-python\">with open(&#39;data.txt&#39;, &#39;r&#39;) as file:\n    content = file.read()\nprint(content)\n<\/code><\/pre>\n<p>\u8fd9\u79cd\u65b9\u5f0f\u7b80\u5355\u4e14\u5b89\u5168\uff0c\u4f7f\u7528<code>with<\/code>\u8bed\u53e5\u53ef\u4ee5\u786e\u4fdd\u6587\u4ef6\u5728\u8bfb\u53d6\u540e\u81ea\u52a8\u5173\u95ed\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u5982\u4f55\u5904\u7406CSV\u683c\u5f0f\u7684\u6570\u636e\uff1f<\/strong><br \/>\u5904\u7406CSV\u6587\u4ef6\u65f6\uff0cPython\u7684<code>csv<\/code>\u6a21\u5757\u975e\u5e38\u6709\u7528\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528<code>csv.reader<\/code>\u6216<code>csv.DictReader<\/code>\u6765\u8bfb\u53d6\u6587\u4ef6\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528<code>csv.reader<\/code>\u7684\u793a\u4f8b\uff1a<\/p>\n<pre><code class=\"language-python\">import csv\n\nwith open(&#39;data.csv&#39;, &#39;r&#39;) as file:\n    reader = csv.reader(file)\n    for row in reader:\n        print(row)\n<\/code><\/pre>\n<p>\u8fd9\u79cd\u65b9\u6cd5\u53ef\u4ee5\u65b9\u4fbf\u5730\u5c06\u6bcf\u4e00\u884c\u4f5c\u4e3a\u5217\u8868\u8bfb\u53d6\uff0c\u9002\u5408\u5904\u7406\u7ed3\u6784\u5316\u6570\u636e\u3002<\/p>\n<p><strong>Python\u4e2d\u5982\u4f55\u4ece\u7f51\u7edc\u8bfb\u53d6\u6570\u636e\uff1f<\/strong><br \/>\u60a8\u53ef\u4ee5\u4f7f\u7528<code>requests<\/code>\u5e93\u4ece\u7f51\u7edc\u4e0a\u83b7\u53d6\u6570\u636e\u3002\u8fd9\u4e2a\u5e93\u4f7f\u5f97HTTP\u8bf7\u6c42\u53d8\u5f97\u7b80\u5355\uff0c\u9002\u5408\u8bfb\u53d6API\u8fd4\u56de\u7684\u6570\u636e\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4eceAPI\u8bfb\u53d6JSON\u6570\u636e\u7684\u793a\u4f8b\uff1a<\/p>\n<pre><code class=\"language-python\">import requests\n\nresponse = requests.get(&#39;https:\/\/api.example.com\/data&#39;)\ndata = response.json()\nprint(data)\n<\/code><\/pre>\n<p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u60a8\u53ef\u4ee5\u8f7b\u677e\u5730\u4ece\u7f51\u7edc\u83b7\u53d6\u5e76\u5904\u7406\u6570\u636e\uff0c\u9002\u5408\u9700\u8981\u52a8\u6001\u6570\u636e\u7684\u573a\u666f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u4f7f\u7528OpenCV\uff08\u7b80\u79f0oj\uff09\u8bfb\u53d6\u6570\u636e\u65f6\uff0c\u4e3b\u8981\u6d89\u53ca\u56fe\u50cf\u6216\u89c6\u9891\u6587\u4ef6\u7684\u8bfb\u53d6\u3002\u4f7f\u7528OpenCV\u7684cv2 [&hellip;]","protected":false},"author":3,"featured_media":1012121,"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\/1012078"}],"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=1012078"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1012078\/revisions"}],"predecessor-version":[{"id":1012122,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1012078\/revisions\/1012122"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1012121"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1012078"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1012078"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1012078"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}