{"id":79700,"date":"2026-03-02T20:07:35","date_gmt":"2026-03-02T12:07:35","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/79700.html"},"modified":"2026-03-02T20:07:35","modified_gmt":"2026-03-02T12:07:35","slug":"vscode%e8%bf%9c%e7%a8%8b%e5%bc%80%e5%8f%91%ef%bc%9a%e5%9c%a8ubuntu%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e9%85%8d%e7%bd%aeopencvc%e7%8e%af%e5%a2%83%ef%bc%882023%e6%9c%80%e6%96%b0%e7%89%88%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/79700.html","title":{"rendered":"VSCode\u8fdc\u7a0b\u5f00\u53d1\uff1a\u5728Ubuntu\u670d\u52a1\u5668\u4e0a\u914d\u7f6eOpenCV+C++\u73af\u5883\uff082023\u6700\u65b0\u7248\uff09"},"content":{"rendered":"<h2>\u5728\u4e91\u7aef\u9ad8\u6548\u6784\u5efa\u89c6\u89c9\u667a\u80fd&#xff1a;VSCode\u8fdc\u7a0b\u5f00\u53d1\u4e0eUbuntu\u670d\u52a1\u5668\u4e0a\u7684OpenCV&#043;C&#043;&#043;\u73af\u5883\u5b9e\u6218<\/h2>\n<p>\u6700\u8fd1\u4e24\u5e74&#xff0c;\u6211\u8eab\u8fb9\u8d8a\u6765\u8d8a\u591a\u7684\u8ba1\u7b97\u673a\u89c6\u89c9\u5de5\u7a0b\u5e08\u548c\u7b97\u6cd5\u5f00\u53d1\u8005\u5f00\u59cb\u5c06\u5f00\u53d1\u73af\u5883\u8fc1\u79fb\u5230\u4e91\u7aef\u670d\u52a1\u5668\u4e0a\u3002\u8fd9\u80cc\u540e\u7684\u9a71\u52a8\u529b\u5f88\u76f4\u63a5&#xff1a;\u672c\u5730\u7b14\u8bb0\u672c\u8dd1\u4e0d\u52a8\u5927\u578b\u6570\u636e\u96c6\u8bad\u7ec3&#xff0c;\u663e\u5361\u8d44\u6e90\u6709\u9650&#xff0c;\u800c\u516c\u53f8\u6216\u5b9e\u9a8c\u5ba4\u7684\u670d\u52a1\u5668\u5f80\u5f80\u914d\u7f6e\u4e86\u591a\u5757\u9ad8\u6027\u80fdGPU\u548c\u5145\u8db3\u7684\u5185\u5b58\u3002\u4f46\u968f\u4e4b\u800c\u6765\u7684\u4e00\u4e2a\u73b0\u5b9e\u95ee\u9898\u662f&#xff0c;\u96be\u9053\u6211\u4eec\u6bcf\u6b21\u5199\u4ee3\u7801\u3001\u8c03\u8bd5\u90fd\u8981\u901a\u8fc7SSH\u547d\u4ee4\u884c\u5728\u7ec8\u7aef\u91cc\u64cd\u4f5c\u5417&#xff1f;\u90a3\u79cd\u4f53\u9a8c\u5bf9\u4e8e\u9700\u8981\u9891\u7e41\u53ef\u89c6\u5316\u4e2d\u95f4\u7ed3\u679c\u3001\u8fdb\u884c\u4ea4\u4e92\u5f0f\u8c03\u8bd5\u7684\u89c6\u89c9\u9879\u76ee\u6765\u8bf4&#xff0c;\u6548\u7387\u5b9e\u5728\u592a\u4f4e\u3002<\/p>\n<p>\u76f4\u5230\u6211\u5f00\u59cb\u7cfb\u7edf\u6027\u5730\u4f7f\u7528VSCode\u7684\u8fdc\u7a0b\u5f00\u53d1\u529f\u80fd&#xff0c;\u6574\u4e2a\u5de5\u4f5c\u6d41\u624d\u771f\u6b63\u987a\u7545\u8d77\u6765\u3002\u4f60\u5b8c\u5168\u53ef\u4ee5\u50cf\u5728\u672c\u5730\u4e00\u6837&#xff0c;\u5728\u719f\u6089\u7684VSCode\u754c\u9762\u91cc\u7f16\u5199C&#043;&#043;\u4ee3\u7801\u3001\u8c03\u7528OpenCV\u5e93\u5904\u7406\u56fe\u50cf\u3001\u8bbe\u7f6e\u65ad\u70b9\u8c03\u8bd5&#xff0c;\u4f46\u6240\u6709\u7684\u7f16\u8bd1\u548c\u8fd0\u884c\u5b9e\u9645\u4e0a\u90fd\u5728\u8fdc\u7aef\u7684Ubuntu\u670d\u52a1\u5668\u4e0a\u5b8c\u6210\u3002\u8fd9\u79cd\u201c\u672c\u5730\u7f16\u8f91&#xff0c;\u8fdc\u7a0b\u6267\u884c\u201d\u7684\u6a21\u5f0f&#xff0c;\u65e2\u4fdd\u7559\u4e86\u672c\u5730\u5f00\u53d1\u7684\u4fbf\u6377\u6027&#xff0c;\u53c8\u5145\u5206\u5229\u7528\u4e86\u670d\u52a1\u5668\u7684\u8ba1\u7b97\u8d44\u6e90\u3002\u4eca\u5929&#xff0c;\u6211\u5c31\u7ed3\u5408\u81ea\u5df1\u8fd1\u671f\u7684\u51e0\u4e2a\u5b9e\u9645\u9879\u76ee\u7ecf\u9a8c&#xff0c;\u8be6\u7ec6\u62c6\u89e3\u5982\u4f55\u57282023\u5e74\u7684\u6280\u672f\u73af\u5883\u4e0b&#xff0c;\u4ece\u96f6\u5f00\u59cb\u642d\u5efa\u8fd9\u5957\u9ad8\u6548\u7684\u8fdc\u7a0b\u89c6\u89c9\u5f00\u53d1\u73af\u5883\u3002\u65e0\u8bba\u4f60\u662f\u9700\u8981\u5904\u74064K\u89c6\u9891\u6d41&#xff0c;\u8fd8\u662f\u8bad\u7ec3\u590d\u6742\u7684\u6df1\u5ea6\u5b66\u4e60\u6a21\u578b&#xff0c;\u8fd9\u5957\u65b9\u6cd5\u8bba\u90fd\u80fd\u8ba9\u4f60\u4e8b\u534a\u529f\u500d\u3002<\/p>\n<h3>1. \u8fdc\u7a0b\u5f00\u53d1\u57fa\u77f3&#xff1a;VSCode Remote-SSH\u6df1\u5ea6\u914d\u7f6e\u4e0e\u4f18\u5316<\/h3>\n<p>\u5728\u5f00\u59cb\u5b89\u88c5\u4efb\u4f55\u5e93\u4e4b\u524d&#xff0c;\u6211\u4eec\u5fc5\u987b\u5148\u628a\u201c\u901a\u9053\u201d\u642d\u5efa\u7a33\u56fa\u3002VSCode\u7684Remote-SSH\u6269\u5c55\u662f\u8fd9\u4e2a\u5de5\u4f5c\u6d41\u7684\u6838\u5fc3&#xff0c;\u4f46\u5f88\u591a\u6559\u7a0b\u53ea\u8bb2\u4e86\u57fa\u7840\u7684\u8fde\u63a5&#xff0c;\u5ffd\u7565\u4e86\u7a33\u5b9a\u6027\u548c\u6548\u7387\u7684\u4f18\u5316\u3002\u8fd9\u91cc\u6709\u51e0\u4e2a\u6211\u8e29\u8fc7\u5751\u540e\u624d\u603b\u7ed3\u51fa\u7684\u5173\u952e\u70b9\u3002<\/p>\n<p>\u9996\u5148&#xff0c;\u786e\u4fdd\u4f60\u7684\u672c\u5730VSCode\u5df2\u7ecf\u5b89\u88c5\u4e86\u201cRemote &#8211; SSH\u201d\u6269\u5c55\u3002\u8fd9\u542c\u8d77\u6765\u662f\u5e9f\u8bdd&#xff0c;\u4f46\u8bf7\u68c0\u67e5\u6269\u5c55\u7248\u672c&#xff0c;\u8fc7\u65e7\u7684\u7248\u672c\u53ef\u80fd\u5bf9\u6700\u65b0\u7248OpenSSL\u6216\u670d\u52a1\u5668\u7cfb\u7edf\u517c\u5bb9\u6027\u4e0d\u4f73\u3002\u6211\u63a8\u8350\u4fdd\u6301\u6269\u5c55\u66f4\u65b0\u5230\u6700\u65b0\u7a33\u5b9a\u7248\u3002<\/p>\n<p>\u8fde\u63a5\u670d\u52a1\u5668\u65f6&#xff0c;\u6700\u7ecf\u5178\u7684\u547d\u4ee4\u662f&#xff1a;<\/p>\n<p>ssh user&#064;your_server_ip<\/p>\n<p>\u4f46\u5728VSCode\u7684\u8fdc\u7a0b\u8d44\u6e90\u7ba1\u7406\u5668\u91cc&#xff0c;\u4f60\u53ef\u4ee5\u914d\u7f6e\u66f4\u7cbe\u7ec6\u7684SSH\u8fde\u63a5\u8bbe\u7f6e\u3002\u6211\u5f3a\u70c8\u5efa\u8bae\u521b\u5efa\u4e00\u4e2a\u72ec\u7acb\u7684SSH\u914d\u7f6e\u6587\u4ef6&#xff08;\u901a\u5e38\u662f ~\/.ssh\/config&#xff09;&#xff0c;\u4e3a\u4f60\u7684\u5f00\u53d1\u670d\u52a1\u5668\u5355\u72ec\u914d\u7f6e\u53c2\u6570\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u6211\u5e38\u7528\u7684\u914d\u7f6e\u6a21\u677f&#xff1a;<\/p>\n<p>Host dev-vision-server<br \/>\n    HostName 192.168.1.100  # \u66ff\u6362\u4e3a\u4f60\u7684\u670d\u52a1\u5668IP\u6216\u57df\u540d<br \/>\n    User developer<br \/>\n    Port 22<br \/>\n    IdentityFile ~\/.ssh\/id_rsa_vision  # \u4f7f\u7528\u4e13\u7528\u5bc6\u94a5&#xff0c;\u66f4\u5b89\u5168<br \/>\n    ServerAliveInterval 60<br \/>\n    ServerAliveCountMax 5<br \/>\n    TCPKeepAlive yes<br \/>\n    Compression yes<br \/>\n    ForwardAgent yes  # \u5982\u679c\u4f60\u9700\u8981\u4ece\u670d\u52a1\u5668\u8bbf\u95ee\u5176\u4ed6Git\u4ed3\u5e93&#xff0c;\u8fd9\u4e2a\u5f88\u6709\u7528<\/p>\n<p>\u6ce8\u610f&#xff1a;ServerAliveInterval\u548cServerAliveCountMax\u8fd9\u4e24\u4e2a\u53c2\u6570\u5bf9\u4e8e\u7ef4\u6301\u957f\u65f6\u95f4\u7a33\u5b9a\u7684SSH\u8fde\u63a5\u81f3\u5173\u91cd\u8981&#xff0c;\u5c24\u5176\u662f\u5728\u7f51\u7edc\u4e0d\u7a33\u5b9a\u7684\u60c5\u51b5\u4e0b&#xff0c;\u5b83\u4eec\u80fd\u6709\u6548\u9632\u6b62\u8fde\u63a5\u610f\u5916\u65ad\u5f00\u3002<\/p>\n<p>\u914d\u7f6e\u597d\u540e&#xff0c;\u5728VSCode\u7684\u8fdc\u7a0b\u8d44\u6e90\u7ba1\u7406\u5668\u4e2d\u9009\u62e9\u201cConnect to Host&#8230;\u201d&#xff0c;\u7136\u540e\u9009\u62e9\u4f60\u521a\u914d\u7f6e\u7684 dev-vision-server\u3002\u7b2c\u4e00\u6b21\u8fde\u63a5\u65f6&#xff0c;VSCode\u4f1a\u5728\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u81ea\u52a8\u5b89\u88c5\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684\u201cVS Code Server\u201d\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u662f\u81ea\u52a8\u7684&#xff0c;\u4f46\u5982\u679c\u9047\u5230\u7f51\u7edc\u95ee\u9898\u5bfc\u81f4\u4e0b\u8f7d\u5931\u8d25&#xff0c;\u4f60\u53ef\u80fd\u9700\u8981\u624b\u52a8\u914d\u7f6e\u4ee3\u7406\u6216\u4f7f\u7528\u79bb\u7ebf\u5b89\u88c5\u5305\u3002<\/p>\n<p>\u8fde\u63a5\u6210\u529f\u540e&#xff0c;\u4f60\u7684VSCode\u754c\u9762\u5de6\u4e0b\u89d2\u4f1a\u663e\u793a\u201cSSH: dev-vision-server\u201d\u7684\u6807\u8bc6\u3002\u8fd9\u65f6\u5019&#xff0c;\u4f60\u6253\u5f00\u7684\u4efb\u4f55\u6587\u4ef6\u5939\u3001\u5b89\u88c5\u7684\u4efb\u4f55\u6269\u5c55&#xff0c;\u90fd\u662f\u5728\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u4e0b\u6587\u73af\u5883\u4e2d\u8fdb\u884c\u7684\u3002\u8fd9\u662f\u4e00\u4e2a\u975e\u5e38\u91cd\u8981\u7684\u6982\u5ff5\u3002\u6bd4\u5982&#xff0c;\u4f60\u63a5\u4e0b\u6765\u5b89\u88c5\u7684\u201cC\/C&#043;&#043;\u201d\u6269\u5c55&#xff0c;\u662f\u4e3a\u4e86\u8ba9\u8fdc\u7a0b\u7684VSCode\u670d\u52a1\u5668\u5177\u5907C&#043;&#043;\u7684IntelliSense\u548c\u8c03\u8bd5\u80fd\u529b&#xff0c;\u800c\u4e0d\u662f\u4f60\u672c\u5730\u673a\u5668\u4e0a\u7684\u3002<\/p>\n<p>\u4e3a\u4e86\u83b7\u5f97\u6700\u4f73\u7684C&#043;&#043;\u5f00\u53d1\u4f53\u9a8c&#xff0c;\u6211\u5efa\u8bae\u5728\u8fdc\u7a0b\u8fde\u63a5\u6210\u529f\u540e&#xff0c;\u7acb\u5373\u5b89\u88c5\u4ee5\u4e0b\u51e0\u4e2a\u6838\u5fc3\u6269\u5c55&#xff1a;<\/p>\n<ul>\n<li>C\/C&#043;&#043; (by Microsoft)&#xff1a;\u63d0\u4f9b\u4ee3\u7801\u8865\u5168\u3001\u5bfc\u822a\u3001\u8c03\u8bd5\u652f\u6301\u3002<\/li>\n<li>CMake Tools&#xff1a;\u5982\u679c\u4f60\u7684\u9879\u76ee\u4f7f\u7528CMake\u6784\u5efa&#xff08;\u5f88\u591a\u5927\u578bOpenCV\u9879\u76ee\u90fd\u662f&#xff09;&#xff0c;\u8fd9\u4e2a\u6269\u5c55\u5fc5\u4e0d\u53ef\u5c11\u3002<\/li>\n<li>Remote Development\u6269\u5c55\u5305&#xff1a;\u786e\u4fdd\u5176\u4ed6\u8fdc\u7a0b\u76f8\u5173\u529f\u80fd\u4e5f\u4e00\u5e76\u5b89\u88c5\u3002<\/li>\n<\/ul>\n<h3>2. Ubuntu\u670d\u52a1\u5668\u7aef&#xff1a;OpenCV 4.x \u4e0e C&#043;&#043; \u5de5\u5177\u94fe\u7684\u7cbe\u51c6\u90e8\u7f72<\/h3>\n<p>\u73b0\u5728&#xff0c;\u6211\u4eec\u5df2\u7ecf\u5728\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u201c\u684c\u9762\u73af\u5883\u201d&#xff08;VSCode&#xff09;\u91cc\u4e86\u3002\u63a5\u4e0b\u6765&#xff0c;\u6211\u4eec\u8981\u5728\u8fd9\u4e2aUbuntu\u7cfb\u7edf\u4e0a\u642d\u5efa\u575a\u5b9e\u7684C&#043;&#043;\u548cOpenCV\u5730\u57fa\u3002\u6211\u4ee5Ubuntu 20.04 LTS\u621622.04 LTS\u4e3a\u4f8b&#xff0c;\u8fd9\u4e9b\u662f\u5f53\u524d\u6700\u7a33\u5b9a\u4e14\u957f\u671f\u652f\u6301\u7684\u670d\u52a1\u7aef\u7cfb\u7edf\u3002<\/p>\n<h4>2.1 \u7cfb\u7edf\u66f4\u65b0\u4e0e\u57fa\u7840\u7f16\u8bd1\u73af\u5883<\/h4>\n<p>\u9996\u5148&#xff0c;\u901a\u8fc7VSCode\u5185\u7f6e\u7684\u7ec8\u7aef&#xff08;\u5feb\u6377\u952e Ctrl&#043;&#096;&#xff09;&#xff0c;\u6267\u884c\u7cfb\u7edf\u66f4\u65b0\u5e76\u5b89\u88c5\u6838\u5fc3\u7684\u7f16\u8bd1\u5de5\u5177\u548c\u4f9d\u8d56\u5e93\u3002<\/p>\n<p>sudo apt update &amp;&amp; sudo apt upgrade -y<br \/>\nsudo apt install -y build-essential cmake git pkg-config<\/p>\n<p>build-essential \u5305\u542b\u4e86gcc, g&#043;&#043;, make\u7b49\u6838\u5fc3\u5de5\u5177\u3002cmake\u662f\u73b0\u4ee3C&#043;&#043;\u9879\u76ee&#xff0c;\u5c24\u5176\u662fOpenCV\u6784\u5efa\u7684\u6807\u914d\u3002pkg-config\u80fd\u5e2e\u52a9\u7f16\u8bd1\u5668\u8f7b\u677e\u627e\u5230\u5df2\u5b89\u88c5\u5e93\u7684\u5934\u6587\u4ef6\u548c\u94fe\u63a5\u5e93\u8def\u5f84\u3002<\/p>\n<p>\u63a5\u4e0b\u6765&#xff0c;\u5b89\u88c5OpenCV\u5904\u7406\u56fe\u50cf\u548c\u89c6\u9891\u6240\u5fc5\u9700\u7684\u591a\u5a92\u4f53\u5e93\u4ee5\u53ca\u4e00\u4e9b\u4f18\u5316\u8ba1\u7b97\u7684\u5e93&#xff1a;<\/p>\n<p>sudo apt install -y libjpeg-dev libpng-dev libtiff-dev<br \/>\nsudo apt install -y libavcodec-dev libavformat-dev libswscale-dev libv4l-dev<br \/>\nsudo apt install -y libxvidcore-dev libx264-dev<br \/>\nsudo apt install -y libgtk-3-dev<br \/>\nsudo apt install -y libatlas-base-dev gfortran  # \u4f18\u5316\u5e93&#xff0c;\u7528\u4e8e\u77e9\u9635\u8fd0\u7b97<br \/>\nsudo apt install -y python3-dev python3-numpy  # \u5982\u679c\u4f60\u672a\u6765\u53ef\u80fd\u7528\u5230OpenCV\u7684Python\u63a5\u53e3<\/p>\n<h4>2.2 \u4e0b\u8f7d\u4e0e\u7f16\u8bd1OpenCV&#xff08;\u4ece\u6e90\u7801\u6784\u5efa\u7684\u4f18\u52bf&#xff09;<\/h4>\n<p>\u867d\u7136Ubuntu\u4ed3\u5e93\u91cc\u6709libopencv-dev\u5305\u53ef\u4ee5\u76f4\u63a5\u5b89\u88c5&#xff0c;\u4f46\u6211\u5f3a\u70c8\u63a8\u8350\u4ece\u6e90\u7801\u7f16\u8bd1\u3002\u539f\u56e0\u6709\u4e09&#xff1a;1) \u4f60\u80fd\u83b7\u5f97\u6700\u65b0\u7248\u672c&#xff08;\u5982OpenCV 4.8.0&#xff09;\u548c\u6240\u6709\u529f\u80fd\u6a21\u5757&#xff1b;2) \u53ef\u4ee5\u9488\u5bf9\u4f60\u7684\u670d\u52a1\u5668CPU\u6307\u4ee4\u96c6&#xff08;\u5982AVX2&#xff09;\u8fdb\u884c\u4f18\u5316&#xff0c;\u63d0\u5347\u6027\u80fd&#xff1b;3) \u53ef\u4ee5\u7cbe\u786e\u63a7\u5236\u7f16\u8bd1\u9009\u9879&#xff0c;\u53ea\u542f\u7528\u4f60\u9700\u8981\u7684\u6a21\u5757&#xff0c;\u51cf\u5c11\u4f53\u79ef\u3002<\/p>\n<p>\u6211\u4eec\u9009\u62e9OpenCV 4.x\u7684\u7a33\u5b9a\u7248\u672c&#xff0c;\u5e76\u8fde\u540c\u5176\u6269\u5c55\u6a21\u5757opencv_contrib\u4e00\u8d77\u7f16\u8bd1&#xff0c;\u540e\u8005\u5305\u542b\u4e86\u5927\u91cf\u524d\u6cbf\u7b97\u6cd5&#xff08;\u5982SIFT\u3001SURF\u3001\u6df1\u5ea6\u5b66\u4e60\u6a21\u578b\u7b49&#xff09;\u3002<\/p>\n<p># \u521b\u5efa\u5de5\u4f5c\u76ee\u5f55\u5e76\u8fdb\u5165<br \/>\nmkdir -p ~\/opencv_build &amp;&amp; cd ~\/opencv_build<\/p>\n<p># \u514b\u9686OpenCV\u53cacontrib\u4ed3\u5e93&#xff08;\u4f7f\u7528&#8211;depth 1\u52a0\u5feb\u514b\u9686\u901f\u5ea6&#xff09;<br \/>\ngit clone &#8211;branch 4.8.0 &#8211;depth 1 https:\/\/github.com\/opencv\/opencv.git<br \/>\ngit clone &#8211;branch 4.8.0 &#8211;depth 1 https:\/\/github.com\/opencv\/opencv_contrib.git<\/p>\n<p># \u521b\u5efa\u6784\u5efa\u76ee\u5f55<br \/>\ncd opencv<br \/>\nmkdir build &amp;&amp; cd build<\/p>\n<p>\u73b0\u5728&#xff0c;\u4f7f\u7528CMake\u8fdb\u884c\u914d\u7f6e\u3002\u8fd9\u662f\u4e00\u4e2a\u5173\u952e\u6b65\u9aa4&#xff0c;\u4e0b\u9762\u7684\u547d\u4ee4\u5305\u542b\u4e86\u6211\u8ba4\u4e3a\u5bf9\u89c6\u89c9\u5f00\u53d1\u6700\u6709\u7528\u7684\u9009\u9879&#xff1a;<\/p>\n<p>cmake -D CMAKE_BUILD_TYPE&#061;RELEASE \\\\<br \/>\n        -D CMAKE_INSTALL_PREFIX&#061;\/usr\/local \\\\<br \/>\n        -D OPENCV_EXTRA_MODULES_PATH&#061;..\/..\/opencv_contrib\/modules \\\\<br \/>\n        -D WITH_CUDA&#061;OFF \\\\  # \u5982\u679c\u4f60\u7684\u670d\u52a1\u5668\u6709NVIDIA GPU\u5e76\u5df2\u5b89\u88c5CUDA&#xff0c;\u53ef\u4ee5\u6539\u4e3aON<br \/>\n        -D WITH_GTK&#061;ON \\\\<br \/>\n        -D WITH_FFMPEG&#061;ON \\\\<br \/>\n        -D OPENCV_ENABLE_NONFREE&#061;ON \\\\  # \u542f\u7528\u4e13\u5229\u7b97\u6cd5&#xff08;\u5982SIFT&#xff09;<br \/>\n        -D BUILD_EXAMPLES&#061;OFF \\\\<br \/>\n        -D BUILD_opencv_python3&#061;ON \\\\<br \/>\n        -D PYTHON3_EXECUTABLE&#061;$(which python3) \\\\<br \/>\n        -D INSTALL_PYTHON_EXAMPLES&#061;OFF \\\\<br \/>\n        -D BUILD_TESTS&#061;OFF \\\\<br \/>\n        ..<\/p>\n<p>\u63d0\u793a&#xff1a;\u6267\u884ccmake\u547d\u4ee4\u540e&#xff0c;\u8bf7\u4ed4\u7ec6\u67e5\u770b\u8f93\u51fa\u3002\u786e\u4fdd\u201cFFMPEG\u201d\u3001\u201cGTK&#043;\u201d\u7b49\u5173\u952e\u6a21\u5757\u663e\u793a\u4e3a\u201cYES\u201d&#xff0c;\u5e76\u4e14\u6ca1\u6709\u91cd\u8981\u7684\u201cNO\u201d\u5bfc\u81f4\u529f\u80fd\u7f3a\u5931\u3002\u5982\u679c\u9047\u5230\u67d0\u4e9b\u4f9d\u8d56\u7f3a\u5931&#xff0c;\u6839\u636e\u9519\u8bef\u63d0\u793a\u5b89\u88c5\u5bf9\u5e94\u7684-dev\u5305\u5373\u53ef\u3002<\/p>\n<p>\u914d\u7f6e\u6210\u529f\u540e&#xff0c;\u5f00\u59cb\u7f16\u8bd1\u3002\u8fd9\u91cc\u4f7f\u7528make -j$(nproc)&#xff0c;\u5176\u4e2d$(nproc)\u4f1a\u81ea\u52a8\u83b7\u53d6\u4f60\u670d\u52a1\u5668\u7684CPU\u6838\u5fc3\u6570&#xff0c;\u8fdb\u884c\u5e76\u884c\u7f16\u8bd1\u4ee5\u5927\u5e45\u7f29\u77ed\u65f6\u95f4\u3002<\/p>\n<p>make -j$(nproc)<\/p>\n<p>\u7f16\u8bd1\u8fc7\u7a0b\u53ef\u80fd\u9700\u8981\u5341\u51e0\u5206\u949f\u5230\u534a\u5c0f\u65f6&#xff0c;\u53d6\u51b3\u4e8e\u670d\u52a1\u5668\u6027\u80fd\u3002\u5b8c\u6210\u540e&#xff0c;\u6267\u884c\u5b89\u88c5&#xff1a;<\/p>\n<p>sudo make install<br \/>\nsudo ldconfig  # \u66f4\u65b0\u7cfb\u7edf\u7684\u52a8\u6001\u94fe\u63a5\u5e93\u7f13\u5b58<\/p>\n<p>\u6700\u540e&#xff0c;\u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6210\u529f&#xff1a;<\/p>\n<p>pkg-config &#8211;modversion opencv4<\/p>\n<p>\u5982\u679c\u6b63\u786e\u8f93\u51fa\u7248\u672c\u53f7&#xff08;\u59824.8.0&#xff09;&#xff0c;\u90a3\u4e48\u606d\u559c\u4f60&#xff0c;OpenCV\u5df2\u7ecf\u7a33\u7a33\u5730\u5b89\u88c5\u5728\/usr\/local\u76ee\u5f55\u4e0b\u4e86\u3002<\/p>\n<h3>3. VSCode\u9879\u76ee\u914d\u7f6e&#xff1a;\u6253\u9020\u667a\u80fd\u9ad8\u6548\u7684C&#043;&#043;\u89c6\u89c9\u5f00\u53d1\u5de5\u4f5c\u533a<\/h3>\n<p>\u670d\u52a1\u5668\u73af\u5883\u5c31\u7eea\u540e&#xff0c;\u6211\u4eec\u8981\u5728VSCode\u91cc\u521b\u5efa\u4e00\u4e2a\u9879\u76ee&#xff0c;\u5e76\u914d\u7f6e\u4e09\u4e2a\u6838\u5fc3\u6587\u4ef6&#xff0c;\u8ba9\u7f16\u8f91\u5668\u5b8c\u5168\u7406\u89e3\u6211\u4eec\u7684OpenCV\u73af\u5883&#xff0c;\u5e76\u5b9e\u73b0\u4e00\u952e\u7f16\u8bd1\u8c03\u8bd5\u3002\u8fd9\u4e0e\u7eaf\u672c\u5730\u5f00\u53d1\u7565\u6709\u4e0d\u540c&#xff0c;\u56e0\u4e3a\u6240\u6709\u8def\u5f84\u90fd\u662f\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u8def\u5f84\u3002<\/p>\n<p>\u9996\u5148&#xff0c;\u5728\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u67d0\u4e2a\u4f4d\u7f6e&#xff08;\u5982~\/projects\/vision_demo&#xff09;\u521b\u5efa\u4e00\u4e2a\u9879\u76ee\u6587\u4ef6\u5939&#xff0c;\u5e76\u5728VSCode\u4e2d\u6253\u5f00\u5b83\u3002<\/p>\n<h4>3.1 \u914d\u7f6e IntelliSense&#xff1a;c_cpp_properties.json<\/h4>\n<p>\u8fd9\u4e2a\u6587\u4ef6\u544a\u8bc9VSCode\u7684C\/C&#043;&#043;\u6269\u5c55\u5728\u54ea\u91cc\u67e5\u627e\u5934\u6587\u4ef6&#xff0c;\u4f7f\u7528\u54ea\u4e2a\u7f16\u8bd1\u5668&#xff0c;\u9075\u5faa\u4ec0\u4e48C&#043;&#043;\u6807\u51c6&#xff0c;\u4ece\u800c\u63d0\u4f9b\u7cbe\u51c6\u7684\u4ee3\u7801\u8865\u5168\u548c\u9519\u8bef\u68c0\u67e5\u3002<\/p>\n<p>\u6309\u4e0b Ctrl&#043;Shift&#043;P&#xff0c;\u8f93\u5165 \u201cC\/C&#043;&#043;: Edit Configurations (UI)\u201d&#xff0c;\u8fd9\u662f\u4e00\u4e2a\u66f4\u53cb\u597d\u7684\u56fe\u5f62\u5316\u914d\u7f6e\u65b9\u5f0f\u3002\u5728\u6253\u5f00\u7684\u754c\u9762\u4e2d&#xff0c;\u8fdb\u884c\u5982\u4e0b\u8bbe\u7f6e&#xff1a;<\/p>\n<ul>\n<li>\u7f16\u8bd1\u5668\u8def\u5f84&#xff1a;\/usr\/bin\/g&#043;&#043;<\/li>\n<li>IntelliSense \u6a21\u5f0f&#xff1a;linux-gcc-x64<\/li>\n<li>C&#043;&#043; \u6807\u51c6&#xff1a;gnu&#043;&#043;17 (\u63a8\u8350\u4f7f\u7528C&#043;&#043;17&#xff0c;\u5b83\u63d0\u4f9b\u4e86\u5f88\u591a\u73b0\u4ee3\u8bed\u6cd5\u4fbf\u5229)<\/li>\n<li>\u5305\u542b\u8def\u5f84&#xff1a;\u8fd9\u91cc\u9700\u8981\u6dfb\u52a0OpenCV\u7684\u5934\u6587\u4ef6\u8def\u5f84\u3002\u901a\u5e38\u5305\u62ec&#xff1a;\n<ul>\n<li>${workspaceFolder}\/**<\/li>\n<li>\/usr\/local\/include\/opencv4<\/li>\n<li>\/usr\/include<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u4f60\u4e5f\u53ef\u4ee5\u76f4\u63a5\u7f16\u8f91\u5e95\u5c42\u7684c_cpp_properties.json\u6587\u4ef6&#xff0c;\u5b83\u53ef\u80fd\u770b\u8d77\u6765\u50cf\u8fd9\u6837&#xff1a;<\/p>\n<p>{<br \/>\n    &#034;configurations&#034;: [<br \/>\n        {<br \/>\n            &#034;name&#034;: &#034;Linux&#034;,<br \/>\n            &#034;includePath&#034;: [<br \/>\n                &#034;${workspaceFolder}\/**&#034;,<br \/>\n                &#034;\/usr\/local\/include\/opencv4&#034;,<br \/>\n                &#034;\/usr\/include&#034;<br \/>\n            ],<br \/>\n            &#034;defines&#034;: [],<br \/>\n            &#034;compilerPath&#034;: &#034;\/usr\/bin\/g&#043;&#043;&#034;,<br \/>\n            &#034;cStandard&#034;: &#034;c17&#034;,<br \/>\n            &#034;cppStandard&#034;: &#034;gnu&#043;&#043;17&#034;,<br \/>\n            &#034;intelliSenseMode&#034;: &#034;linux-gcc-x64&#034;,<br \/>\n            &#034;configurationProvider&#034;: &#034;ms-vscode.cmake-tools&#034; \/\/ \u5982\u679c\u4f7f\u7528CMake\u5219\u6dfb\u52a0<br \/>\n        }<br \/>\n    ],<br \/>\n    &#034;version&#034;: 4<br \/>\n}<\/p>\n<p>\u914d\u7f6e\u597d\u540e&#xff0c;\u4f60\u5728\u4ee3\u7801\u4e2d\u8f93\u5165cv::\u65f6&#xff0c;\u5e94\u8be5\u5c31\u80fd\u770b\u5230OpenCV\u5404\u79cd\u7c7b\u548c\u51fd\u6570\u7684\u81ea\u52a8\u8865\u5168\u63d0\u793a\u4e86\u3002<\/p>\n<h4>3.2 \u914d\u7f6e\u6784\u5efa\u4efb\u52a1&#xff1a;tasks.json<\/h4>\n<p>tasks.json\u5b9a\u4e49\u4e86\u5982\u4f55\u7f16\u8bd1\u4f60\u7684\u4ee3\u7801\u3002\u6211\u4eec\u5c06\u521b\u5efa\u4e00\u4e2a\u4efb\u52a1&#xff0c;\u7528g&#043;&#043;\u7f16\u8bd1\u5f53\u524d\u6253\u5f00\u7684C&#043;&#043;\u6587\u4ef6&#xff0c;\u5e76\u94fe\u63a5OpenCV\u5e93\u3002<\/p>\n<p>\u6309 Ctrl&#043;Shift&#043;P&#xff0c;\u8f93\u5165 \u201cTasks: Configure Task\u201d&#xff0c;\u7136\u540e\u9009\u62e9\u201cCreate tasks.json file from template\u201d&#xff0c;\u518d\u9009\u62e9\u201cOthers\u201d\u3002\u8fd9\u4f1a\u521b\u5efa\u4e00\u4e2a\u7a7a\u7684tasks.json\u3002\u6211\u4eec\u5c06\u7528\u4ee5\u4e0b\u5185\u5bb9\u66ff\u6362&#xff1a;<\/p>\n<p>{<br \/>\n    &#034;version&#034;: &#034;2.0.0&#034;,<br \/>\n    &#034;tasks&#034;: [<br \/>\n        {<br \/>\n            &#034;label&#034;: &#034;build opencv demo&#034;,<br \/>\n            &#034;type&#034;: &#034;shell&#034;,<br \/>\n            &#034;command&#034;: &#034;\/usr\/bin\/g&#043;&#043;&#034;,<br \/>\n            &#034;args&#034;: [<br \/>\n                &#034;-std&#061;c&#043;&#043;17&#034;,<br \/>\n                &#034;-g&#034;,<br \/>\n                &#034;${file}&#034;,<br \/>\n                &#034;-o&#034;,<br \/>\n                &#034;${fileDirname}\/${fileBasenameNoExtension}&#034;,<br \/>\n                &#034;-I\/usr\/local\/include\/opencv4&#034;,<br \/>\n                &#034;-L\/usr\/local\/lib&#034;,<br \/>\n                &#034;-lopencv_core&#034;,<br \/>\n                &#034;-lopencv_imgproc&#034;,<br \/>\n                &#034;-lopencv_highgui&#034;,<br \/>\n                &#034;-lopencv_imgcodecs&#034;,<br \/>\n                &#034;-lopencv_videoio&#034;<br \/>\n            ],<br \/>\n            &#034;group&#034;: {<br \/>\n                &#034;kind&#034;: &#034;build&#034;,<br \/>\n                &#034;isDefault&#034;: true<br \/>\n            },<br \/>\n            &#034;problemMatcher&#034;: [&#034;$gcc&#034;],<br \/>\n            &#034;detail&#034;: &#034;\u4f7f\u7528 g&#043;&#043; \u7f16\u8bd1\u5f53\u524d\u6587\u4ef6\u5e76\u94fe\u63a5\u6307\u5b9aOpenCV\u5e93&#034;<br \/>\n        }<br \/>\n    ]<br \/>\n}<\/p>\n<p>\u5173\u952e\u53c2\u6570\u89e3\u6790&#xff1a;<\/p>\n<ul>\n<li>-std&#061;c&#043;&#043;17&#xff1a;\u6307\u5b9aC&#043;&#043;\u8bed\u8a00\u6807\u51c6\u3002<\/li>\n<li>-g&#xff1a;\u751f\u6210\u8c03\u8bd5\u4fe1\u606f&#xff0c;\u8fd9\u662f\u540e\u7eed\u4f7f\u7528\u8c03\u8bd5\u5668&#xff08;GDB&#xff09;\u6240\u5fc5\u9700\u7684\u3002<\/li>\n<li>${file}&#xff1a;\u5f53\u524d\u6d3b\u52a8\u7684\u6e90\u6587\u4ef6\u3002<\/li>\n<li>-o &#8230;&#xff1a;\u6307\u5b9a\u8f93\u51fa\u53ef\u6267\u884c\u6587\u4ef6\u7684\u8def\u5f84\u548c\u540d\u79f0\u3002<\/li>\n<li>-I\/usr\/local\/include\/opencv4&#xff1a;\u6dfb\u52a0OpenCV\u5934\u6587\u4ef6\u641c\u7d22\u8def\u5f84\u3002<\/li>\n<li>-L\/usr\/local\/lib&#xff1a;\u6dfb\u52a0OpenCV\u5e93\u6587\u4ef6\u641c\u7d22\u8def\u5f84\u3002<\/li>\n<li>-lopencv_xxx&#xff1a;\u94fe\u63a5\u5177\u4f53\u7684OpenCV\u5e93\u3002\u8fd9\u91cc\u6211\u5217\u51fa\u4e86\u51e0\u4e2a\u6700\u5e38\u7528\u7684\u3002\u4f60\u53ef\u4ee5\u6839\u636e\u4f60\u7684\u4ee3\u7801\u9700\u6c42\u589e\u51cf&#xff0c;\u4f8b\u5982\u7528\u5230\u7279\u5f81\u70b9\u68c0\u6d4b\u5c31\u52a0\u4e0a-lopencv_features2d\u3002\u66f4\u7b80\u5355\u4f46\u4f53\u79ef\u66f4\u5927\u7684\u65b9\u5f0f\u662f\u94fe\u63a5\u51e0\u4e4e\u6240\u6709\u5e93&#xff1a;&#096;pkg-config &#8211;libs opencv4&#096;&#xff0c;\u4f46\u9700\u8981\u5148\u5728args\u4e2d\u901a\u8fc7shell\u547d\u4ee4\u83b7\u53d6\u3002<\/li>\n<\/ul>\n<p>\u73b0\u5728&#xff0c;\u4f60\u53ef\u4ee5\u6309 Ctrl&#043;Shift&#043;B \u6765\u8fd0\u884c\u8fd9\u4e2a\u9ed8\u8ba4\u7684\u6784\u5efa\u4efb\u52a1\u4e86\u3002<\/p>\n<h4>3.3 \u914d\u7f6e\u8c03\u8bd5&#xff1a;launch.json<\/h4>\n<p>\u8c03\u8bd5\u662f\u5f00\u53d1\u4e2d\u4e0d\u53ef\u6216\u7f3a\u7684\u4e00\u73af\u3002launch.json\u544a\u8bc9VSCode\u5982\u4f55\u542f\u52a8\u8c03\u8bd5\u5668\u3002<\/p>\n<p>\u6309 Ctrl&#043;Shift&#043;P&#xff0c;\u8f93\u5165 \u201cDebug: Open launch.json\u201d&#xff0c;\u9009\u62e9\u201cC&#043;&#043; (GDB\/LLDB)\u201d\u3002\u7136\u540e\u4f7f\u7528\u5982\u4e0b\u914d\u7f6e&#xff1a;<\/p>\n<p>{<br \/>\n    &#034;version&#034;: &#034;0.2.0&#034;,<br \/>\n    &#034;configurations&#034;: [<br \/>\n        {<br \/>\n            &#034;name&#034;: &#034;(gdb) \u542f\u52a8&#034;,<br \/>\n            &#034;type&#034;: &#034;cppdbg&#034;,<br \/>\n            &#034;request&#034;: &#034;launch&#034;,<br \/>\n            &#034;program&#034;: &#034;${fileDirname}\/${fileBasenameNoExtension}&#034;,<br \/>\n            &#034;args&#034;: [],<br \/>\n            &#034;stopAtEntry&#034;: false,<br \/>\n            &#034;cwd&#034;: &#034;${fileDirname}&#034;,<br \/>\n            &#034;environment&#034;: [],<br \/>\n            &#034;externalConsole&#034;: false,<br \/>\n            &#034;MIMode&#034;: &#034;gdb&#034;,<br \/>\n            &#034;miDebuggerPath&#034;: &#034;\/usr\/bin\/gdb&#034;,<br \/>\n            &#034;setupCommands&#034;: [<br \/>\n                {<br \/>\n                    &#034;description&#034;: &#034;\u4e3a gdb \u542f\u7528\u6574\u9f50\u6253\u5370&#034;,<br \/>\n                    &#034;text&#034;: &#034;-enable-pretty-printing&#034;,<br \/>\n                    &#034;ignoreFailures&#034;: true<br \/>\n                }<br \/>\n            ],<br \/>\n            &#034;preLaunchTask&#034;: &#034;build opencv demo&#034;, \/\/ \u4e0e tasks.json \u4e2d\u7684 label \u5bf9\u5e94<br \/>\n            &#034;logging&#034;: {<br \/>\n                &#034;engineLogging&#034;: false<br \/>\n            }<br \/>\n        }<br \/>\n    ]<br \/>\n}<\/p>\n<p>\u8fd9\u91cc\u6700\u91cd\u8981\u7684\u5173\u8054\u662f &#034;preLaunchTask&#034;: &#034;build opencv demo&#034;\u3002\u8fd9\u610f\u5473\u7740\u5f53\u4f60\u6309\u4e0b F5 \u5f00\u59cb\u8c03\u8bd5\u65f6&#xff0c;VSCode\u4f1a\u5148\u81ea\u52a8\u6267\u884ctasks.json\u4e2d\u6807\u7b7e\u4e3abuild opencv demo\u7684\u4efb\u52a1\u6765\u7f16\u8bd1\u4ee3\u7801&#xff0c;\u7136\u540e\u518d\u542f\u52a8\u8c03\u8bd5\u5668\u3002\u8fd9\u5b9e\u73b0\u4e86\u201c\u4e00\u952e\u7f16\u8bd1\u8c03\u8bd5\u201d\u7684\u6d41\u7545\u4f53\u9a8c\u3002<\/p>\n<h3>4. \u5b9e\u6218\u6f14\u7ec3\u4e0e\u9ad8\u7ea7\u6280\u5de7&#xff1a;\u4ece\u6d4b\u8bd5\u5230\u771f\u5b9e\u9879\u76ee<\/h3>\n<p>\u73af\u5883\u914d\u7f6e\u597d\u4e86&#xff0c;\u6211\u4eec\u6765\u70b9\u5b9e\u9645\u7684\u3002\u5728\u9879\u76ee\u6839\u76ee\u5f55\u521b\u5efa\u4e00\u4e2atest_opencv.cpp\u6587\u4ef6\u3002<\/p>\n<h4>4.1 \u57fa\u7840\u529f\u80fd\u6d4b\u8bd5<\/h4>\n<p>\u5199\u5165\u4e00\u4e2a\u7b80\u5355\u7684\u56fe\u50cf\u8bfb\u53d6\u548c\u663e\u793a\u7a0b\u5e8f&#xff1a;<\/p>\n<p>#include &lt;opencv2\/opencv.hpp&gt;<br \/>\n#include &lt;iostream&gt;<\/p>\n<p>int main() {<br \/>\n    \/\/ \u5c1d\u8bd5\u8bfb\u53d6\u4e00\u5f20\u56fe\u7247&#xff0c;\u8bf7\u786e\u4fdd\u8def\u5f84\u6b63\u786e<br \/>\n    cv::Mat image &#061; cv::imread(&#034;test_image.jpg&#034;, cv::IMREAD_COLOR);<\/p>\n<p>    if(image.empty()) {<br \/>\n        std::cerr &lt;&lt; &#034;\u9519\u8bef&#xff1a;\u65e0\u6cd5\u52a0\u8f7d\u56fe\u50cf&#xff01;\u8bf7\u68c0\u67e5\u6587\u4ef6\u8def\u5f84\u3002&#034; &lt;&lt; std::endl;<br \/>\n        std::cerr &lt;&lt; &#034;\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u662f&#xff1a;&#034;;<br \/>\n        system(&#034;pwd&#034;); \/\/ \u6253\u5370\u5f53\u524d\u8def\u5f84&#xff0c;\u5e2e\u52a9\u8c03\u8bd5<br \/>\n        return -1;<br \/>\n    }<\/p>\n<p>    cv::namedWindow(&#034;Remote OpenCV Demo&#034;, cv::WINDOW_NORMAL);<br \/>\n    cv::imshow(&#034;Remote OpenCV Demo&#034;, image);<\/p>\n<p>    std::cout &lt;&lt; &#034;\u56fe\u50cf\u5c3a\u5bf8: &#034; &lt;&lt; image.cols &lt;&lt; &#034; x &#034; &lt;&lt; image.rows &lt;&lt; std::endl;<br \/>\n    std::cout &lt;&lt; &#034;\u6309\u4efb\u610f\u952e\u7ee7\u7eed&#8230;&#034; &lt;&lt; std::endl;<\/p>\n<p>    cv::waitKey(0);<br \/>\n    cv::destroyAllWindows();<br \/>\n    return 0;<br \/>\n}<\/p>\n<p>\u5c06\u4e00\u5f20\u540d\u4e3atest_image.jpg\u7684\u56fe\u7247\u653e\u5728\u4e0ecpp\u6587\u4ef6\u76f8\u540c\u7684\u76ee\u5f55\u4e0b\u3002\u6309 F5&#xff0c;\u5982\u679c\u4e00\u5207\u914d\u7f6e\u6b63\u786e&#xff0c;VSCode\u4f1a\u5148\u7f16\u8bd1&#xff0c;\u7136\u540e\u5f39\u51fa\u4e00\u4e2a\u96c6\u6210\u7ec8\u7aef\u7a97\u53e3&#xff08;\u6216\u6839\u636eexternalConsole\u8bbe\u7f6e\u51b3\u5b9a&#xff09;&#xff0c;\u663e\u793a\u56fe\u50cf\u3002\u6ce8\u610f&#xff1a;\u7531\u4e8e\u4f60\u662f\u901a\u8fc7SSH\u8fdc\u7a0b\u5f00\u53d1&#xff0c;\u56fe\u5f62\u754c\u9762&#xff08;GUI&#xff09;\u9700\u8981X11\u8f6c\u53d1\u652f\u6301\u3002\u786e\u4fdd\u4f60\u8fde\u63a5\u670d\u52a1\u5668\u65f6\u4f7f\u7528\u4e86-X\u6216-Y\u53c2\u6570&#xff08;\u5728VSCode\u7684SSH\u914d\u7f6e\u4e2d\u53ef\u4ee5\u901a\u8fc7ForwardX11 yes\u8bbe\u7f6e&#xff09;&#xff0c;\u5e76\u4e14\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u4e86\u5fc5\u8981\u7684X11\u5e93\u3002\u5982\u679c\u65e0\u6cd5\u663e\u793a\u7a97\u53e3&#xff0c;\u53ef\u4ee5\u6539\u7528\u5c06\u56fe\u50cf\u4fdd\u5b58\u4e3a\u6587\u4ef6\u7684\u65b9\u5f0f\u6765\u9a8c\u8bc1\u3002<\/p>\n<h4>4.2 \u5904\u7406\u5e38\u89c1\u7f16\u8bd1\u4e0e\u94fe\u63a5\u95ee\u9898<\/h4>\n<p>\u5373\u4f7f\u6309\u7167\u6b65\u9aa4\u64cd\u4f5c&#xff0c;\u6709\u65f6\u4e5f\u4f1a\u9047\u5230\u7f16\u8bd1\u9519\u8bef\u3002\u6700\u5e38\u89c1\u7684\u662f\u201c\u672a\u5b9a\u4e49\u7684\u5f15\u7528\u201d\u94fe\u63a5\u9519\u8bef\u3002\u8fd9\u901a\u5e38\u662f\u56e0\u4e3atasks.json\u4e2d\u7684-l\u53c2\u6570\u6ca1\u6709\u5305\u542b\u4ee3\u7801\u6240\u8c03\u7528\u7684\u5168\u90e8OpenCV\u6a21\u5757\u3002<\/p>\n<p>\u4e00\u4e2a\u66f4\u7a33\u5065\u7684\u94fe\u63a5\u65b9\u6cd5\u662f\u4f7f\u7528pkg-config\u5de5\u5177&#xff0c;\u5b83\u80fd\u81ea\u52a8\u751f\u6210\u6240\u6709\u5fc5\u8981\u7684\u7f16\u8bd1\u548c\u94fe\u63a5\u6807\u5fd7\u3002\u4fee\u6539tasks.json\u7684args\u90e8\u5206&#xff1a;<\/p>\n<p>&#034;args&#034;: [<br \/>\n    &#034;-std&#061;c&#043;&#043;17&#034;,<br \/>\n    &#034;-g&#034;,<br \/>\n    &#034;${file}&#034;,<br \/>\n    &#034;-o&#034;,<br \/>\n    &#034;${fileDirname}\/${fileBasenameNoExtension}&#034;,<br \/>\n    &#034;$(pkg-config &#8211;cflags &#8211;libs opencv4)&#034;<br \/>\n],<\/p>\n<p>\u8fd9\u91cc\u7528$(pkg-config &#8211;cflags &#8211;libs opencv4)\u66ff\u6362\u4e86\u624b\u52a8\u7684-I\u548c-L\u3001-l\u53c2\u6570\u3002\u6ce8\u610f&#xff1a;VSCode\u7684task\u9ed8\u8ba4\u53ef\u80fd\u4e0d\u652f\u6301\u76f4\u63a5\u6267\u884cshell\u547d\u4ee4\u66ff\u6362\u3002\u5982\u679c\u62a5\u9519&#xff0c;\u4f60\u9700\u8981\u5148\u901a\u8fc7\u7ec8\u7aef\u547d\u4ee4\u83b7\u53d6\u8fd9\u4e9b\u6807\u5fd7&#xff0c;\u7136\u540e\u624b\u52a8\u7c98\u8d34\u8fdb\u53bb&#xff1a;<\/p>\n<p>pkg-config &#8211;cflags &#8211;libs opencv4<\/p>\n<p>\u5c06\u8f93\u51fa\u7ed3\u679c&#xff08;\u4e00\u4e32\u5f88\u957f\u7684-I&#8230; -L&#8230; -l&#8230;&#xff09;\u590d\u5236\u51fa\u6765&#xff0c;\u66ff\u6362\u6389\u4e0a\u9762\u7684$(pkg-config &#8230;)\u90e8\u5206\u3002<\/p>\n<h4>4.3 \u8fdb\u9636&#xff1a;\u4f7f\u7528CMake\u7ba1\u7406\u590d\u6742\u9879\u76ee<\/h4>\n<p>\u5bf9\u4e8e\u5305\u542b\u591a\u4e2a\u6e90\u6587\u4ef6\u3001\u4f9d\u8d56\u7b2c\u4e09\u65b9\u5e93\u7684\u771f\u5b9e\u89c6\u89c9\u9879\u76ee&#xff0c;\u624b\u52a8\u7f16\u5199tasks.json\u4f1a\u53d8\u5f97\u975e\u5e38\u7e41\u7410\u3002\u8fd9\u65f6&#xff0c;CMake\u662f\u66f4\u597d\u7684\u9009\u62e9\u3002\u5728\u9879\u76ee\u6839\u76ee\u5f55\u521b\u5efaCMakeLists.txt&#xff1a;<\/p>\n<p>cmake_minimum_required(VERSION 3.10)<br \/>\nproject(VisionDemo)<\/p>\n<p>set(CMAKE_CXX_STANDARD 17)<br \/>\nset(CMAKE_CXX_STANDARD_REQUIRED ON)<\/p>\n<p># \u5bfb\u627eOpenCV\u5305<br \/>\nfind_package(OpenCV 4 REQUIRED<br \/>\n    COMPONENTS core imgproc highgui imgcodecs videoio  # \u6307\u5b9a\u9700\u8981\u7684\u7ec4\u4ef6<br \/>\n)<\/p>\n<p>include_directories(${OpenCV_INCLUDE_DIRS})<\/p>\n<p>add_executable(test_opencv test_opencv.cpp)<br \/>\ntarget_link_libraries(test_opencv ${OpenCV_LIBS})<\/p>\n<p>\u7136\u540e&#xff0c;\u4f60\u51e0\u4e4e\u53ef\u4ee5\u4e0d\u518d\u9700\u8981\u624b\u52a8\u914d\u7f6etasks.json\u548cc_cpp_properties.json&#xff08;\u5982\u679c\u5b89\u88c5\u4e86CMake Tools\u6269\u5c55&#xff0c;\u5b83\u4f1a\u81ea\u52a8\u5904\u7406&#xff09;\u3002\u6309Ctrl&#043;Shift&#043;P&#xff0c;\u8fd0\u884c\u201cCMake: Configure\u201d\u6765\u914d\u7f6e\u9879\u76ee&#xff0c;\u7136\u540e\u8fd0\u884c\u201cCMake: Build\u201d\u6765\u7f16\u8bd1\u3002\u8c03\u8bd5\u914d\u7f6elaunch.json\u4e2d\u7684program\u8def\u5f84\u9700\u8981\u6307\u5411CMake\u751f\u6210\u7684\u53ef\u6267\u884c\u6587\u4ef6&#xff08;\u901a\u5e38\u5728build\/\u76ee\u5f55\u4e0b&#xff09;\u3002<\/p>\n<p>\u8fd9\u79cd\u65b9\u5f0f\u7684\u4f18\u52bf\u5728\u4e8e\u8de8\u5e73\u53f0\u6027\u548c\u53ef\u7ba1\u7406\u6027&#xff0c;\u662f\u5927\u578bC&#043;&#043;\u9879\u76ee\u7684\u6807\u51c6\u505a\u6cd5\u3002<\/p>\n<h4>4.4 \u6027\u80fd\u4e0e\u8fdc\u7a0b\u8c03\u8bd5\u5fc3\u5f97<\/h4>\n<p>\u5728\u8fdc\u7a0b\u5f00\u53d1\u4e2d&#xff0c;IO\u5ef6\u8fdf\u662f\u4e0d\u53ef\u907f\u514d\u7684\u3002\u4e3a\u4e86\u83b7\u5f97\u66f4\u6d41\u7545\u7684\u7f16\u8f91\u4f53\u9a8c&#xff0c;\u6211\u4e60\u60ef\u5c06\u9879\u76ee\u76f4\u63a5\u521b\u5efa\u5728\u8fdc\u7a0b\u670d\u52a1\u5668\u7684SSD\u786c\u76d8\u4e0a&#xff0c;\u800c\u4e0d\u662f\u901a\u8fc7\u7f51\u7edc\u6302\u8f7d\u7684\u78c1\u76d8\u3002\u53e6\u5916&#xff0c;VSCode\u7684\u201cRemote &#8211; SSH\u201d\u6269\u5c55\u5141\u8bb8\u4f60\u8bbe\u7f6e\u201cRemote.SSH: Remote Server Listen On Socket\u201d\u9009\u9879&#xff0c;\u5728\u67d0\u4e9b\u7f51\u7edc\u73af\u5883\u4e0b\u53ef\u4ee5\u63d0\u5347\u8fde\u63a5\u7a33\u5b9a\u6027\u3002<\/p>\n<p>\u8c03\u8bd5\u65f6&#xff0c;\u5982\u679c\u7a0b\u5e8f\u6d89\u53caGUI\u6216\u9700\u8981\u590d\u6742\u7684\u4ea4\u4e92&#xff0c;X11\u8f6c\u53d1\u53ef\u80fd\u4f1a\u6bd4\u8f83\u6162\u3002\u5bf9\u4e8e\u7eaf\u7cb9\u7684\u7b97\u6cd5\u9a8c\u8bc1&#xff0c;\u6211\u7ecf\u5e38\u91c7\u7528\u201c\u65e0\u5934\u6a21\u5f0f\u201d&#xff0c;\u5373\u4e0d\u521b\u5efa\u56fe\u5f62\u7a97\u53e3&#xff0c;\u800c\u662f\u5c06\u5904\u7406\u7ed3\u679c&#xff08;\u5982\u68c0\u6d4b\u6846\u3001\u5173\u952e\u70b9&#xff09;\u5750\u6807\u6253\u5370\u51fa\u6765&#xff0c;\u6216\u8005\u5c06\u7ed3\u679c\u56fe\u50cf\u4fdd\u5b58\u4e3a\u6587\u4ef6&#xff0c;\u7136\u540e\u7528VSCode\u7684\u8fdc\u7a0b\u6587\u4ef6\u67e5\u770b\u529f\u80fd\u5feb\u901f\u9884\u89c8\u3002\u5bf9\u4e8e\u9700\u8981\u53cd\u590d\u8fed\u4ee3\u7684\u6df1\u5ea6\u5b66\u4e60\u6a21\u578b\u8bad\u7ec3\u811a\u672c&#xff0c;\u6211\u66f4\u503e\u5411\u4e8e\u4f7f\u7528Python\u548cJupyter Notebook&#xff0c;\u5e76\u901a\u8fc7VSCode\u7684\u201cRemote &#8211; SSH\u201d\u8fde\u63a5\u540e\u4f7f\u7528\u5185\u7f6e\u7684Jupyter\u652f\u6301&#xff0c;\u90a3\u53c8\u662f\u53e6\u4e00\u79cd\u9ad8\u6548\u7684\u5de5\u4f5c\u6d41\u4e86\u3002<\/p>\n<p>\u914d\u7f6e\u73af\u5883\u7684\u8fc7\u7a0b\u5c31\u50cf\u642d\u79ef\u6728&#xff0c;\u6bcf\u4e00\u6b65\u7684\u7a33\u56fa\u90fd\u51b3\u5b9a\u4e86\u540e\u7eed\u5f00\u53d1\u7684\u6548\u7387\u3002\u4ece\u6700\u5f00\u59cb\u7684SSH\u8fde\u63a5\u4f18\u5316&#xff0c;\u5230\u6e90\u7801\u7f16\u8bd1OpenCV\u65f6\u7684\u9009\u9879\u6743\u8861&#xff0c;\u518d\u5230VSCode\u91cc\u4e09\u4e2a\u914d\u7f6e\u6587\u4ef6\u7684\u7cbe\u51c6\u5bf9\u63a5&#xff0c;\u6bcf\u4e00\u4e2a\u73af\u8282\u90fd\u6709\u503c\u5f97\u6df1\u7a76\u7684\u7ec6\u8282\u3002\u6211\u81ea\u5df1\u7684\u4e60\u60ef\u662f&#xff0c;\u6bcf\u914d\u7f6e\u597d\u4e00\u4e2a\u65b0\u670d\u52a1\u5668&#xff0c;\u5c31\u628a\u8fd9\u5957\u6d41\u7a0b\u5199\u6210\u81ea\u52a8\u5316\u811a\u672c&#xff0c;\u8fde\u540c\u4f18\u5316\u7684VSCode\u914d\u7f6e\u7247\u6bb5\u4e00\u8d77\u4fdd\u5b58\u4e0b\u6765\u3002\u4e0b\u6b21\u518d\u9700\u8981\u65f6&#xff0c;\u6548\u7387\u5c31\u80fd\u63d0\u5347\u6570\u500d\u3002\u6bd5\u7adf&#xff0c;\u6211\u4eec\u7684\u76ee\u6807\u662f\u5feb\u901f\u8fdb\u5165\u521b\u9020\u6027\u7684\u7b97\u6cd5\u5b9e\u73b0\u548c\u95ee\u9898\u89e3\u51b3\u9636\u6bb5&#xff0c;\u800c\u4e0d\u662f\u53cd\u590d\u5728\u73af\u5883\u914d\u7f6e\u4e0a\u6d88\u8017\u7cbe\u529b\u3002\u5e0c\u671b\u8fd9\u4efd\u7ed3\u5408\u4e86\u6700\u65b0\u5b9e\u8df5\u7ecf\u9a8c\u7684\u6307\u5357&#xff0c;\u80fd\u5e2e\u4f60\u628a\u8fdc\u7a0bUbuntu\u670d\u52a1\u5668\u6253\u9020\u6210\u4e00\u4e2a\u5f97\u5fc3\u5e94\u624b\u7684\u89c6\u89c9\u8ba1\u7b97\u5de5\u4f5c\u7ad9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u4e91\u7aef\u9ad8\u6548\u6784\u5efa\u89c6\u89c9\u667a\u80fd&#xff1a;VSCode\u8fdc\u7a0b\u5f00\u53d1\u4e0eUbuntu\u670d\u52a1\u5668\u4e0a\u7684OpenCVC\u73af\u5883\u5b9e\u6218<br \/>\n\u6700\u8fd1\u4e24\u5e74&#xff0c;\u6211\u8eab\u8fb9\u8d8a\u6765\u8d8a\u591a\u7684\u8ba1\u7b97\u673a\u89c6\u89c9\u5de5\u7a0b\u5e08\u548c\u7b97\u6cd5\u5f00\u53d1\u8005\u5f00\u59cb\u5c06\u5f00\u53d1\u73af\u5883\u8fc1\u79fb\u5230\u4e91\u7aef\u670d\u52a1\u5668\u4e0a\u3002\u8fd9\u80cc\u540e\u7684\u9a71\u52a8\u529b\u5f88\u76f4\u63a5&#xff1a;\u672c\u5730\u7b14\u8bb0\u672c\u8dd1\u4e0d\u52a8\u5927\u578b\u6570\u636e\u96c6\u8bad\u7ec3&#xff0c;\u663e\u5361\u8d44\u6e90\u6709\u9650&#xff0c;\u800c\u516c\u53f8\u6216\u5b9e\u9a8c\u5ba4\u7684\u670d\u52a1\u5668\u5f80\u5f80\u914d\u7f6e\u4e86\u591a\u5757\u9ad8\u6027\u80fdGPU\u548c\u5145\u8db3\u7684\u5185\u5b58\u3002\u4f46\u968f\u4e4b\u800c\u6765\u7684\u4e00\u4e2a\u73b0\u5b9e\u95ee\u9898\u662f&#xff0c;\u96be\u9053\u6211\u4eec\u6bcf\u6b21\u5199\u4ee3\u7801\u3001\u8c03\u8bd5\u90fd\u8981\u901a\u8fc7SSH\u547d\u4ee4\u884c\u5728\u7ec8\u7aef\u91cc\u64cd\u4f5c\u5417<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[8903,55,1460,103],"topic":[],"class_list":["post-79700","post","type-post","status-publish","format-standard","hentry","category-server","tag-vscode","tag-c","tag-opencv","tag-ubuntu"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>VSCode\u8fdc\u7a0b\u5f00\u53d1\uff1a\u5728Ubuntu\u670d\u52a1\u5668\u4e0a\u914d\u7f6eOpenCV+C++\u73af\u5883\uff082023\u6700\u65b0\u7248\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/79700.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"VSCode\u8fdc\u7a0b\u5f00\u53d1\uff1a\u5728Ubuntu\u670d\u52a1\u5668\u4e0a\u914d\u7f6eOpenCV+C++\u73af\u5883\uff082023\u6700\u65b0\u7248\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5728\u4e91\u7aef\u9ad8\u6548\u6784\u5efa\u89c6\u89c9\u667a\u80fd&#xff1a;VSCode\u8fdc\u7a0b\u5f00\u53d1\u4e0eUbuntu\u670d\u52a1\u5668\u4e0a\u7684OpenCVC\u73af\u5883\u5b9e\u6218 \u6700\u8fd1\u4e24\u5e74&#xff0c;\u6211\u8eab\u8fb9\u8d8a\u6765\u8d8a\u591a\u7684\u8ba1\u7b97\u673a\u89c6\u89c9\u5de5\u7a0b\u5e08\u548c\u7b97\u6cd5\u5f00\u53d1\u8005\u5f00\u59cb\u5c06\u5f00\u53d1\u73af\u5883\u8fc1\u79fb\u5230\u4e91\u7aef\u670d\u52a1\u5668\u4e0a\u3002\u8fd9\u80cc\u540e\u7684\u9a71\u52a8\u529b\u5f88\u76f4\u63a5&#xff1a;\u672c\u5730\u7b14\u8bb0\u672c\u8dd1\u4e0d\u52a8\u5927\u578b\u6570\u636e\u96c6\u8bad\u7ec3&#xff0c;\u663e\u5361\u8d44\u6e90\u6709\u9650&#xff0c;\u800c\u516c\u53f8\u6216\u5b9e\u9a8c\u5ba4\u7684\u670d\u52a1\u5668\u5f80\u5f80\u914d\u7f6e\u4e86\u591a\u5757\u9ad8\u6027\u80fdGPU\u548c\u5145\u8db3\u7684\u5185\u5b58\u3002\u4f46\u968f\u4e4b\u800c\u6765\u7684\u4e00\u4e2a\u73b0\u5b9e\u95ee\u9898\u662f&#xff0c;\u96be\u9053\u6211\u4eec\u6bcf\u6b21\u5199\u4ee3\u7801\u3001\u8c03\u8bd5\u90fd\u8981\u901a\u8fc7SSH\u547d\u4ee4\u884c\u5728\u7ec8\u7aef\u91cc\u64cd\u4f5c\u5417\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/79700.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-03-02T12:07:35+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/79700.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/79700.html\",\"name\":\"VSCode\u8fdc\u7a0b\u5f00\u53d1\uff1a\u5728Ubuntu\u670d\u52a1\u5668\u4e0a\u914d\u7f6eOpenCV+C++\u73af\u5883\uff082023\u6700\u65b0\u7248\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-03-02T12:07:35+00:00\",\"dateModified\":\"2026-03-02T12:07:35+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/79700.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/79700.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/79700.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"VSCode\u8fdc\u7a0b\u5f00\u53d1\uff1a\u5728Ubuntu\u670d\u52a1\u5668\u4e0a\u914d\u7f6eOpenCV+C++\u73af\u5883\uff082023\u6700\u65b0\u7248\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"VSCode\u8fdc\u7a0b\u5f00\u53d1\uff1a\u5728Ubuntu\u670d\u52a1\u5668\u4e0a\u914d\u7f6eOpenCV+C++\u73af\u5883\uff082023\u6700\u65b0\u7248\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/79700.html","og_locale":"zh_CN","og_type":"article","og_title":"VSCode\u8fdc\u7a0b\u5f00\u53d1\uff1a\u5728Ubuntu\u670d\u52a1\u5668\u4e0a\u914d\u7f6eOpenCV+C++\u73af\u5883\uff082023\u6700\u65b0\u7248\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5728\u4e91\u7aef\u9ad8\u6548\u6784\u5efa\u89c6\u89c9\u667a\u80fd&#xff1a;VSCode\u8fdc\u7a0b\u5f00\u53d1\u4e0eUbuntu\u670d\u52a1\u5668\u4e0a\u7684OpenCVC\u73af\u5883\u5b9e\u6218 \u6700\u8fd1\u4e24\u5e74&#xff0c;\u6211\u8eab\u8fb9\u8d8a\u6765\u8d8a\u591a\u7684\u8ba1\u7b97\u673a\u89c6\u89c9\u5de5\u7a0b\u5e08\u548c\u7b97\u6cd5\u5f00\u53d1\u8005\u5f00\u59cb\u5c06\u5f00\u53d1\u73af\u5883\u8fc1\u79fb\u5230\u4e91\u7aef\u670d\u52a1\u5668\u4e0a\u3002\u8fd9\u80cc\u540e\u7684\u9a71\u52a8\u529b\u5f88\u76f4\u63a5&#xff1a;\u672c\u5730\u7b14\u8bb0\u672c\u8dd1\u4e0d\u52a8\u5927\u578b\u6570\u636e\u96c6\u8bad\u7ec3&#xff0c;\u663e\u5361\u8d44\u6e90\u6709\u9650&#xff0c;\u800c\u516c\u53f8\u6216\u5b9e\u9a8c\u5ba4\u7684\u670d\u52a1\u5668\u5f80\u5f80\u914d\u7f6e\u4e86\u591a\u5757\u9ad8\u6027\u80fdGPU\u548c\u5145\u8db3\u7684\u5185\u5b58\u3002\u4f46\u968f\u4e4b\u800c\u6765\u7684\u4e00\u4e2a\u73b0\u5b9e\u95ee\u9898\u662f&#xff0c;\u96be\u9053\u6211\u4eec\u6bcf\u6b21\u5199\u4ee3\u7801\u3001\u8c03\u8bd5\u90fd\u8981\u901a\u8fc7SSH\u547d\u4ee4\u884c\u5728\u7ec8\u7aef\u91cc\u64cd\u4f5c\u5417","og_url":"https:\/\/www.wsisp.com\/helps\/79700.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-03-02T12:07:35+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/79700.html","url":"https:\/\/www.wsisp.com\/helps\/79700.html","name":"VSCode\u8fdc\u7a0b\u5f00\u53d1\uff1a\u5728Ubuntu\u670d\u52a1\u5668\u4e0a\u914d\u7f6eOpenCV+C++\u73af\u5883\uff082023\u6700\u65b0\u7248\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-03-02T12:07:35+00:00","dateModified":"2026-03-02T12:07:35+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/79700.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/79700.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/79700.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"VSCode\u8fdc\u7a0b\u5f00\u53d1\uff1a\u5728Ubuntu\u670d\u52a1\u5668\u4e0a\u914d\u7f6eOpenCV+C++\u73af\u5883\uff082023\u6700\u65b0\u7248\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/79700","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=79700"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/79700\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=79700"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=79700"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=79700"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=79700"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}