{"id":2418,"date":"2021-10-16T17:54:12","date_gmt":"2021-10-16T08:54:12","guid":{"rendered":"https:\/\/mattyan.net\/blog\/?p=2418"},"modified":"2021-10-16T17:54:12","modified_gmt":"2021-10-16T08:54:12","slug":"python%e3%81%a7%e6%84%8f%e5%9c%b0%e3%81%a7%e3%82%82opencv%e3%81%97%e3%81%9f%e3%81%84","status":"publish","type":"post","link":"https:\/\/mattyan.net\/blog\/?p=2418","title":{"rendered":"python\u3067\u610f\u5730\u3067\u3082OpenCV\u3057\u305f\u3044"},"content":{"rendered":"<p>python\u3067OpenCV\u3057\u3088\u3046\u3068\u3057\u305f\u3051\u3069\u3001\u3046\u307e\u304f\u884c\u304b\u306a\u304b\u3063\u305f\u306e\u3067\u7121\u7406\u3084\u308a\u8272\u3005\u8a66\u3057\u3066\u307f\u305f\u30e1\u30e2<\/p>\n<p><!--more--><\/p>\n<h2 id=\"\u3082\u3068\u3082\u3068\u306e\u74b0\u5883\">\u3082\u3068\u3082\u3068\u306e\u74b0\u5883<\/h2>\n<ul class=\"incremental\">\n<li>python 3.10(Scoop\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3082\u306e)<\/li>\n<li>python 3.8(msys2\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3082\u306e)<\/li>\n<\/ul>\n<h2 id=\"\u7d4c\u7def\">\u7d4c\u7def<\/h2>\n<p>venv\u3057\u305f\u74b0\u5883\u306epip\u3067opencv-python\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3088\u3046\u3068\u3057\u305f\u304c\u3001numpy1.19.3\u304c\u898b\u3064\u304b\u3089\u306a\u3044\u3068\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u3002 \u8a66\u3057\u306bnumpy\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3088\u3046\u3068\u3057\u305f\u3068\u3053\u308d\u3001\u30d3\u30eb\u30c9\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3002\u304b\u306a\u308a\u9577\u3044\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3068\u30b3\u30fc\u30c9\u3092\u9811\u5f35\u3063\u3066\u8aad\u3093\u3060\u3068\u3053\u308d\u3001<a href=\"https:\/\/github.com\/numpy\/numpy\/commit\/4b914538a2fbabe1715493f325ad930735e025c9#diff-ab247da2c2dc88d3a095d1840196120498a4dd9444d7399c05f661e8b9640ff9\">\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u51fa\u529b\u90e8\u5206\u3067\u30d0\u30b0\u304c\u3042\u3063\u3066<\/a>\u3001\u305d\u3053\u3067\u6b62\u307e\u3063\u305f\u307f\u305f\u3044\u3002<\/p>\n<p>\u3068\u306f\u3044\u3048opencv-python\u304c\u3053\u308c\u3092\u8981\u6c42\u3057\u3066\u308b\u306e\u3067\u3001\u610f\u5730\u3067\u3082\u5165\u308c\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u2026\u2026\u3068\u3044\u3046\u308f\u3051\u3067\u3053\u306e\u30d0\u30b0\u3060\u3051\u624b\u4f5c\u696d\u3067\u4fee\u6b63\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u8a66\u307f\u305f\u3002<\/p>\n<h2 id=\"\u4fee\u6b63\">\u4fee\u6b63<\/h2>\n<p><a href=\"https:\/\/pypi.org\/project\/numpy\/1.19.3\/#files\">pypi\u306enumpy\u306e\u30da\u30fc\u30b8<\/a>\u304b\u30891.19.3-cp39-cp39-win32_amd64.whl\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3002\u3053\u308c\u306f\u62e1\u5f35\u5b50\u304c\u9055\u3046\u3060\u3051\u306ezip\u30d5\u30a1\u30a4\u30eb\u306a\u306e\u3067\u3001unzip\u3067\u5c55\u958b\u3002\u4fee\u6b63\u7b87\u6240\u3082\u308f\u304b\u3063\u3066\u308b\u306e\u3067\u30b5\u30af\u30c3\u3068\u4fee\u6b63\u3002<\/p>\n<p>\u4fee\u6b63\u3057\u305f\u3082\u306e\u3092<code class=\"\" data-line=\"\">zip numpy-1.19.3-cp39-cp39-win_amd64.whl numpy numpy-1.19.3.dist-info\/<\/code>\u3067\u5727\u7e2e\u3057\u3066whl\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3002<\/p>\n<h2 id=\"python\u5165\u308c\u76f4\u3057\">python\u5165\u308c\u76f4\u3057<\/h2>\n<p>\u3082\u3068\u3082\u3068Windows\u306e\u30bf\u30fc\u30df\u30ca\u30eb\u304b\u3089\u306f\u898b\u3048\u306a\u3044msys2\u306epython\u306f\u3068\u3082\u304b\u304f\u3001Scoop\u3067\u5165\u308c\u305fpython\u304c\u3059\u3067\u306b\u30d0\u30fc\u30b8\u30e7\u30f33.10\u3067\u3053\u306e\u307e\u307e\u3067\u306f\u4f7f\u3048\u306a\u3044(pip\u304ccp39-cp39-win_amd64\u306f\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u306a\u3044\u3068\u30a8\u30e9\u30fc\u3092\u8fd4\u3057\u305f)\u306e\u3067\u3001\u4e00\u65e6<code class=\"\" data-line=\"\">Scoop uninstall python<\/code>\u3067python\u3092\u6d88\u3057\u3066\u3001 <code class=\"\" data-line=\"\">Scoop bucket add versions<\/code>\u3067\u904e\u53bb\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u4f7f\u3048\u308b\u3088\u3046\u306b\u3057\u3066\u3001<code class=\"\" data-line=\"\">Scoop install python39<\/code>\u3067python3.9\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n<h2 id=\"numpy\u3068opencv-python\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\">numpy\u3068opencv-python\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p><code class=\"\" data-line=\"\">pip install  D:\\numpy\\numpy-1.19.3-cp39-cp39-win_amd64.whl<\/code>\u3067\u4fee\u6b63\u3057\u305fnumpy\u3092\u76f4\u63a5\u6307\u5b9a\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n<p>python\u3067<\/p>\n<pre class=\"lang:python\"><code class=\"\" data-line=\"\">import numpy<\/code><\/pre>\n<p>\u3068\u5165\u308c\u3066\u30a8\u30e9\u30fc\u306b\u306a\u3089\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u6210\u529f\u3002<\/p>\n<p>\u305d\u306e\u307e\u307e\u52e2\u3044\u3067<code class=\"\" data-line=\"\">pip install opencv-python<\/code>\u3067OpenCVPython\u3082\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n<pre class=\"lang:python\"><code class=\"\" data-line=\"\">import cv2\ncapture = cv2.VideoCapture(0)\nret, frame = capture.read()\ncv2.imshow(&#039;frame&#039;, frame)\ncv2.waitKey(0)\ncapture.release()\ncv2.destroyAllWindows()<\/code><\/pre>\n<p>\u30ab\u30e1\u30e9\u3067\u30ad\u30e3\u30d7\u30c1\u30e3\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u52d5\u3044\u305f\u306e\u3067\u3001\u3053\u3063\u3061\u3082\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u6210\u529f\u3002 \u3055\u3041\u3066\u66f8\u304d\u305f\u3044\u3082\u306e\u66f8\u3044\u3066\u307f\u308b\u304b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>python\u3067OpenCV\u3057\u3088\u3046\u3068\u3057\u305f\u3051\u3069\u3001\u3046\u307e\u304f\u884c\u304b\u306a\u304b\u3063\u305f\u306e\u3067\u7121\u7406\u3084\u308a\u8272\u3005\u8a66\u3057\u3066\u307f\u305f\u30e1\u30e2<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-2418","post","type-post","status-publish","format-standard","hentry","category-3"],"_links":{"self":[{"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2418","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2418"}],"version-history":[{"count":0,"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2418\/revisions"}],"wp:attachment":[{"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}