{"id":464,"date":"2021-12-13T22:09:50","date_gmt":"2021-12-13T14:09:50","guid":{"rendered":"https:\/\/windywind.tk\/?p=464"},"modified":"2021-12-15T01:27:48","modified_gmt":"2021-12-14T17:27:48","slug":"%e6%a0%91%e8%8e%93%e6%b4%beopencv%e7%8e%a9%e8%80%8d%e9%81%bf%e5%9d%91%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"https:\/\/windywind.tk\/?p=464","title":{"rendered":"\u6811\u8393\u6d3eOpenCV\u73a9\u800d\u907f\u5751\u6307\u5357"},"content":{"rendered":"\n<p class=\"has-text-align-right\"><em>\u91cd\u70b9\u662f\u907f\u5751\u548c\u5751\uff01<\/em><\/p>\n\n\n\n<p>\u539f\u6765\u6536\u85cf\u8fc7\u4e00\u7bc7\u7528\u6811\u8393\u6d3e+Python+OpenCV\u5b9e\u73b0\u76d1\u63a7\u548c\u52a8\u4f5c\u68c0\u6d4b\u7684<a href=\"http:\/\/python.jobbole.com\/81645\/\">\u4e2d\u6587\u7ffb\u8bd1\u6587\u7ae0<\/a>\uff0c<a href=\"https:\/\/www.pyimagesearch.com\/2015\/05\/25\/basic-motion-detection-and-tracking-with-python-and-opencv\/\">\u539f\u6587<\/a>\u548c\u8bd1\u6587\u5199\u5f97\u53ef\u8bfb\u6027\u90fd\u5f88\u4e0d\u9519\u3002\u53ef\u60dc\u539f\u6587\u5df2\u7ecf404\u4e86\uff0c\u53ea\u597d\u627e\u4e86\u4e24\u4e2a\u8f6c\u8f7d\u7684\u5f53\u5907\u4efd<\/p>\n\n\n\n<p style=\"font-size:11px\"><a href=\"https:\/\/blog.ggrarea.cn\/archives\/1807.html\">https:\/\/blog.ggrarea.cn\/archives\/1807.html<\/a><\/p>\n\n\n\n<p>\u4ee5\u53ca<\/p>\n\n\n\n<p style=\"font-size:11px\"><a href=\"https:\/\/noahzhy.github.io\/2018\/02\/02\/%E7%94%A8-Python-%E5%92%8C-OpenCV-%E6%A3%80%E6%B5%8B%E5%92%8C%E8%B7%9F%E8%B8%AA%E8%BF%90%E5%8A%A8%E5%AF%B9%E8%B1%A1\/\">https:\/\/noahzhy.github.io\/2018\/02\/02\/%E7%94%A8-Python-%E5%92%8C-OpenCV-%E6%A3%80%E6%B5%8B%E5%92%8C%E8%B7%9F%E8%B8%AA%E8%BF%90%E5%8A%A8%E5%AF%B9%E8%B1%A1\/<\/a><\/p>\n\n\n\n<p><s>\u5176\u4e2d\u7684\u5b8c\u6574Python\u4ee3\u7801\u53ef\u4ee5\u5728<\/s><\/p>\n\n\n\n<p style=\"font-size:11px\"><a href=\"https:\/\/gist.github.com\/vishvanand\/60afc7b998d885df66e9c4f07cf57ab0\"><s>https:\/\/gist.github.com\/vishvanand\/60afc7b998d885df66e9c4f07cf57ab0<\/s><\/a> <\/p>\n\n\n\n<p><s>\u83b7\u5f97<\/s>\uff08\u4ee3\u7801\u548c\u539f\u6587\u6709\u533a\u522b\uff0c\u8bf7\u76f4\u63a5\u5230<a href=\"https:\/\/www.pyimagesearch.com\/2015\/05\/25\/basic-motion-detection-and-tracking-with-python-and-opencv\/\">\u539f\u6587<\/a>\u590d\u5236\u4ee3\u7801\u5427\uff09<\/p>\n\n\n\n<p>\u60f3\u8d77\u6765\u641e\u8fd9\u4e2a\u662f\u56e0\u4e3a\u6700\u8fd1\u60f3\u5b66\u70b9\u65b0\u7684\u4e1c\u897f\uff0c\u53c8\u60f3\u5229\u7528\u628a\u5403\u7070\u7684\u6811\u8393\u6d3e2B\u5229\u7528\u8d77\u6765\uff0c\u5c31\u53bb\u4e70\u4e86\u6444\u50cf\u5934\u3002<\/p>\n\n\n\n<p>\u7136\u540e\u5c31\u5f00\u59cb\u4e86\u4e0d\u65ad\u7684\u8e29\u5751\u548c\u586b\u5751\u2026\u2026&amp;\uff08%&amp;\u2026\u2026\u00a5%%\u2026\u2026\u00a5%\u2026\u2026<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"has-vivid-cyan-blue-color has-text-color has-medium-font-size wp-block-heading\">\u5347\u7ea7PIP<\/h2>\n\n\n\n<p>\u53c2\u7167\u6587\u6863\u7b2c\u4e00\u6b65<code>pip install imutils<\/code>\u548c<code>pip install opencv-python<\/code>\u5c31\u5931\u8d25\u4e86\uff0c\u6811\u8393\u6d3e\u4e0a\u7684pip\u592a\u8001\u4e86\uff0c\u8981\u5347\u7ea7\u3002\u4f46\u662f<code>pip install pip -U<\/code>\u7684\u65b9\u5f0f\u81ea\u5347\u7ea7\u4e5f\u4e0d\u80fd\u6210\u529f\u3002\u901a\u8fc7apt\u5378\u8f7d\u518d\u5b89\u88c5\u4e5f\u4f9d\u65e7\u662f\u4e4b\u524d\u7684pip\u7248\u672c\u3002<\/p>\n\n\n\n<p>\u6700\u540e\u7684\u6210\u529f\u7684\u65b9\u6848\u662f<code>apt remove python-pip<\/code>\u5378\u8f7d\uff0c\u7136\u540e\u901a\u8fc7\u5b98\u65b9get-pip.py\u811a\u672c\u5b89\u88c5\u6210\u529f\u3002\u8fd9\u4e2d\u95f4\u53c8\u78b0\u5230\u4e86\u7cfb\u7edf\u4e2dca-bundle\u592a\u8001\uff0c\u4e0d\u80fd\u4fe1\u4efb\u5f88\u591a\u670d\u52a1\u7aef\u8bc1\u4e66\u7684\u95ee\u9898\u3002<\/p>\n\n\n\n<p>\u6700\u540e\u4f7f\u7528<code>pip install --trusted-host pypi.tuna.tsinghua.edu.cn opencv-python<\/code>\u7684\u65b9\u5f0f\u53ef\u4ee5\u4fe1\u4efb\u8bc1\u4e66\uff08\u8fd9\u4e2a\u65b9\u5f0f\u9002\u7528\u4e8e\u7248\u672c &gt;= 20.x \u7684pip\u3002\u53e6\u5916\uff0c\u8fd9\u91cc<meta charset=\"utf-8\">&#8211;trusted-host\u540e\u9762\u8ddf\u7684\u662f\u5df2\u914d\u7f6e\u7684pypi\u6e90\u5730\u5740\uff09<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"has-vivid-cyan-blue-color has-text-color wp-block-heading\">\u5b89\u88c5OpenCV<\/h2>\n\n\n\n<p>\u4e8b\u60c5\u8fd8\u6ca1\u5b8c\uff0c\u4f60\u4ee5\u4e3a<meta charset=\"utf-8\"><code>pip install --trusted-host pypi.tuna.tsinghua.edu.cn opencv-python<\/code>\u5c31\u80fd\u6210\u529f\u5b89\u88c5opencv\u4e86\u5417\uff1f\u90a3\u4f60\u5c31too young\u4e86\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/windywind.tk\/wp-content\/uploads\/2021\/12\/image.png\"><img loading=\"lazy\" decoding=\"async\" width=\"601\" height=\"377\" src=\"https:\/\/windywind.tk\/wp-content\/uploads\/2021\/12\/image.png\" alt=\"\" class=\"wp-image-465\" srcset=\"https:\/\/windywind.tk\/wp-content\/uploads\/2021\/12\/image.png 601w, https:\/\/windywind.tk\/wp-content\/uploads\/2021\/12\/image-300x188.png 300w\" sizes=\"(max-width: 601px) 100vw, 601px\" \/><\/a><\/figure>\n\n\n\n<p>\u6709\u4e00\u4e2a\u4e8b\u60c5\u662fNumPy\uff08OpenCV\u7684\u4f9d\u8d56\u5305\uff09\u505c\u6b62\u4e86\u5bf9Python 2.x\u7684\u652f\u6301\uff0c\u8981\u5b89\u88c5\u4e5f\u5f97\u7528<code>pip3 install <meta charset=\"utf-8\">opencv-python<\/code>\u3002<\/p>\n\n\n\n<p>\u518d\u770b\u770b\u8fd9\u7f16\u8bd1\u65e5\u5fd7\uff0c\u62a0\u811a\u60f3\u8c61\u6811\u8393\u6d3e2B\u7684\u6027\u80fd\uff08\u7b49\u4e86\u534a\u5929\uff0c\u6211\u60f3\u8fde\u4e0a4B\u53bb\u5b89\u88c5\u8bd5\u8bd5\uff0c\u7ed3\u679c\u540e\u5f00\u59cb\u76844B\u8fdb\u5ea6\u6bd42B\u5feb\uff0c\u5148\u8df3<code>Installing build dependencies<\/code><\/p>\n\n\n\n<p>\u65e0\u610f\u95f4\u770b\u5230\u6709\u53e6\u5916\u4e00\u4e2a\u65b9\u6cd5\u53ef\u4ee5\u5b89\u88c5OpenCV\uff0c\u5c31\u662f\u901a\u8fc7<code>apt-get install python-opencv<\/code>\uff0c\u7ed3\u679c\u79d2\u79d2\u949f\u5b8c\u6210\u2026\u2026<\/p>\n\n\n\n<p>\u8fdb\u5165\u4ea4\u4e92\u5f0f\u7684Python CLI\uff0c\u6267\u884c\u524d\u9762\u51e0\u4e2aimport\u90fd\u4e0d\u62a5\u9519\u4e86\uff0c\u5dee\u70b9\u54ed\u4e86\u2026\u2026<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><a href=\"https:\/\/windywind.tk\/wp-content\/uploads\/2021\/12\/image-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"585\" height=\"144\" src=\"https:\/\/windywind.tk\/wp-content\/uploads\/2021\/12\/image-1.png\" alt=\"\" class=\"wp-image-468\" srcset=\"https:\/\/windywind.tk\/wp-content\/uploads\/2021\/12\/image-1.png 585w, https:\/\/windywind.tk\/wp-content\/uploads\/2021\/12\/image-1-300x74.png 300w\" sizes=\"(max-width: 585px) 100vw, 585px\" \/><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u91cd\u70b9\u662f\u907f\u5751\u548c\u5751\uff01 \u539f\u6765\u6536\u85cf\u8fc7\u4e00\u7bc7\u7528\u6811\u8393\u6d3e+Python+OpenCV\u5b9e\u73b0\u76d1\u63a7\u548c\u52a8\u4f5c\u68c0\u6d4b\u7684\u4e2d\u6587\u7ffb\u8bd1\u6587\u7ae0\uff0c\u539f\u6587\u548c\u8bd1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-464","post","type-post","status-publish","format-standard","hentry","category-2"],"_links":{"self":[{"href":"https:\/\/windywind.tk\/index.php?rest_route=\/wp\/v2\/posts\/464"}],"collection":[{"href":"https:\/\/windywind.tk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/windywind.tk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/windywind.tk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/windywind.tk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=464"}],"version-history":[{"count":5,"href":"https:\/\/windywind.tk\/index.php?rest_route=\/wp\/v2\/posts\/464\/revisions"}],"predecessor-version":[{"id":471,"href":"https:\/\/windywind.tk\/index.php?rest_route=\/wp\/v2\/posts\/464\/revisions\/471"}],"wp:attachment":[{"href":"https:\/\/windywind.tk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=464"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/windywind.tk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=464"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/windywind.tk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=464"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}