{"id":127,"date":"2020-04-22T22:34:25","date_gmt":"2020-04-22T14:34:25","guid":{"rendered":"http:\/\/iotch.xyz\/?p=127"},"modified":"2020-04-22T22:34:25","modified_gmt":"2020-04-22T14:34:25","slug":"%e8%ae%b0%e4%b8%80%e6%ac%a1%e9%9d%9e%e5%b8%b8%e6%8d%89%e9%b8%a1%e7%9a%84opencv%e5%ae%89%e8%a3%85%e8%bf%87%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.iotch.xyz\/?p=127","title":{"rendered":"\u8bb0\u4e00\u6b21\u975e\u5e38\u6349\u9e21\u7684OpenCV\u5b89\u88c5\u8fc7\u7a0b"},"content":{"rendered":"\n<ol class=\"wp-block-list\" start=\"0\"><li>\u73af\u5883<\/li><li>\u7b2c\u4e00\u6b21\u51fa\u9519<br>1.1 make\u63d0\u793a<br>1.2 make\u62a5\u9519<br>1.3 \u5c1d\u8bd5<br>1.4 \u89e3\u51b31<\/li><li>\u7b2c\u4e8c\u6b21\u51fa\u9519<br>2.1 cmake\u62a5\u9519<br>2.2 \u89e3\u51b3<\/li><\/ol>\n\n\n\n<p>\u7531\u4e8e\u6362\u7535\u8111\u3001\u91cd\u88c5\u7cfb\u7edf\u3001\u7cfb\u7edf\u5954\u6e83\u3001\u6362\u56fa\u6001\uff0c\u4e0d\u5230\u4e00\u5e74\u5df2\u7ecf\u91cd\u88c5OpenCV\u4e0d\u4e0b\u5341\u6b21\u4e86\uff0c\u672c\u4ee5\u4e3a\u88c5\u4e86\u8fd9\u4e48\u591a\u6b21\u5e94\u8be5\u6ca1\u4ec0\u4e48\u95ee\u9898\u4e86\uff0c\u53ef\u6700\u5954\u6e83\u7684\u662f\u51e0\u4e4e\u6bcf\u6b21\u90fd\u4f1a\u51fa\u9519\uff0c\u800c\u4e14\u51fa\u7684\u9519\u6bcf\u6b21\u90fd\u4e0d\u4e00\u6837\uff0c\u5fc3\u75bc\u81ea\u5df1\u3002\u3002\u3002\u628a\u8fd9\u6b21\u51fa\u73b0\u7684\u95ee\u9898\u8bb0\u5f55\u4e00\u4e0b\u3002<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"0\"><li>\u73af\u5883<\/li><\/ol>\n\n\n\n<p>ubuntu14.04<br>opencv3.3.1<br>opencv_contrib-3.3.1<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>\u7b2c\u4e00\u6b21\u51fa\u9519<\/li><\/ol>\n\n\n\n<p>1.1 make\u63d0\u793a<\/p>\n\n\n\n<p>Failed to download tiny-dnn sources<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>-- Looking for tiny_dnn.h<br>-- Looking for tiny_dnn.h - not found<br>-- Module opencv_dnn_modern disabled because tiny-dnn was not found<br>-- checking for one of the modules 'freetype2'<br>-- checking for one of the modules 'harfbuzz'<br>-- freetype2: NO<br>-- harfbuzz: NO<br>-- Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_INCLUDE_DIRS)<br>-- No preference for use of exported gflags CMake configuration set, and no hints for include\/library directories provided. Defaulting to preferring an installed\/exported gflags CMake configuration if available.<br>-- Failed to find installed gflags CMake configuration, searching for gflags build directories exported with CMake.<br>-- Failed to find gflags - Failed to find an installed\/exported CMake configuration for gflags, will perform search for installed gflags components.<br>-- Failed to find gflags - Could not find gflags include directory, set GFLAGS_INCLUDE_DIR to directory containing gflags\/gflags.h<br>-- Failed to find glog - Could not find glog include directory, set GLOG_INCLUDE_DIR to directory containing glog\/logging.h<br>-- Module opencv_sfm disabled because the following dependencies are not found: Eigen Glog\/Gflags<br>-- checking for modules 'tesseract;lept'<br>-- package 'tesseract' not found<br>-- package 'lept' not found<br>-- Tesseract: NO<br>-- xfeatures2d\/boostdesc: Download: boostdesc_bgm.i<br>CMake Warning at ~\/workspace\/opencv\/opencv-master\/cmake\/OpenCVDownload.cmake:170 (message):<br>xfeatures2d\/boostdesc: Download failed: 1;\"Unsupported protocol\"<br>Call Stack (most recent call first):<br>~\/workspace\/opencv_contrib-master\/modules\/xfeatures2d\/cmake\/download_boostdesc.cmake:22 (ocv_download)<br>~\/workspace\/opencv_contrib-master\/modules\/xfeatures2d\/CMakeLists.txt:8 (download_boost_descriptors)12345678910111213141516171819202122232425<\/p><\/blockquote>\n\n\n\n<p>1.2 make\u62a5\u9519<\/p>\n\n\n\n<p>In file included from ~\/workspace\/opencv\/opencv-master\/modules\/stitching\/include\/opencv2\/stitching.hpp:49:0,<br>from ~\/workspace\/opencv\/opencv-master\/modules\/stitching\/src\/precomp.hpp:59,<br>from ~\/workspace\/build\/modules\/stitching\/opencv_stitching_pch_dephelp.cxx:1:<br>~\/workspace\/opencv\/opencv-master\/modules\/stitching\/include\/opencv2\/stitching\/detail\/matchers.hpp:52:42: fatal error: opencv2\/xfeatures2d\/cuda.hpp: No such file or directory<br># include \"opencv2\/xfeatures2d\/cuda.hpp\"<br>^123456<\/p>\n\n\n\n<p>1.3 \u5c1d\u8bd5<\/p>\n\n\n\n<p>\u2460\u770b\u4e86cmake\u65f6\u7684\u63d0\u793a\uff0c\u4f30\u8ba1\u662fopencv_contrib-3.3.1\/modules\/dnn_modern \u4e2d\u6587\u4ef6\u4e0b\u8f7d\u51fa\u9519\uff0c\u4e8e\u662f\u53c2\u8003\u7f51\u4e0a\u7684\u65b9\u6cd5\u79bb\u7ebf\u4e0b\u8f7d\u653e\u5165\u5bf9\u5e94\u7684\u8def\u5f84\u4e2d\uff0c\u4f46\u8fd8\u662f\u6ca1\u6709\u89e3\u51b3\u3002\u53c8\u6000\u7591\u662f\u7f51\u7edc\u95ee\u9898\u66f4\u6362\u4e86\u56fd\u5916\u7684\u6e90\uff0c\u5e76\u542f\u7528\u4e86\u4ee3\u7406\uff0c\u4e5f\u662f\u6ca1\u6709\u4e0b\u8f7d\u6210\u529f\u3002<\/p>\n\n\n\n<p>\u2461\u53c8\u6839\u636emake\u65f6\u62a5\u9519\u7684\u63d0\u793a\uff0c\u60f3\u53ef\u80fd\u65f6cuda\u7684\u56e0\u7d20\uff0c\u5c1d\u8bd5\u4e0d\u542f\u7528\u4e5f\u6ca1\u6709\u89e3\u51b3\u3002<\/p>\n\n\n\n<p>1.4 \u89e3\u51b31<\/p>\n\n\n\n<p>cmake\u8fc7\u7a0b\u4e2d\u4f1a\u4e0b\u8f7d\u5f88\u591a\u9700\u8981\u7684\u6587\u4ef6\uff0c\u6ca1\u6709\u4e0b\u8f7d\u6210\u529f\u4e5f\u4e0d\u4f1a\u62a5\u9519\uff0c\u6240\u4ee5\u6ca1\u6ce8\u610f\u7684\u8bdd\u4e00\u822c\u5c31\u76f4\u63a5\u6267\u884c\u4e0b\u4e00\u6b65\u4e86\uff0c\u7136\u540emake\u65f6\u62a5\u9519\uff0c\u901a\u5e38\u6839\u636emake\u65f6\u7684\u63d0\u793a\u5bfb\u627e\u95ee\u9898\uff0c\u4f46\u5176\u5b9e\u6839\u6e90\u662f\u5728cmake\u65f6\u51fa\u73b0\u7684\uff0c\u6240\u4ee5\u5148\u89e3\u51b3cmake\u7684\u95ee\u9898\u3002<\/p>\n\n\n\n<p>\u53c2\u8003github\u4e0a\u7684issue\uff1ahttps:\/\/github.com\/opencv\/opencv_contrib\/issues\/1131<br>\u6709\u7f51\u53cb\u6839\u636e\u63d0\u793aDownload failed: 1;\"unsupported protocol\"\u8ba4\u4e3a\u662f\u56e0\u4e3a\u4e0b\u8f7d\u51fa\u9519\u5f15\u8d77\u7684\uff0c\u6240\u7528\u7684cmake\u7248\u672c\u6ca1\u6709\u652f\u6301HTTPS\uff0c\u4e8e\u662f\u91cd\u65b0\u5b89\u88c5\u4e86cmake\uff08\u4e4b\u524d\u7528\u7684\u65f63.11\u7248\u672c\uff0c\u7136\u540e\u5378\u8f7d\u6309\u4e0b\u9762\u7684\u65b9\u5f0f\u5b89\u88c5\u4e863.9.0\uff09<\/p>\n\n\n\n<p>wget --no-check-certificate https:\/\/cmake.org\/files\/v3.9\/cmake-3.9.0.tar.gz<br>tar -zxvf cmake-3.9.0.tar.gz<br>cd cmake-3.9.0<br>sudo apt-get install libcurl4-gnutls-dev<br>sudo apt-get install zlib1g-dev<br>.\/bootstrap --system-curl<br>sudo make &amp;&amp; sudo make install1234567<\/p>\n\n\n\n<p>\u5b89\u88c5\u5b8c\u4e4b\u540e\u7136\u540e\u91cd\u65b0cmake\uff0ccmake\u4e24\u904d\u770b\u51fa\u73b0\u7684\u95ee\u98982\uff08\u7b2c\u4e00\u904d\u51fa\u9519\u65f6\u4fe1\u606f\u592a\u591a\uff0c\u6ca1\u663e\u793a\u51fa\u9519\u7684\u5730\u65b9\uff0ccmake\u7b2c\u4e8c\u904d\uff09<br>\uff08\u5b89\u88c5\u652f\u6301HTTPS\u7684cmake\u4e0d\u662f\u76f4\u63a5\u89e3\u51b3\u95ee\u9898\uff0c\u800c\u662f\u53ef\u4ee5\u66f4\u6e05\u695a\u5730\u770b\u95ee\u9898\u7684\u6839\u6e90\uff09<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li>\u7b2c\u4e8c\u6b21\u51fa\u9519<\/li><\/ol>\n\n\n\n<p>2.1 cmake\u62a5\u9519<\/p>\n\n\n\n<p>Invalid escape sequence \\,<br>Call Stack (most recent call first):<br>\/home\/tank\/Programming\/opencv\/cmake\/OpenCVDownload.cmake:162 (ocv_download_log)<br>\/home\/tank\/Programming\/opencv_contrib\/modules\/xfeatures2d\/cmake\/download_boostdesc.cmake:22 (ocv_download)<br>\/home\/tank\/Programming\/opencv_contrib\/modules\/xfeatures2d\/CMakeLists.txt:8 (download_boost_descriptors)<\/p>\n\n\n\n<p>-- Configuring incomplete, errors occurred!<br>See also \"\/home\/tank\/Programming\/opencv\/build\/CMakeFiles\/CMakeOutput.log\".<br>See also \"\/home\/tank\/Programming\/opencv\/build\/CMakeFiles\/CMakeError.log\".12345678910<\/p>\n\n\n\n<p>2.2 \u89e3\u51b3<\/p>\n\n\n\n<p>Github\u4e0a\u6709\u7f51\u53cb\u6307\u51fa\u662f\u56e0\u4e3aOpenCVDownload.cmake\u5728\u65e5\u5fd7\u8bb0\u5f55\u529f\u80fd\u4e2d\u51fa\u73b0\u95ee\u9898\uff0c\u627e\u5230\u6587\u4ef6\uff5e\/opencv-3.3.1\/cmake\/OpenCVDownload.cmake<br>\u5c06\u4ee5\u4e0b\u4ee3\u7801<\/p>\n\n\n\n<p>macro(ocv_download_log)<br>file(APPEND \"${OPENCV_DOWNLOAD_LOG}\" \"${ARGN}\\n\")<br>endmacro()123<\/p>\n\n\n\n<p>\u4fee\u6539\u6210<\/p>\n\n\n\n<p>function(ocv_download_log)<br>file(APPEND \"${OPENCV_DOWNLOAD_LOG}\" \"${ARGN}\\n\")<br>endfunction()123<\/p>\n\n\n\n<p>\u7136\u540e\u91cd\u65b0cmake\uff0cmake\uff0cmake install \u6210\u529f\u3002<\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\">\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014<br>\u7248\u6743\u58f0\u660e\uff1a\u672c\u6587\u4e3aCSDN\u535a\u4e3b\u300c\u4e94\u5c0f\u90ce\u7684\u5b66\u4e60\u7b14\u8bb0\u300d\u7684\u539f\u521b\u6587\u7ae0\uff0c\u9075\u5faa CC 4.0 BY-SA \u7248\u6743\u534f\u8bae\uff0c\u8f6c\u8f7d\u8bf7\u9644\u4e0a\u539f\u6587\u51fa\u5904\u94fe\u63a5\u53ca\u672c\u58f0\u660e\u3002<br>\u539f\u6587\u94fe\u63a5\uff1a<a href=\"https:\/\/blog.csdn.net\/wuyanmin1995\/java\/article\/details\/81060991\" target=\"_blank\" rel=\"noreferrer noopener\" rel=\"nofollow\" >https:\/\/blog.csdn.net\/wuyanmin1995\/java\/article\/details\/81060991<\/a><\/p>\n<button class=\"simplefavorite-button\" data-postid=\"127\" data-siteid=\"1\" data-groupid=\"1\" data-favoritecount=\"0\" style=\"\">\u6536\u85cf <i class=\"sf-icon-star-empty\"><\/i><\/button>","protected":false},"excerpt":{"rendered":"<p>\u73af\u5883 \u7b2c\u4e00\u6b21\u51fa\u95191.1 make\u63d0\u793a1.2 make\u62a5\u95191.3 \u5c1d\u8bd51.4 \u89e3\u51b31 \u7b2c\u4e8c\u6b21\u51fa\u95192.1 cmake\u62a5\u95192.2 \u89e3\u51b3  &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-127","post","type-post","status-publish","format-standard","hentry","category-11"],"_links":{"self":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts\/127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=127"}],"version-history":[{"count":0,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts\/127\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}