{"id":2927,"date":"2017-12-08T14:05:59","date_gmt":"2017-12-08T05:05:59","guid":{"rendered":"http:\/\/www.ois-yokohama.co.jp\/oisblog\/?p=2927"},"modified":"2022-09-28T13:28:27","modified_gmt":"2022-09-28T04:28:27","slug":"opencv%e3%81%ab%e3%82%88%e3%82%8b%e9%a1%94%e8%aa%8d%e8%ad%98","status":"publish","type":"post","link":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/archives\/2927","title":{"rendered":"OpenCV\u306b\u3088\u308b\u9854\u8a8d\u8b58"},"content":{"rendered":"<div class=\"veu_autoEyeCatchBox\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"500\" src=\"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2017\/12\/iPhonexIMGL6249_TP_V-1024x682.jpg\" class=\"attachment-large size-large wp-post-image\" alt=\"\" srcset=\"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2017\/12\/iPhonexIMGL6249_TP_V-1024x682.jpg 1024w, https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2017\/12\/iPhonexIMGL6249_TP_V-300x200.jpg 300w, https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2017\/12\/iPhonexIMGL6249_TP_V-768x512.jpg 768w, https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2017\/12\/iPhonexIMGL6249_TP_V.jpg 1600w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/div>\n<p>\u7a7a\u6e2f\u3084iPhone\u306a\u3069\u3067\u3001\u9854\u8a8d\u8a3c\u304c\u4f7f\u308f\u308c\u3066\u304a\u308a\u307e\u3059\u304c\u3001<br \/>\n\u5199\u771f\u3084\u52d5\u753b\u306a\u3069\u304b\u3089\u7c21\u5358\u306b\u9854\u8a8d\u8b58\u304c\u3067\u304d\u308b<strong>OpenCV<\/strong>\u306b\u3064\u3044\u3066\u3001\u3054\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2936 size-large\" src=\"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2017\/12\/iPhonexIMGL6249_TP_V-1024x682.jpg\" alt=\"iPhonexIMGL6249_TP_V\" width=\"750\" height=\"500\" srcset=\"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2017\/12\/iPhonexIMGL6249_TP_V-1024x682.jpg 1024w, https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2017\/12\/iPhonexIMGL6249_TP_V-300x200.jpg 300w, https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2017\/12\/iPhonexIMGL6249_TP_V-768x512.jpg 768w, https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2017\/12\/iPhonexIMGL6249_TP_V.jpg 1600w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3>\u307e\u305a\u3001\u300e<strong>OpenCV<\/strong>\u300f\u3068\u306f\u3001\u4f55\u304b\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<\/h3>\n<p>OpenCV\uff08\u6b63\u5f0f\u540d\u79f0\uff1a Open Source Computer Vision Library\uff09\u306f\u3001<br \/>\n\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u30fc\u30fb\u30d3\u30b8\u30e7\u30f3\u30fb\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002<\/p>\n<p>\u753b\u50cf\u3084\u52d5\u753b\u3092\u51e6\u7406\u3059\u308b\u306e\u306b\u5fc5\u8981\u306a\u3001\u3055\u307e\u3056\u307e\u6a5f\u80fd\u304c\u5b9f\u88c5\u3055\u308c\u3066\u304a\u308a\u3001\u30e9\u30a4\u30bb\u30f3\u30b9\u3067\u914d\u5e03\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304b\u3089\u5b66\u8853\u7528\u9014\u3060\u3051\u3067\u306a\u304f\u5546\u7528\u76ee\u7684\u3067\u3082\u5229\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u30de\u30eb\u30c1\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u306b\u5bfe\u5fdc\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\nOpenCV\u3092\u4f7f\u3046\u3068\u3001\u30d5\u30a3\u30eb\u30bf\u30fc\u51e6\u7406\u3084\u884c\u5217\u6f14\u7b97\u3001\u7269\u4f53\u8a8d\u8b58\u306a\u3069\u3001\u3055\u307e\u3056\u307e\u306a\u6a5f\u80fd\u3092\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u3001\u3068\u3066\u3082\u4fbf\u5229\u3067\u3059\u3002<\/p>\n<p>\u30b5\u30dd\u30fc\u30c8OS\u306f\u3001Windows\u3001Linux\u3001Mac OS\u306a\u3069\u3001\u69d8\u3005\u306aOS\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>iOS\u3084Android\u306b\u3082\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001\u30e2\u30d0\u30a4\u30eb\u7aef\u672b\u5411\u3051\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u3082\u5229\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>OpenCV 3.0\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u8a00\u8a9e\u304c\u516c\u5f0f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u00a0C\uff08\u65e2\u5b58\u306eI\/F\uff08\uff1d\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\uff09\u306f\u6b8b\u3063\u3066\u3044\u308b\u304c\u30013.0\u304b\u3089\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u5bfe\u8c61\u5916\uff09<\/li>\n<li>\u00a0C++<\/li>\n<li>\u00a0Python<\/li>\n<li>\u00a0Java<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3>\u3067\u306f\u3001\u74b0\u5883\u69cb\u7bc9\u3092\u884c\u3044\u307e\u3059\u3002<\/h3>\n<p>\u4eca\u56de\u306f\u3001<strong>WinPython<\/strong>\u3092\u4f7f\u7528\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>WinPython\u3092\u4f7f\u7528\u3059\u308b\u3068\u5fc5\u8981\u306a\u3082\u306e\u4e00\u5f0f\u3092Windows\u306b\u7c21\u5358\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e2\u3064\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u3001\u6e96\u5099\u3057\u307e\u3059<br \/>\n\u203b\u74b0\u5883\u306b\u3088\u308a\u300132bit\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u304d\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<ul>\n<li>\u00a0opencv_python\u0011 3.1.0\u0011 cp34\u0011 cp34m\u0011 win_amd64.whl<\/li>\n<li>\u00a0WinPython-64bit-3.4.4.6Qt5<\/li>\n<\/ul>\n<p>WinPython Control Panel\u304b\u3089whl\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a\u3057\u3066Install Packages\u3092\u30af\u30ea\u30c3\u30af\u3059\u308c\u3070\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<p>\u74b0\u5883\u306b\u3088\u308a\u3001\u3046\u307e\u304f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u306a\u3044\u5834\u5408\u3001\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u3067\u8abf\u3079\u308b\u3068\u591a\u304f\u306e\u60c5\u5831\u304c\u51fa\u3066\u304d\u307e\u3059\u306e\u3067\u3001\u53c2\u8003\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u3067\u304d\u307e\u3057\u305f\u3089\u3001\u52d5\u4f5c\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u306b\u3042\u308bSpyder.exe\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u8cbc\u308a\u4ed8\u3051\u3066\u52d5\u4f5c\u3055\u305b\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u30ab\u30e1\u30e9\u304c\u8d77\u52d5\u3057\u305f\u3089\u6210\u529f\u3067\u3059\u3002<\/p>\n<p>test.py<br \/>\n\u2015\u2015\u2015\u2015\u2015\u2015<\/p>\n<pre class=\"lang:default highlight:0 decode:true\">import cv2\r\nimport time\r\nwindow = \"push ESC key to stop this program\"\r\nif(__name__ == '__main__'):\r\n# \u30c7\u30d5\u30a9\u30eb\u30c8\u30ab\u30e1\u30e9\u306f0\r\ncapture = cv2.VideoCapture(0)\r\n# \u30ad\u30e3\u30d7\u30c1\u30e3\u51e6\u7406\r\nwhile(True):\r\nkey = cv2.waitKey(1)\r\nif(key == 27):\r\nprint(\"close.\")\r\nbreak\r\n# \u753b\u50cf\u30ad\u30e3\u30d7\u30c1\u30e3\r\nret, img = capture.read()\r\n# \u53d6\u308a\u8fbc\u307f\u958b\u59cb\u306b\u306a\u3063\u3066\u3044\u306a\u304b\u3063\u305f\u3089\u3084\u308a\u306a\u304a\u3057\r\nif(ret == False):\r\nprint(\"Capture Failed.\")\r\nbreak\r\ncv2.imshow(window, img)\r\ntime.sleep(0.050)\r\ncapture.release()\r\ncv2.destroyAllWindows()<\/pre>\n<p>\u2015\u2015\u2015\u2015\u2015\u2015<\/p>\n<p>\u9854\u8a8d\u8b58\u306f\u3001\u4e0a\u8a18\u306e\u51e6\u7406\u3092\u5c11\u3057\u4fee\u6b63\u3059\u308c\u3070\u3001\u52d5\u4f5c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u9854\u8a8d\u8b58\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306b\u3064\u3044\u3066\u306f\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305fOpenCV\u306e\u30d5\u30a9\u30eb\u30c0\u5185\u306b\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u78ba\u8a8d\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u307e\u305f\u3001\u4ed6\u306e\u8a00\u8a9e\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3084\u753b\u50cf\u3001\u52d5\u753b\u3082\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u8272\u3005\u306a\u74b0\u5883\u3092\u8a66\u3059\u306b\u306f\u3068\u3066\u3082\u4fbf\u5229\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001python\u3092\u4f7f\u7528\u3057\u307e\u3057\u305f\u304c\u3001\u4ed6\u306e\u8a00\u8a9e\u3067\u3082\u3001\u57fa\u672c\u7684\u306b\u540c\u3058\u3088\u3046\u306a\u51e6\u7406\u306b<br \/>\n\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u79fb\u884c\u3082\u884c\u3044\u3084\u3059\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u4f7f\u7528\u65b9\u6cd5\u306a\u3069\u3001\u8a73\u7d30\u306a\u624b\u9806\u3084\u5b9f\u969b\u306e\u753b\u50cf\u306a\u3069\u8a18\u8f09\u3057\u3066\u3044\u307e\u305b\u3093\u304c\u3001<br \/>\n\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u4e0a\u306b\u306f\u3001OpenCV\u306b\u95a2\u3057\u3066\u3001\u8272\u3005\u306a\u60c5\u5831\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u53c2\u8003\u306b\u3057\u3066\u4f7f\u7528\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u307f\u306a\u3055\u3093\u3082\u3001\u4e00\u5ea6\u3001OpenCV\u3092\u4f7f\u7528\u3057\u3066\u9854\u8a8d\u8b58\u3092\u8a66\u3057\u3066\u307f\u3066\u306f\u5982\u4f55\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<hr \/>\n<p>\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u3000<a href=\"http:\/\/www.ois-yokohama.co.jp\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"color: #000000;\">http:\/\/www.ois-yokohama.co.jp<\/span><\/a><br \/>\nfacebook\u3000\u3000\u3000<a href=\"https:\/\/www.facebook.com\/orientalinformationservice\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"color: #000000;\">https:\/\/www.facebook.com\/orientalinformationservice\/<\/span><\/a>]]&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7a7a\u6e2f\u3084iPhone\u306a\u3069\u3067\u3001\u9854\u8a8d\u8a3c\u304c\u4f7f\u308f\u308c\u3066\u304a\u308a\u307e\u3059\u304c\u3001 \u5199\u771f\u3084\u52d5\u753b\u306a\u3069\u304b\u3089\u7c21\u5358\u306b\u9854\u8a8d\u8b58\u304c\u3067\u304d\u308bOpenCV\u306b\u3064\u3044\u3066\u3001\u3054\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002 &nbsp; &nbsp; \u307e\u305a\u3001\u300eOpenCV\u300f\u3068\u306f\u3001\u4f55\u304b\u3092\u8aac\u660e\u3057\u307e\u3059\u3002 O [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2936,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"vkexunit_cta_each_option":"","footnotes":""},"categories":[114,6],"tags":[295,296,297,298,299,300],"class_list":["post-2927","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-114","category-engineer","tag-bsd","tag-open-source-computer-vision-library","tag-opencv","tag-opencv-3-0","tag-winpython","tag-300"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/posts\/2927","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/comments?post=2927"}],"version-history":[{"count":3,"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/posts\/2927\/revisions"}],"predecessor-version":[{"id":8018,"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/posts\/2927\/revisions\/8018"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/media\/2936"}],"wp:attachment":[{"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/media?parent=2927"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/categories?post=2927"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/tags?post=2927"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}