[{"data":1,"prerenderedAt":2581},["ShallowReactive",2],{"wiki-page-/en-us/wiki/2023-12-10-dian-kong-shi-jue-huan-jing-da-jian/ch5-opencv-cuda-huan-jing-da-jian":3,"wiki-doc-items-/en-us/wiki/2023-12-10-dian-kong-shi-jue-huan-jing-da-jian/ch5-opencv-cuda-huan-jing-da-jian":2519,"language-switcher-data-/en-us/wiki/2023-12-10-dian-kong-shi-jue-huan-jing-da-jian/ch5-opencv-cuda-huan-jing-da-jian":2565,"wiki-i18n-paths-/en-us/wiki/2023-12-10-dian-kong-shi-jue-huan-jing-da-jian/ch5-opencv-cuda-huan-jing-da-jian":2580},{"id":4,"title":5,"body":6,"canonicalPath":2501,"chapter":735,"chapterSort":2502,"date":2503,"description":60,"docI18nKey":2504,"docKey":2505,"docRoot":2506,"docTitle":2507,"extension":2508,"i18nKey":2509,"isBlogPost":2510,"isWikiDoc":99,"isWikiIndex":2510,"layout":2511,"legacyPath":2511,"locale":2512,"localeSlug":2513,"meta":2514,"navigation":99,"path":2501,"seo":2515,"sourcePath":2516,"sourceStem":2509,"stem":2517,"wikiDepth":96,"__hash__":2518},"content/_i18n/en-us/wiki/2023-12-10-电控视觉环境搭建/ch5-OpenCV__CUDA环境搭建.md","OpenCV CUDA Environment Setup",{"type":7,"value":8,"toc":2497},"minimark",[9,14,23,26,34,47,55,62,67,72,84,173,176,181,186,190,423,426,494,498,505,512,517,522,554,559,588,593,611,616,621,625,630,669,674,677,684,695,880,887,893,896,899,902,907,910,913,916,919,924,929,932,1010,1017,1020,1023,1030,1035,1301,1306,1311,1314,1318,1323,1328,1331,1336,1339,1344,1349,1352,1355,1360,1365,1368,1373,1378,1382,1385,1388,1393,1400,1405,1412,1415,1420,1423,1426,1431,1434,1439,1460,1465,1468,1473,1477,1484,1489,1594,1599,1602,1607,1610,1615,1618,1624,1722,1727,1730,1735,1739,1744,1757,1760,1794,1799,1802,1811,1816,1820,1833,1838,1846,1853,2034,2052,2057,2062,2065,2070,2073,2077,2080,2083,2090,2097,2106,2111,2117,2120,2131,2135,2138,2141,2144,2148,2151,2159,2174,2240,2243,2267,2270,2285,2295,2307,2310,2355,2358,2368,2405,2409,2416,2420,2427,2431,2434,2445,2448,2451,2457,2461,2482,2485,2493],[10,11,13],"h3",{"id":12},"linux","Linux",[15,16,17,18,22],"p",{},"It is more recommended to deploy on Linux. Some deep learning tasks run significantly ",[19,20,21],"strong",{},"much faster"," on Linux than on Windows.",[15,24,25],{},"If you don't have spare disk space for Linux, consider WSL2 (Windows Subsystem for Linux 2). Although there is a slight performance loss, it is still much faster than Windows.",[15,27,28,29],{},"WSL2 Installation Tutorial ",[30,31,33],"a",{"href":32},"/wiki/2024-03-30-linux-jiao-cheng","Vinci Robot Team Linux Getting Started Tutorial",[15,35,36,39,40,43,44],{},[19,37,38],{},"Physical Machine Linux"," > ",[19,41,42],{},"WSL2"," > > ",[19,45,46],{},"Windows",[15,48,49,50,54],{},"Regarding cv_bridge: it is best to compile OpenCV before installing ROS. That way, when ROS is installed, cv_bridge will automatically point to the already installed OpenCV, and ROS will not install another version of OpenCV. This allows the ",[51,52,53],"code",{},"find_package"," command to locate the only cv_bridge and OpenCV on the computer, keeping the system environment clean. For remediation steps, please refer to the FAQ.",[15,56,57],{},[58,59],"img",{"alt":60,"src":61},"","https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image23.webp",[63,64,66],"h4",{"id":65},"ensure-the-graphics-card-is-functioning-properly","Ensure the graphics card is functioning properly.",[15,68,69],{},[19,70,71],{},"Please ensure that the NVIDIA driver, CUDA, and cuDNN are all installed successfully and with the correct versions.",[15,73,74,77,78,81],{},[19,75,76],{},"(Driver, CUDA, and cuDNN Installation Tutorial:"," ",[30,79,80],{"href":32},"Vinci Robotics Team Linux Beginner Tutorial",[19,82,83],{},")",[85,86,90],"pre",{"className":87,"code":88,"language":89,"meta":60,"style":60},"language-bash shiki shiki-themes github-light github-dark","\n# 检查显卡驱动\nnvidia-smi\n\n# 验证CUDA是否安装成功\nnvcc -V\n\n# 检查cuDNN版本命令(仅仅只是查了头文件)\ncat /usr/local/cuda/include/cudnn_version.h | grep CUDNN_MAJOR -A 2\n","bash",[51,91,92,101,108,115,120,126,136,141,147],{"__ignoreMap":60},[93,94,97],"span",{"class":95,"line":96},"line",1,[93,98,100],{"emptyLinePlaceholder":99},true,"\n",[93,102,104],{"class":95,"line":103},2,[93,105,107],{"class":106},"sJ8bj","# 检查显卡驱动\n",[93,109,111],{"class":95,"line":110},3,[93,112,114],{"class":113},"sScJk","nvidia-smi\n",[93,116,118],{"class":95,"line":117},4,[93,119,100],{"emptyLinePlaceholder":99},[93,121,123],{"class":95,"line":122},5,[93,124,125],{"class":106},"# 验证CUDA是否安装成功\n",[93,127,129,132],{"class":95,"line":128},6,[93,130,131],{"class":113},"nvcc",[93,133,135],{"class":134},"sj4cs"," -V\n",[93,137,139],{"class":95,"line":138},7,[93,140,100],{"emptyLinePlaceholder":99},[93,142,144],{"class":95,"line":143},8,[93,145,146],{"class":106},"# 检查cuDNN版本命令(仅仅只是查了头文件)\n",[93,148,150,153,157,161,164,167,170],{"class":95,"line":149},9,[93,151,152],{"class":113},"cat",[93,154,156],{"class":155},"sZZnC"," /usr/local/cuda/include/cudnn_version.h",[93,158,160],{"class":159},"szBVR"," |",[93,162,163],{"class":113}," grep",[93,165,166],{"class":155}," CUDNN_MAJOR",[93,168,169],{"class":134}," -A",[93,171,172],{"class":134}," 2\n",[15,174,175],{},"If you see an image like the one below, it means you have the NVIDIA driver, CUDA, and cuDNN installed.",[15,177,178],{},[58,179],{"alt":60,"src":180},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image24.webp",[15,182,183],{},[58,184],{"alt":60,"src":185},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image25.webp",[63,187,189],{"id":188},"install-dependencies","Install dependencies",[85,191,193],{"className":87,"code":192,"language":89,"meta":60,"style":60},"\n# Debian系系统\nsudo apt install -y libcurl4 build-essential pkg-config cmake-gui \\\n    libopenblas-dev libeigen3-dev libtbb-dev \\\n    libavcodec-dev libavformat-dev \\\n    libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev \\\n    libswscale-dev libgtk-3-dev libpng-dev libjpeg-dev \\\n    libcanberra-gtk-module libcanberra-gtk3-module libv4l-dev python3-dev python3-numpy\n\n# RHEL红帽系系统\nbash -c 'sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm'\nsudo dnf install -y curl gcc gcc-c++ make cmake cmake-gui \\\n    openblas-devel eigen3-devel tbb-devel \\\n    ffmpeg-libs ffmpeg-devel \\\n    gstreamer1-plugins-base-devel gstreamer1-devel \\\n    gtk3-devel libpng-devel libjpeg-devel \\\n    libc=aanberra-gtk3 libcanberra-devel v4l-utils v4l2loopback openexr-devel python3-dev python3-numpy\n\n",[51,194,195,199,204,233,246,256,266,282,299,303,309,320,351,365,376,387,401],{"__ignoreMap":60},[93,196,197],{"class":95,"line":96},[93,198,100],{"emptyLinePlaceholder":99},[93,200,201],{"class":95,"line":103},[93,202,203],{"class":106},"# Debian系系统\n",[93,205,206,209,212,215,218,221,224,227,230],{"class":95,"line":110},[93,207,208],{"class":113},"sudo",[93,210,211],{"class":155}," apt",[93,213,214],{"class":155}," install",[93,216,217],{"class":134}," -y",[93,219,220],{"class":155}," libcurl4",[93,222,223],{"class":155}," build-essential",[93,225,226],{"class":155}," pkg-config",[93,228,229],{"class":155}," cmake-gui",[93,231,232],{"class":134}," \\\n",[93,234,235,238,241,244],{"class":95,"line":117},[93,236,237],{"class":155},"    libopenblas-dev",[93,239,240],{"class":155}," libeigen3-dev",[93,242,243],{"class":155}," libtbb-dev",[93,245,232],{"class":134},[93,247,248,251,254],{"class":95,"line":122},[93,249,250],{"class":155},"    libavcodec-dev",[93,252,253],{"class":155}," libavformat-dev",[93,255,232],{"class":134},[93,257,258,261,264],{"class":95,"line":128},[93,259,260],{"class":155},"    libgstreamer-plugins-base1.0-dev",[93,262,263],{"class":155}," libgstreamer1.0-dev",[93,265,232],{"class":134},[93,267,268,271,274,277,280],{"class":95,"line":138},[93,269,270],{"class":155},"    libswscale-dev",[93,272,273],{"class":155}," libgtk-3-dev",[93,275,276],{"class":155}," libpng-dev",[93,278,279],{"class":155}," libjpeg-dev",[93,281,232],{"class":134},[93,283,284,287,290,293,296],{"class":95,"line":143},[93,285,286],{"class":155},"    libcanberra-gtk-module",[93,288,289],{"class":155}," libcanberra-gtk3-module",[93,291,292],{"class":155}," libv4l-dev",[93,294,295],{"class":155}," python3-dev",[93,297,298],{"class":155}," python3-numpy\n",[93,300,301],{"class":95,"line":149},[93,302,100],{"emptyLinePlaceholder":99},[93,304,306],{"class":95,"line":305},10,[93,307,308],{"class":106},"# RHEL红帽系系统\n",[93,310,312,314,317],{"class":95,"line":311},11,[93,313,89],{"class":113},[93,315,316],{"class":134}," -c",[93,318,319],{"class":155}," 'sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm'\n",[93,321,323,325,328,330,332,335,338,341,344,347,349],{"class":95,"line":322},12,[93,324,208],{"class":113},[93,326,327],{"class":155}," dnf",[93,329,214],{"class":155},[93,331,217],{"class":134},[93,333,334],{"class":155}," curl",[93,336,337],{"class":155}," gcc",[93,339,340],{"class":155}," gcc-c++",[93,342,343],{"class":155}," make",[93,345,346],{"class":155}," cmake",[93,348,229],{"class":155},[93,350,232],{"class":134},[93,352,354,357,360,363],{"class":95,"line":353},13,[93,355,356],{"class":155},"    openblas-devel",[93,358,359],{"class":155}," eigen3-devel",[93,361,362],{"class":155}," tbb-devel",[93,364,232],{"class":134},[93,366,368,371,374],{"class":95,"line":367},14,[93,369,370],{"class":155},"    ffmpeg-libs",[93,372,373],{"class":155}," ffmpeg-devel",[93,375,232],{"class":134},[93,377,379,382,385],{"class":95,"line":378},15,[93,380,381],{"class":155},"    gstreamer1-plugins-base-devel",[93,383,384],{"class":155}," gstreamer1-devel",[93,386,232],{"class":134},[93,388,390,393,396,399],{"class":95,"line":389},16,[93,391,392],{"class":155},"    gtk3-devel",[93,394,395],{"class":155}," libpng-devel",[93,397,398],{"class":155}," libjpeg-devel",[93,400,232],{"class":134},[93,402,404,407,410,413,416,419,421],{"class":95,"line":403},17,[93,405,406],{"class":155},"    libc=aanberra-gtk3",[93,408,409],{"class":155}," libcanberra-devel",[93,411,412],{"class":155}," v4l-utils",[93,414,415],{"class":155}," v4l2loopback",[93,417,418],{"class":155}," openexr-devel",[93,420,295],{"class":155},[93,422,298],{"class":155},[15,424,425],{},"The table below explains these dependencies.",[427,428,429,440],"table",{},[430,431,432],"thead",{},[433,434,435],"tr",{},[436,437,439],"th",{"align":438},"left","Generate the main dependencies of OpenCV.",[441,442,443,449,454,459,464,469,474,479,484,489],"tbody",{},[433,444,445],{},[446,447,448],"td",{"align":438},"Name",[433,450,451],{},[446,452,453],{"align":438},"Build system",[433,455,456],{},[446,457,458],{"align":438},"Image library",[433,460,461],{},[446,462,463],{"align":438},"OpenBLAS",[433,465,466],{},[446,467,468],{"align":438},"Eigen3",[433,470,471],{},[446,472,473],{"align":438},"Intel TBB",[433,475,476],{},[446,477,478],{"align":438},"FFMPEG",[433,480,481],{},[446,482,483],{"align":438},"GStreamer",[433,485,486],{},[446,487,488],{"align":438},"GTK",[433,490,491],{},[446,492,493],{"align":438},"Video4Linux",[63,495,497],{"id":496},"download-the-opencv-source-code","Download the OpenCV source code",[15,499,500],{},[30,501,502],{"href":502,"rel":503},"https://github.com/opencv/opencv",[504],"nofollow",[15,506,507],{},[30,508,511],{"href":509,"rel":510},"https://github.com/opencv/opencv%5C_contrib",[504],"https://github.com/opencv/opencv\\_contrib",[15,513,514],{},[58,515],{"alt":60,"src":516},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image26.webp",[15,518,519],{},[58,520],{"alt":60,"src":521},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image27.webp",[85,523,525],{"className":87,"code":524,"language":89,"meta":60,"style":60},"\n# 创建文件夹存放源码\nmkdir -p ooppccvv\ncd ooppccvv\n",[51,526,527,531,536,547],{"__ignoreMap":60},[93,528,529],{"class":95,"line":96},[93,530,100],{"emptyLinePlaceholder":99},[93,532,533],{"class":95,"line":103},[93,534,535],{"class":106},"# 创建文件夹存放源码\n",[93,537,538,541,544],{"class":95,"line":110},[93,539,540],{"class":113},"mkdir",[93,542,543],{"class":134}," -p",[93,545,546],{"class":155}," ooppccvv\n",[93,548,549,552],{"class":95,"line":117},[93,550,551],{"class":134},"cd",[93,553,546],{"class":155},[15,555,556],{},[58,557],{"alt":60,"src":558},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image28.webp",[85,560,562],{"className":87,"code":561,"language":89,"meta":60,"style":60},"\n# 解压源码\nunzip ./opencv-4.11.0.zip\nunzip ./opencv_contrib-4.11.0.zip\n",[51,563,564,568,573,581],{"__ignoreMap":60},[93,565,566],{"class":95,"line":96},[93,567,100],{"emptyLinePlaceholder":99},[93,569,570],{"class":95,"line":103},[93,571,572],{"class":106},"# 解压源码\n",[93,574,575,578],{"class":95,"line":110},[93,576,577],{"class":113},"unzip",[93,579,580],{"class":155}," ./opencv-4.11.0.zip\n",[93,582,583,585],{"class":95,"line":117},[93,584,577],{"class":113},[93,586,587],{"class":155}," ./opencv_contrib-4.11.0.zip\n",[15,589,590],{},[58,591],{"alt":60,"src":592},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image29.webp",[15,594,595,596,599,600,603,604,607,608],{},"Verify that the ",[51,597,598],{},"opencv"," directory and the ",[51,601,602],{},"opencv-contrib"," directory are located within the same parent directory, and confirm that both directories contain a ",[51,605,606],{},"modules"," subdirectory: ",[19,609,610],{},"(Generally, no need to verify — as long as you follow the commands I provided above, it will be fine)",[15,612,613],{},[58,614],{"alt":60,"src":615},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image30.webp",[15,617,618],{},[58,619],{"alt":60,"src":620},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image31.webp",[63,622,624],{"id":623},"cmake-compilation","CMake compilation",[626,627,629],"h5",{"id":628},"preparation-work","Preparation Work",[85,631,633],{"className":87,"code":632,"language":89,"meta":60,"style":60},"\n# 创建build文件夹用于装CMake生成的内容:\ncd opencv-4.11.0\nmkdir -p build && cd build\n",[51,634,635,639,644,651],{"__ignoreMap":60},[93,636,637],{"class":95,"line":96},[93,638,100],{"emptyLinePlaceholder":99},[93,640,641],{"class":95,"line":103},[93,642,643],{"class":106},"# 创建build文件夹用于装CMake生成的内容:\n",[93,645,646,648],{"class":95,"line":110},[93,647,551],{"class":134},[93,649,650],{"class":155}," opencv-4.11.0\n",[93,652,653,655,657,660,664,666],{"class":95,"line":117},[93,654,540],{"class":113},[93,656,543],{"class":134},[93,658,659],{"class":155}," build",[93,661,663],{"class":662},"sVt8B"," && ",[93,665,551],{"class":134},[93,667,668],{"class":155}," build\n",[15,670,671],{},[58,672],{"alt":60,"src":673},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image32.webp",[15,675,676],{},"OpenCV is compiled using CMake and Makefile, with numerous compilation options. For details, see (you can skip this, though CMake compilation options may vary across different versions):",[15,678,679],{},[30,680,683],{"href":681,"rel":682},"https://docs.opencv.org/4.10.0/db/d05/tutorial%5C_config%5C_reference.html",[504],"https://docs.opencv.org/4.10.0/db/d05/tutorial\\_config\\_reference.html",[15,685,686,687,690,691,694],{},"The items crossed out below are parameters that no longer exist in OpenCV 4.11.0, but may still be valid in other versions of OpenCV. Please check on your own using the ",[51,688,689],{},"CMake-LAH"," (not recommended) command or ",[51,692,693],{},"CMake-gui"," (recommended).",[427,696,697,704],{},[430,698,699],{},[433,700,701],{},[436,702,703],{"align":438},"OpenCV 4.11.0 CMake Common Build Options Table Overview",[441,705,706,711,716,721,726,731,736,741,746,751,756,761,766,771,776,781,786,791,796,801,806,811,816,821,826,831,836,841,846,851,856,861,866,871,876],{},[433,707,708],{},[446,709,710],{"align":438},"Serial number",[433,712,713],{},[446,714,715],{"align":438},"1",[433,717,718],{},[446,719,720],{"align":438},"2",[433,722,723],{},[446,724,725],{"align":438},"3",[433,727,728],{},[446,729,730],{"align":438},"4",[433,732,733],{},[446,734,735],{"align":438},"5",[433,737,738],{},[446,739,740],{"align":438},"6",[433,742,743],{},[446,744,745],{"align":438},"7",[433,747,748],{},[446,749,750],{"align":438},"8",[433,752,753],{},[446,754,755],{"align":438},"9",[433,757,758],{},[446,759,760],{"align":438},"10",[433,762,763],{},[446,764,765],{"align":438},"11",[433,767,768],{},[446,769,770],{"align":438},"12",[433,772,773],{},[446,774,775],{"align":438},"13",[433,777,778],{},[446,779,780],{"align":438},"14",[433,782,783],{},[446,784,785],{"align":438},"15",[433,787,788],{},[446,789,790],{"align":438},"16",[433,792,793],{},[446,794,795],{"align":438},"17",[433,797,798],{},[446,799,800],{"align":438},"18",[433,802,803],{},[446,804,805],{"align":438},"19",[433,807,808],{},[446,809,810],{"align":438},"20",[433,812,813],{},[446,814,815],{"align":438},"21",[433,817,818],{},[446,819,820],{"align":438},"22",[433,822,823],{},[446,824,825],{"align":438},"23",[433,827,828],{},[446,829,830],{"align":438},"24",[433,832,833],{},[446,834,835],{"align":438},"25",[433,837,838],{},[446,839,840],{"align":438},"26",[433,842,843],{},[446,844,845],{"align":438},"27",[433,847,848],{},[446,849,850],{"align":438},"28",[433,852,853],{},[446,854,855],{"align":438},"29",[433,857,858],{},[446,859,860],{"align":438},"30",[433,862,863],{},[446,864,865],{"align":438},"31",[433,867,868],{},[446,869,870],{"align":438},"32",[433,872,873],{},[446,874,875],{"align":438},"33",[433,877,878],{},[446,879],{"align":438},[881,882,883],"ol",{},[884,885,886],"li",{},"Query GPU Compute Capability (CUDA_ARCH_BIN parameter):",[15,888,889],{},[30,890,891],{"href":891,"rel":892},"https://developer.nvidia.com/cuda-gpus#collapseOne",[504],[15,894,895],{},"After entering the website,",[15,897,898],{},"GeForce represents NVIDIA's gaming series graphics cards, common examples include the GTX 1080, RTX 3080, RTX 4080, and others.",[15,900,901],{},"Jetson represents the industrial computer series GPU.",[15,903,904],{},[58,905],{"alt":60,"src":906},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image33.webp",[15,908,909],{},"I have a 3060 Laptop (a mobile laptop GPU, so look for the 3060 under the Notebook column on the right).",[15,911,912],{},"If you have a 3060 (desktop version, look for the 3060 in the left column)",[15,914,915],{},"From the diagram, my GPU Compute Capability is 8.6, so my CMake CUDA_ARCH_BIN parameter is set to 8.6.",[15,917,918],{},"CUDA_ARCH_PTX is the highest value of BIN. I only set one BIN, so the highest value is 8.6. (Only if you are replacing your computer's graphics card should you set multiple values for BIN, in which case you need to include all the values for the graphics cards you intend to use in BIN, while PTX only needs the highest value of BIN.)",[15,920,921],{},[58,922],{"alt":60,"src":923},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image34.webp",[881,925,926],{"start":103},[884,927,928],{},"To check the Python3 path query, please use it in the terminal and verify that results are generated. Ensure the printed output meets expectations before proceeding with the following CMake generation steps. (No need to memorize the path.)",[15,930,931],{},"Of course, you can also copy the path returned by the command, as this path is the value of the parameter.",[85,933,935],{"className":87,"code":934,"language":89,"meta":60,"style":60},"\n# Python3 C++接口库的路径\npython3 -c \"import sysconfig; from os.path import join; print(join(sysconfig.get_config_var('LIBDIR'), sysconfig.get_config_var('LDLIBRARY')))\"\n\n# Python3 矩阵库头文件的路径\npython3 -c \"import numpy; print(numpy.get_include())\"\n\n# OpenCV 的 Python3 包安装的路径。\npython3 -c \"import sysconfig; print(sysconfig.get_path('purelib'))\"\n\n# Python3 头文件的路径\npython3 -c \"import sysconfig; print(sysconfig.get_path('include'))\"\n",[51,936,937,941,946,956,960,965,974,978,983,992,996,1001],{"__ignoreMap":60},[93,938,939],{"class":95,"line":96},[93,940,100],{"emptyLinePlaceholder":99},[93,942,943],{"class":95,"line":103},[93,944,945],{"class":106},"# Python3 C++接口库的路径\n",[93,947,948,951,953],{"class":95,"line":110},[93,949,950],{"class":113},"python3",[93,952,316],{"class":134},[93,954,955],{"class":155}," \"import sysconfig; from os.path import join; print(join(sysconfig.get_config_var('LIBDIR'), sysconfig.get_config_var('LDLIBRARY')))\"\n",[93,957,958],{"class":95,"line":117},[93,959,100],{"emptyLinePlaceholder":99},[93,961,962],{"class":95,"line":122},[93,963,964],{"class":106},"# Python3 矩阵库头文件的路径\n",[93,966,967,969,971],{"class":95,"line":128},[93,968,950],{"class":113},[93,970,316],{"class":134},[93,972,973],{"class":155}," \"import numpy; print(numpy.get_include())\"\n",[93,975,976],{"class":95,"line":138},[93,977,100],{"emptyLinePlaceholder":99},[93,979,980],{"class":95,"line":143},[93,981,982],{"class":106},"# OpenCV 的 Python3 包安装的路径。\n",[93,984,985,987,989],{"class":95,"line":149},[93,986,950],{"class":113},[93,988,316],{"class":134},[93,990,991],{"class":155}," \"import sysconfig; print(sysconfig.get_path('purelib'))\"\n",[93,993,994],{"class":95,"line":305},[93,995,100],{"emptyLinePlaceholder":99},[93,997,998],{"class":95,"line":311},[93,999,1000],{"class":106},"# Python3 头文件的路径\n",[93,1002,1003,1005,1007],{"class":95,"line":322},[93,1004,950],{"class":113},[93,1006,316],{"class":134},[93,1008,1009],{"class":155}," \"import sysconfig; print(sysconfig.get_path('include'))\"\n",[626,1011,1013,1014],{"id":1012},"cmake-compilation-choose-one-of-the-two-methods","CMake Compilation ",[19,1015,1016],{},"(Choose one of the two methods)",[15,1018,1019],{},"Because computer configurations vary, each machine has different hardware, software (dependency packages), and so on. So just because it runs on my computer doesn't mean it will run successfully on yours right away.",[15,1021,1022],{},"It's rarely smooth sailing, so if you run into issues, promptly search for answers on Baidu, Google, or the OpenCV forum.",[15,1024,1025,1026],{},"Forum:",[30,1027,1028],{"href":1028,"rel":1029},"https://forum.opencv.org/",[504],[1031,1032,1034],"h6",{"id":1033},"cmake-terminal-command-method-not-recommended-the-gui-method-is-preferred-as-the-terminal-approach-is-prone-to-strange-issues","CMake terminal command method (not recommended; the GUI method is preferred, as the terminal approach is prone to strange issues)",[85,1036,1038],{"className":87,"code":1037,"language":89,"meta":60,"style":60},"cmake .. -DCMAKE_BUILD_TYPE=Release \\\n        -DCMAKE_INSTALL_PREFIX=/usr/local \\\n        -DBUILD_SHARED_LIBS=ON \\\n        -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-4.11.0/modules \\\n        -DOPENCV_ENABLE_NONFREE=ON \\\n        -DBUILD_TESTS=ON \\\n        -DBUILD_PERF_TESTS=ON \\\n        -DOPENCV_GENERATE_PKGCONFIG=ON \\\n        -DWITH_GTK=ON \\\n        -DWITH_CUDA=ON \\\n        -DENABLE_FAST_MATH=ON \\\n        -DCUDA_FAST_MATH=ON \\\n        -DWITH_CUBLAS=ON \\\n        -DCUDA_ARCH_BIN=\"8.6\" \\\n        -DCUDA_ARCH_PTX=\"8.6\" \\\n        -DCUDA_HOST_COMPILER=/usr/bin/gcc-13 \\\n        -DWITH_CUDNN=ON \\\n        -DOPENCV_DNN_CUDA=ON \\\n        -DWITH_IPP=ON \\\n        -DWITH_TBB=ON \\\n        -DWITH_OPENMP=ON \\\n        -DWITH_PTHREADS_PF=ON \\\n        -DOPENCV_PYTHON3_VERSION=3.12 \\\n        -DPYTHON3_EXECUTABLE=/usr/bin/python3 \\\n        -DPYTHON3_LIBRARY=$(python3 -c \"import sysconfig; from os.path import join; print(join(sysconfig.get_config_var('LIBDIR'), sysconfig.get_config_var('LDLIBRARY')))\") \\\n        -DPYTHON3_NUMPY_INCLUDE_DIRS=$(python3 -c \"import numpy; print(numpy.get_include())\") \\\n        -DPYTHON3_PACKAGES_PATH=$(python3 -c \"import sysconfig; print(sysconfig.get_path('purelib'))\") \\\n        -DPYTHON3_INCLUDE_DIR=$(python3 -c \"import sysconfig; print(sysconfig.get_path('include'))\") \\\n        -DWITH_OPENGL=ON\n\n",[51,1039,1040,1053,1060,1067,1074,1081,1088,1095,1102,1109,1116,1123,1130,1137,1147,1156,1163,1170,1178,1186,1194,1202,1210,1218,1226,1244,1261,1278,1295],{"__ignoreMap":60},[93,1041,1042,1045,1048,1051],{"class":95,"line":96},[93,1043,1044],{"class":113},"cmake",[93,1046,1047],{"class":155}," ..",[93,1049,1050],{"class":134}," -DCMAKE_BUILD_TYPE=Release",[93,1052,232],{"class":134},[93,1054,1055,1058],{"class":95,"line":103},[93,1056,1057],{"class":134},"        -DCMAKE_INSTALL_PREFIX=/usr/local",[93,1059,232],{"class":134},[93,1061,1062,1065],{"class":95,"line":110},[93,1063,1064],{"class":134},"        -DBUILD_SHARED_LIBS=ON",[93,1066,232],{"class":134},[93,1068,1069,1072],{"class":95,"line":117},[93,1070,1071],{"class":134},"        -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-4.11.0/modules",[93,1073,232],{"class":134},[93,1075,1076,1079],{"class":95,"line":122},[93,1077,1078],{"class":134},"        -DOPENCV_ENABLE_NONFREE=ON",[93,1080,232],{"class":134},[93,1082,1083,1086],{"class":95,"line":128},[93,1084,1085],{"class":134},"        -DBUILD_TESTS=ON",[93,1087,232],{"class":134},[93,1089,1090,1093],{"class":95,"line":138},[93,1091,1092],{"class":134},"        -DBUILD_PERF_TESTS=ON",[93,1094,232],{"class":134},[93,1096,1097,1100],{"class":95,"line":143},[93,1098,1099],{"class":134},"        -DOPENCV_GENERATE_PKGCONFIG=ON",[93,1101,232],{"class":134},[93,1103,1104,1107],{"class":95,"line":149},[93,1105,1106],{"class":134},"        -DWITH_GTK=ON",[93,1108,232],{"class":134},[93,1110,1111,1114],{"class":95,"line":305},[93,1112,1113],{"class":134},"        -DWITH_CUDA=ON",[93,1115,232],{"class":134},[93,1117,1118,1121],{"class":95,"line":311},[93,1119,1120],{"class":134},"        -DENABLE_FAST_MATH=ON",[93,1122,232],{"class":134},[93,1124,1125,1128],{"class":95,"line":322},[93,1126,1127],{"class":134},"        -DCUDA_FAST_MATH=ON",[93,1129,232],{"class":134},[93,1131,1132,1135],{"class":95,"line":353},[93,1133,1134],{"class":134},"        -DWITH_CUBLAS=ON",[93,1136,232],{"class":134},[93,1138,1139,1142,1145],{"class":95,"line":367},[93,1140,1141],{"class":134},"        -DCUDA_ARCH_BIN=",[93,1143,1144],{"class":155},"\"8.6\"",[93,1146,232],{"class":134},[93,1148,1149,1152,1154],{"class":95,"line":378},[93,1150,1151],{"class":134},"        -DCUDA_ARCH_PTX=",[93,1153,1144],{"class":155},[93,1155,232],{"class":134},[93,1157,1158,1161],{"class":95,"line":389},[93,1159,1160],{"class":134},"        -DCUDA_HOST_COMPILER=/usr/bin/gcc-13",[93,1162,232],{"class":134},[93,1164,1165,1168],{"class":95,"line":403},[93,1166,1167],{"class":134},"        -DWITH_CUDNN=ON",[93,1169,232],{"class":134},[93,1171,1173,1176],{"class":95,"line":1172},18,[93,1174,1175],{"class":134},"        -DOPENCV_DNN_CUDA=ON",[93,1177,232],{"class":134},[93,1179,1181,1184],{"class":95,"line":1180},19,[93,1182,1183],{"class":134},"        -DWITH_IPP=ON",[93,1185,232],{"class":134},[93,1187,1189,1192],{"class":95,"line":1188},20,[93,1190,1191],{"class":134},"        -DWITH_TBB=ON",[93,1193,232],{"class":134},[93,1195,1197,1200],{"class":95,"line":1196},21,[93,1198,1199],{"class":134},"        -DWITH_OPENMP=ON",[93,1201,232],{"class":134},[93,1203,1205,1208],{"class":95,"line":1204},22,[93,1206,1207],{"class":134},"        -DWITH_PTHREADS_PF=ON",[93,1209,232],{"class":134},[93,1211,1213,1216],{"class":95,"line":1212},23,[93,1214,1215],{"class":134},"        -DOPENCV_PYTHON3_VERSION=3.12",[93,1217,232],{"class":134},[93,1219,1221,1224],{"class":95,"line":1220},24,[93,1222,1223],{"class":134},"        -DPYTHON3_EXECUTABLE=/usr/bin/python3",[93,1225,232],{"class":134},[93,1227,1229,1232,1234,1237,1240,1242],{"class":95,"line":1228},25,[93,1230,1231],{"class":134},"        -DPYTHON3_LIBRARY=$(",[93,1233,950],{"class":113},[93,1235,1236],{"class":134}," -c ",[93,1238,1239],{"class":155},"\"import sysconfig; from os.path import join; print(join(sysconfig.get_config_var('LIBDIR'), sysconfig.get_config_var('LDLIBRARY')))\"",[93,1241,83],{"class":134},[93,1243,232],{"class":134},[93,1245,1247,1250,1252,1254,1257,1259],{"class":95,"line":1246},26,[93,1248,1249],{"class":134},"        -DPYTHON3_NUMPY_INCLUDE_DIRS=$(",[93,1251,950],{"class":113},[93,1253,1236],{"class":134},[93,1255,1256],{"class":155},"\"import numpy; print(numpy.get_include())\"",[93,1258,83],{"class":134},[93,1260,232],{"class":134},[93,1262,1264,1267,1269,1271,1274,1276],{"class":95,"line":1263},27,[93,1265,1266],{"class":134},"        -DPYTHON3_PACKAGES_PATH=$(",[93,1268,950],{"class":113},[93,1270,1236],{"class":134},[93,1272,1273],{"class":155},"\"import sysconfig; print(sysconfig.get_path('purelib'))\"",[93,1275,83],{"class":134},[93,1277,232],{"class":134},[93,1279,1281,1284,1286,1288,1291,1293],{"class":95,"line":1280},28,[93,1282,1283],{"class":134},"        -DPYTHON3_INCLUDE_DIR=$(",[93,1285,950],{"class":113},[93,1287,1236],{"class":134},[93,1289,1290],{"class":155},"\"import sysconfig; print(sysconfig.get_path('include'))\"",[93,1292,83],{"class":134},[93,1294,232],{"class":134},[93,1296,1298],{"class":95,"line":1297},29,[93,1299,1300],{"class":134},"        -DWITH_OPENGL=ON\n",[15,1302,1303],{},[58,1304],{"alt":60,"src":1305},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image35.webp",[15,1307,1308],{},[58,1309],{"alt":60,"src":1310},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image36.webp",[15,1312,1313],{},"You can add, remove, or modify these options as needed, following the previous instructions. If the cmake command reports an error, it is often due to missing dependencies or incorrect generator options — check the error messages to troubleshoot. If it runs successfully, you can proceed with the build (see the Makefiles build section):",[1031,1315,1317],{"id":1316},"cmake-gui-method-recommended-though-more-cumbersome-but-with-fewer-issues-and-easier-troubleshooting","CMake-GUI method (recommended, though more cumbersome, but with fewer issues and easier troubleshooting)",[881,1319,1320],{},[884,1321,1322],{},"Open CMake-GUI:",[15,1324,1325],{},[58,1326],{"alt":60,"src":1327},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image37.webp",[15,1329,1330],{},"Configure these two paths.",[15,1332,1333],{},[58,1334],{"alt":60,"src":1335},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image38.webp",[15,1337,1338],{},"Click the configuration option in the lower left corner and select Makefiles.",[15,1340,1341],{},[58,1342],{"alt":60,"src":1343},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image39.webp",[881,1345,1346],{"start":103},[884,1347,1348],{},"Configuration parameters",[15,1350,1351],{},"Configure each parameter one by one according to the table above. After filling in all the options, click Configure to complete the setup.",[15,1353,1354],{},"If you encounter issues while configuring parameters, please refer to the Common Problems section below.",[15,1356,1357],{},[58,1358],{"alt":60,"src":1359},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image40.webp",[15,1361,1362],{},[58,1363],{"alt":60,"src":1364},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image41.webp",[15,1366,1367],{},"You can add, remove, or modify these options as needed, following the previous instructions. If the cmake command reports an error, it is often due to missing dependencies or incorrect generator options — check the error messages to troubleshoot. If it runs successfully, you can proceed to compile (using Makefiles):",[15,1369,1370],{},[58,1371],{"alt":60,"src":1372},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image42.webp",[15,1374,1375],{},[58,1376],{"alt":60,"src":1377},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image43.webp",[1031,1379,1381],{"id":1380},"frequently-asked-questions","Frequently Asked Questions",[15,1383,1384],{},"####### No CUDA Option\nSometimes CMake-GUI only displays certain parameters after compilation (for example, CUDA-related options only appear after compiling WITH_CUDA).",[15,1386,1387],{},"So you need to first check WITH_CUDA, then click config in the lower-left corner. This will make the CUDA-related options appear, and then you can configure those options.",[15,1389,1390],{},[58,1391],{"alt":60,"src":1392},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image44.webp",[15,1394,1395,1396,1399],{},"The path of the module is different from the command line method.\nIt is important to note that this relative path is different from the parameter configured by directly typing the CMake command; here it is ",[51,1397,1398],{},"../opencv_contrib-4.11.0/modules",".",[15,1401,1402],{},[58,1403],{"alt":60,"src":1404},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image45.webp",[15,1406,1407,1408,1411],{},"The type of the ",[51,1409,1410],{},"OPENCV_PYTHON3_VERSION"," parameter is incorrect.\nIn cmake-gui, for some reason the type of the OPENCV_PYTHON3_VERSION parameter became boolean.",[15,1413,1414],{},"Need to manually change to string data type.",[15,1416,1417],{},[58,1418],{"alt":60,"src":1419},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image46.webp",[15,1421,1422],{},"The image above shows the issue — it's actually a boolean value here.",[15,1424,1425],{},"First, delete that option.",[15,1427,1428],{},[58,1429],{"alt":60,"src":1430},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image47.webp",[15,1432,1433],{},"Add this option again.",[15,1435,1436],{},[58,1437],{"alt":60,"src":1438},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image48.webp",[85,1440,1444],{"className":1441,"code":1442,"language":1443,"meta":60,"style":60},"language-Dockerfile shiki shiki-themes github-light github-dark","\n# 查看python3版本\npython3 --version\n","Dockerfile",[51,1445,1446,1450,1455],{"__ignoreMap":60},[93,1447,1448],{"class":95,"line":96},[93,1449,100],{"emptyLinePlaceholder":99},[93,1451,1452],{"class":95,"line":103},[93,1453,1454],{},"# 查看python3版本\n",[93,1456,1457],{"class":95,"line":110},[93,1458,1459],{},"python3 --version\n",[15,1461,1462],{},[58,1463],{"alt":60,"src":1464},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image49.webp",[15,1466,1467],{},"Fill in 3.12 below; no need to fill in the minor version number after it.",[15,1469,1470],{},[58,1471],{"alt":60,"src":1472},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image50.webp",[63,1474,1476],{"id":1475},"makefiles-compilation","Makefiles Compilation",[15,1478,1479,1480,1483],{},"The meaning of the ",[51,1481,1482],{},"-j"," parameter is to use all CPUs for compilation. If CUDA is enabled, the build process will be slower, so please be patient. If errors occur during compilation, they are often due to version compatibility issues with the compiler, system libraries, or third-party libraries, and troubleshooting them can be quite challenging.",[15,1485,1486],{},[19,1487,1488],{},"Please run the following command in the build directory.",[85,1490,1492],{"className":87,"code":1491,"language":89,"meta":60,"style":60},"\n# 内存小于16GB\nmake all\n\n# 内存等于16GB\nmake all -j$(( $(grep -c ^processor /proc/cpuinfo) / 2 ))\n\n# 内存大于32GB\nmake all -j$(grep -c ^processor /proc/cpuinfo)\n\n# 或者自行规定线程数量（比如16线程）\nmake all -j16\n",[51,1493,1494,1498,1503,1511,1515,1520,1547,1551,1556,1576,1580,1585],{"__ignoreMap":60},[93,1495,1496],{"class":95,"line":96},[93,1497,100],{"emptyLinePlaceholder":99},[93,1499,1500],{"class":95,"line":103},[93,1501,1502],{"class":106},"# 内存小于16GB\n",[93,1504,1505,1508],{"class":95,"line":110},[93,1506,1507],{"class":113},"make",[93,1509,1510],{"class":155}," all\n",[93,1512,1513],{"class":95,"line":117},[93,1514,100],{"emptyLinePlaceholder":99},[93,1516,1517],{"class":95,"line":122},[93,1518,1519],{"class":106},"# 内存等于16GB\n",[93,1521,1522,1524,1527,1530,1533,1535,1538,1541,1544],{"class":95,"line":128},[93,1523,1507],{"class":113},[93,1525,1526],{"class":155}," all",[93,1528,1529],{"class":134}," -j$(( ",[93,1531,1532],{"class":113},"$(grep",[93,1534,1236],{"class":134},[93,1536,1537],{"class":155},"^processor",[93,1539,1540],{"class":155}," /proc/cpuinfo",[93,1542,1543],{"class":134},") / 2 )",[93,1545,1546],{"class":662},")\n",[93,1548,1549],{"class":95,"line":138},[93,1550,100],{"emptyLinePlaceholder":99},[93,1552,1553],{"class":95,"line":143},[93,1554,1555],{"class":106},"# 内存大于32GB\n",[93,1557,1558,1560,1562,1565,1568,1570,1572,1574],{"class":95,"line":149},[93,1559,1507],{"class":113},[93,1561,1526],{"class":155},[93,1563,1564],{"class":134}," -j$(",[93,1566,1567],{"class":113},"grep",[93,1569,1236],{"class":134},[93,1571,1537],{"class":155},[93,1573,1540],{"class":155},[93,1575,1546],{"class":134},[93,1577,1578],{"class":95,"line":305},[93,1579,100],{"emptyLinePlaceholder":99},[93,1581,1582],{"class":95,"line":311},[93,1583,1584],{"class":106},"# 或者自行规定线程数量（比如16线程）\n",[93,1586,1587,1589,1591],{"class":95,"line":322},[93,1588,1507],{"class":113},[93,1590,1526],{"class":155},[93,1592,1593],{"class":134}," -j16\n",[15,1595,1596],{},[58,1597],{"alt":60,"src":1598},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image51.webp",[15,1600,1601],{},"Full-core compilation",[15,1603,1604],{},[58,1605],{"alt":60,"src":1606},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image52.webp",[15,1608,1609],{},"As shown in the figure, that's a truly successful compilation with no errors.",[15,1611,1612],{},[58,1613],{"alt":60,"src":1614},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image53.webp",[15,1616,1617],{},"After generation is complete, run the following command to install:",[15,1619,1620,1623],{},[51,1621,1622],{},"$(grep -c ^processor /proc/cpuinfo)"," variable is the number of CPU threads. (This allows the CPU to compile with full multi-threading.)",[85,1625,1627],{"className":87,"code":1626,"language":89,"meta":60,"style":60},"\n# 内存小于16GB\nsudo make install\n\n# 内存等于16GB\nsudo make install -j$(( $(grep -c ^processor /proc/cpuinfo) / 2 ))\n\n# 内存大于32GB\nsudo make install -j$(grep -c ^processor /proc/cpuinfo)\n\n# 或者自行规定线程数量（比如16线程）\nsudo make install -j16\n",[51,1628,1629,1633,1637,1646,1650,1654,1676,1680,1684,1704,1708,1712],{"__ignoreMap":60},[93,1630,1631],{"class":95,"line":96},[93,1632,100],{"emptyLinePlaceholder":99},[93,1634,1635],{"class":95,"line":103},[93,1636,1502],{"class":106},[93,1638,1639,1641,1643],{"class":95,"line":110},[93,1640,208],{"class":113},[93,1642,343],{"class":155},[93,1644,1645],{"class":155}," install\n",[93,1647,1648],{"class":95,"line":117},[93,1649,100],{"emptyLinePlaceholder":99},[93,1651,1652],{"class":95,"line":122},[93,1653,1519],{"class":106},[93,1655,1656,1658,1660,1662,1664,1666,1668,1670,1672,1674],{"class":95,"line":128},[93,1657,208],{"class":113},[93,1659,343],{"class":155},[93,1661,214],{"class":155},[93,1663,1529],{"class":134},[93,1665,1532],{"class":113},[93,1667,1236],{"class":134},[93,1669,1537],{"class":155},[93,1671,1540],{"class":155},[93,1673,1543],{"class":134},[93,1675,1546],{"class":662},[93,1677,1678],{"class":95,"line":138},[93,1679,100],{"emptyLinePlaceholder":99},[93,1681,1682],{"class":95,"line":143},[93,1683,1555],{"class":106},[93,1685,1686,1688,1690,1692,1694,1696,1698,1700,1702],{"class":95,"line":149},[93,1687,208],{"class":113},[93,1689,343],{"class":155},[93,1691,214],{"class":155},[93,1693,1564],{"class":134},[93,1695,1567],{"class":113},[93,1697,1236],{"class":134},[93,1699,1537],{"class":155},[93,1701,1540],{"class":155},[93,1703,1546],{"class":134},[93,1705,1706],{"class":95,"line":305},[93,1707,100],{"emptyLinePlaceholder":99},[93,1709,1710],{"class":95,"line":311},[93,1711,1584],{"class":106},[93,1713,1714,1716,1718,1720],{"class":95,"line":322},[93,1715,208],{"class":113},[93,1717,343],{"class":155},[93,1719,214],{"class":155},[93,1721,1593],{"class":134},[15,1723,1724],{},[58,1725],{"alt":60,"src":1726},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image54.webp",[15,1728,1729],{},"If there are no errors, the installation was successful.",[15,1731,1732],{},[58,1733],{"alt":60,"src":1734},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image55.webp",[63,1736,1738],{"id":1737},"configure-opencv-environment-variable-env","Configure OpenCV environment variable ENV",[881,1740,1741],{},[884,1742,1743],{},"You may need to configure the lib path:",[85,1745,1747],{"className":87,"code":1746,"language":89,"meta":60,"style":60},"vim ~/.bashrc\n",[51,1748,1749],{"__ignoreMap":60},[93,1750,1751,1754],{"class":95,"line":96},[93,1752,1753],{"class":113},"vim",[93,1755,1756],{"class":155}," ~/.bashrc\n",[15,1758,1759],{},"Add the following content at the very bottom.",[85,1761,1763],{"className":87,"code":1762,"language":89,"meta":60,"style":60},"\n# 设置 LD_LIBRARY_PATH\nexport LD_LIBRARY_PATH=\"/usr/local/lib:$LD_LIBRARY_PATH\"\n",[51,1764,1765,1769,1774],{"__ignoreMap":60},[93,1766,1767],{"class":95,"line":96},[93,1768,100],{"emptyLinePlaceholder":99},[93,1770,1771],{"class":95,"line":103},[93,1772,1773],{"class":106},"# 设置 LD_LIBRARY_PATH\n",[93,1775,1776,1779,1782,1785,1788,1791],{"class":95,"line":110},[93,1777,1778],{"class":159},"export",[93,1780,1781],{"class":662}," LD_LIBRARY_PATH",[93,1783,1784],{"class":159},"=",[93,1786,1787],{"class":155},"\"/usr/local/lib:",[93,1789,1790],{"class":662},"$LD_LIBRARY_PATH",[93,1792,1793],{"class":155},"\"\n",[881,1795,1796],{"start":103},[884,1797,1798],{},"No other configuration needed—works right out of the box (you can configure pkg-config if desired).",[15,1800,1801],{},"Check if the installation was successful:",[85,1803,1805],{"className":87,"code":1804,"language":89,"meta":60,"style":60},"opencv_version\n",[51,1806,1807],{"__ignoreMap":60},[93,1808,1809],{"class":95,"line":96},[93,1810,1804],{"class":113},[15,1812,1813],{},[58,1814],{"alt":60,"src":1815},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image56.webp",[63,1817,1819],{"id":1818},"test-opencv_cuda-cmake-program-example","Test OpenCV_CUDA (CMake Program Example)",[881,1821,1822,1830],{},[884,1823,1824,1825],{},"CMake is a must-learn. Please refer to the following document: ",[30,1826,1829],{"href":1827,"rel":1828},"https://sdutvincirobot.feishu.cn/wiki/Dosvw46BtiBBLEkTdO4cPOt8nVb",[504],"CMake C/C++ Compilation Environment Setup",[884,1831,1832],{},"As shown in the figure, the test is complete:",[15,1834,1835],{},[58,1836],{"alt":60,"src":1837},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image57.webp",[881,1839,1840],{"start":110},[884,1841,1842,1843,83],{},"Below is the example project I have uploaded to GitHub for everyone to download: (The CMake template in the example project below is not the latest version and may not be as feature-rich or as well-designed in all aspects as the new version. If you want the latest template, please see ",[30,1844,1829],{"href":1827,"rel":1845},[504],[15,1847,1848],{},[30,1849,1852],{"href":1850,"rel":1851},"https://github.com/tungchiahui/opencv%5C_cuda%5C_test",[504],"https://github.com/tungchiahui/opencv\\_cuda\\_test",[85,1854,1856],{"className":87,"code":1855,"language":89,"meta":60,"style":60},"\n# 克隆源码\ngit clone https://github.com/tungchiahui/opencv_cuda_test.git\n\n# cd进工程\ncd opencv_cuda_test\n\n# cd进build目录\ncd build\n\n# 进行cmake编译\ncmake ..\n\n# 进行make编译+进行make install安装(最大线程)\nmake install -j$(grep -c ^processor /proc/cpuinfo)\n\n# 给予脚本执行权限\nsudo chmod a+x ../script/setup_vinci_emis.bash\nsudo chmod a+x ../script/vinci_emis\nsudo chmod a+x ../install/.setup.bash\n\n# 执行环境脚本\nsource ../script/setup_vinci_emis.bash\n\n# 执行demo1二进制程序\n../script/vinci_emis run demo1\n",[51,1857,1858,1862,1867,1878,1882,1887,1894,1898,1903,1909,1913,1918,1925,1929,1934,1952,1956,1961,1974,1985,1996,2000,2005,2012,2016,2021],{"__ignoreMap":60},[93,1859,1860],{"class":95,"line":96},[93,1861,100],{"emptyLinePlaceholder":99},[93,1863,1864],{"class":95,"line":103},[93,1865,1866],{"class":106},"# 克隆源码\n",[93,1868,1869,1872,1875],{"class":95,"line":110},[93,1870,1871],{"class":113},"git",[93,1873,1874],{"class":155}," clone",[93,1876,1877],{"class":155}," https://github.com/tungchiahui/opencv_cuda_test.git\n",[93,1879,1880],{"class":95,"line":117},[93,1881,100],{"emptyLinePlaceholder":99},[93,1883,1884],{"class":95,"line":122},[93,1885,1886],{"class":106},"# cd进工程\n",[93,1888,1889,1891],{"class":95,"line":128},[93,1890,551],{"class":134},[93,1892,1893],{"class":155}," opencv_cuda_test\n",[93,1895,1896],{"class":95,"line":138},[93,1897,100],{"emptyLinePlaceholder":99},[93,1899,1900],{"class":95,"line":143},[93,1901,1902],{"class":106},"# cd进build目录\n",[93,1904,1905,1907],{"class":95,"line":149},[93,1906,551],{"class":134},[93,1908,668],{"class":155},[93,1910,1911],{"class":95,"line":305},[93,1912,100],{"emptyLinePlaceholder":99},[93,1914,1915],{"class":95,"line":311},[93,1916,1917],{"class":106},"# 进行cmake编译\n",[93,1919,1920,1922],{"class":95,"line":322},[93,1921,1044],{"class":113},[93,1923,1924],{"class":155}," ..\n",[93,1926,1927],{"class":95,"line":353},[93,1928,100],{"emptyLinePlaceholder":99},[93,1930,1931],{"class":95,"line":367},[93,1932,1933],{"class":106},"# 进行make编译+进行make install安装(最大线程)\n",[93,1935,1936,1938,1940,1942,1944,1946,1948,1950],{"class":95,"line":378},[93,1937,1507],{"class":113},[93,1939,214],{"class":155},[93,1941,1564],{"class":134},[93,1943,1567],{"class":113},[93,1945,1236],{"class":134},[93,1947,1537],{"class":155},[93,1949,1540],{"class":155},[93,1951,1546],{"class":134},[93,1953,1954],{"class":95,"line":389},[93,1955,100],{"emptyLinePlaceholder":99},[93,1957,1958],{"class":95,"line":403},[93,1959,1960],{"class":106},"# 给予脚本执行权限\n",[93,1962,1963,1965,1968,1971],{"class":95,"line":1172},[93,1964,208],{"class":113},[93,1966,1967],{"class":155}," chmod",[93,1969,1970],{"class":155}," a+x",[93,1972,1973],{"class":155}," ../script/setup_vinci_emis.bash\n",[93,1975,1976,1978,1980,1982],{"class":95,"line":1180},[93,1977,208],{"class":113},[93,1979,1967],{"class":155},[93,1981,1970],{"class":155},[93,1983,1984],{"class":155}," ../script/vinci_emis\n",[93,1986,1987,1989,1991,1993],{"class":95,"line":1188},[93,1988,208],{"class":113},[93,1990,1967],{"class":155},[93,1992,1970],{"class":155},[93,1994,1995],{"class":155}," ../install/.setup.bash\n",[93,1997,1998],{"class":95,"line":1196},[93,1999,100],{"emptyLinePlaceholder":99},[93,2001,2002],{"class":95,"line":1204},[93,2003,2004],{"class":106},"# 执行环境脚本\n",[93,2006,2007,2010],{"class":95,"line":1212},[93,2008,2009],{"class":134},"source",[93,2011,1973],{"class":155},[93,2013,2014],{"class":95,"line":1220},[93,2015,100],{"emptyLinePlaceholder":99},[93,2017,2018],{"class":95,"line":1228},[93,2019,2020],{"class":106},"# 执行demo1二进制程序\n",[93,2022,2023,2025,2028,2031],{"class":95,"line":1246},[93,2024,1399],{"class":134},[93,2026,2027],{"class":155},"./script/vinci_emis",[93,2029,2030],{"class":155}," run",[93,2032,2033],{"class":155}," demo1\n",[15,2035,2036,2039,2040,2043,2044,2047,2048,2051],{},[19,2037,2038],{},"Or"," simply click ",[51,2041,2042],{},"Run",", ",[51,2045,2046],{},"Start Debugging",", or ",[51,2049,2050],{},"Run Without Debugging",". (The launch.json and task.json are already fully configured.) (If you find a bug, call me promptly. Before calling me, please check whether the latest CMake template has already fixed the bug. If it hasn't been fixed, then call me.)",[15,2053,2054],{},[58,2055],{"alt":60,"src":2056},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image58.webp",[15,2058,2059],{},[58,2060],{"alt":60,"src":2061},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image59.webp",[15,2063,2064],{},"Testing complete.",[15,2066,2067],{},[58,2068],{"alt":60,"src":2069},"https://cdn.tungchiahui.cn/tungwebsite/assets/images/2023/12/10/image60.webp",[63,2071,1381],{"id":2072},"frequently-asked-questions-1",[626,2074,2076],{"id":2075},"when-compiling-with-cmake-jx-encountering-issues-related-to-operator-or-weight","When compiling with cmake -jx, encountering issues related to operator!= or weight.",[15,2078,2079],{},"This issue mostly occurs on Ubuntu 20.04 or with CUDA 12.2. When compiling, add the contrib library. The corresponding ROS version is Noetic, and the OpenCV version is 4.8.0.",[15,2081,2082],{},"GitHub discussion:",[15,2084,2085],{},[30,2086,2089],{"href":2087,"rel":2088},"https://github.com/ros-perception/vision%5C_opencv/tree/kinetic",[504],"https://github.com/ros-perception/vision\\_opencv/tree/kinetic",[15,2091,2092,2093,2096],{},"Based on the solution in GitHub, modify the corresponding code in the error-related ",[51,2094,2095],{},".hpp"," file (if it's just some WARNINGs, there's no need to modify):",[15,2098,2099,2102,2103],{},[51,2100,2101],{},"114 opencv/modules/dnn/src/cuda4dnn/primitives/normalize_bbox.hpp 中 if (weight != 1.0)"," changed to ",[51,2104,2105],{},"if (weight != static_cast\u003CT>(1.0))",[15,2107,2108],{},[51,2109,2110],{},"124 opencv/modules/dnn/src/cuda4dnn/primitives/region.hpp 中if (nms_iou_threshold > 0)",[15,2112,2113,2114],{},"Change to ",[51,2115,2116],{},"if (nms_iou_threshold > static_cast\u003CT>(0))",[15,2118,2119],{},"Compile again",[85,2121,2123],{"className":87,"code":2122,"language":89,"meta":60,"style":60},"make -j16\n",[51,2124,2125],{"__ignoreMap":60},[93,2126,2127,2129],{"class":95,"line":96},[93,2128,1507],{"class":113},[93,2130,1593],{"class":134},[626,2132,2134],{"id":2133},"conflict-between-the-original-ros-opencv-and-a-custom-built-opencv_cuda","Conflict between the original ROS OpenCV and a custom-built OpenCV_CUDA.",[15,2136,2137],{},"Reason: The cv_bridge that comes with ROS automatically links to ROS's OpenCV, and ROS's OpenCV does not have CUDA acceleration, hence the error.",[15,2139,2140],{},"Ubuntu allows multiple versions of OpenCV to coexist. It is not recommended to uninstall OpenCV directly, as this may cause environment-related issues.",[15,2142,2143],{},"Solution: Configure an additional version of cv_bridge for OpenCV linking.",[1031,2145,2147],{"id":2146},"ros1","ROS1",[15,2149,2150],{},"Solution:",[15,2152,2153,2154],{},"In ",[30,2155,2158],{"href":2156,"rel":2157},"https://github.com/ros-perception/vision%5C_opencv/tree/kinetic%E4%B8%AD%E4%B8%8B%E8%BD%BD%E5%AF%B9%E5%BA%94%E7%89%88%E6%9C%AC%E7%9A%84cv%5C_bridge",[504],"https://github.com/ros-perception/vision\\_opencv/tree/kinetic中下载对应版本的cv\\_bridge",[15,2160,2161,2162,2165,2166,2169,2170,2173],{},"First, modify the ",[51,2163,2164],{},"CMakeList.txt"," in ",[51,2167,2168],{},"cv_bridge",", set ",[51,2171,2172],{},"OpenCV_DIR"," to your own OpenCV installation path, and rename the package.",[85,2175,2178],{"className":2176,"code":2177,"language":1044,"meta":60,"style":60},"language-cmake shiki shiki-themes github-light github-dark","project(cv_bridge_480)#修改为你的包名，加个版本号就可以\nset(OpenCV_DIR \"/home/liu/opencv/opencv-4.8.0\")\nfind_package(OpenCV 4.8.0 REQUIRED\n  COMPONENTS\n    opencv_core\n    opencv_imgproc\n    opencv_imgcodecs\n  CONFIG\n)\n\n",[51,2179,2180,2191,2204,2211,2216,2221,2226,2231,2236],{"__ignoreMap":60},[93,2181,2182,2185,2188],{"class":95,"line":96},[93,2183,2184],{"class":159},"project",[93,2186,2187],{"class":662},"(cv_bridge_480)",[93,2189,2190],{"class":106},"#修改为你的包名，加个版本号就可以\n",[93,2192,2193,2196,2199,2202],{"class":95,"line":103},[93,2194,2195],{"class":159},"set",[93,2197,2198],{"class":662},"(OpenCV_DIR ",[93,2200,2201],{"class":155},"\"/home/liu/opencv/opencv-4.8.0\"",[93,2203,1546],{"class":662},[93,2205,2206,2208],{"class":95,"line":110},[93,2207,53],{"class":159},[93,2209,2210],{"class":662},"(OpenCV 4.8.0 REQUIRED\n",[93,2212,2213],{"class":95,"line":117},[93,2214,2215],{"class":662},"  COMPONENTS\n",[93,2217,2218],{"class":95,"line":122},[93,2219,2220],{"class":662},"    opencv_core\n",[93,2222,2223],{"class":95,"line":128},[93,2224,2225],{"class":662},"    opencv_imgproc\n",[93,2227,2228],{"class":95,"line":138},[93,2229,2230],{"class":662},"    opencv_imgcodecs\n",[93,2232,2233],{"class":95,"line":143},[93,2234,2235],{"class":662},"  CONFIG\n",[93,2237,2238],{"class":95,"line":149},[93,2239,1546],{"class":662},[15,2241,2242],{},"Modify the package name in package.xml",[85,2244,2248],{"className":2245,"code":2246,"language":2247,"meta":60,"style":60},"language-xml shiki shiki-themes github-light github-dark","  \u003Cname>cv_bridge_480\u003C/name>\n","xml",[51,2249,2250],{"__ignoreMap":60},[93,2251,2252,2255,2259,2262,2264],{"class":95,"line":96},[93,2253,2254],{"class":662},"  \u003C",[93,2256,2258],{"class":2257},"s9eBZ","name",[93,2260,2261],{"class":662},">cv_bridge_480\u003C/",[93,2263,2258],{"class":2257},[93,2265,2266],{"class":662},">\n",[15,2268,2269],{},"Now compile cv_bridge as a ROS package. Copy the entire package into the src folder of your workspace and build it.",[85,2271,2273],{"className":2245,"code":2272,"language":2247,"meta":60,"style":60},"cp -rf ./cv_bridge ~/Yolo_Tensorrt_Demo/demo01_test/src\ncatkin_make\n",[51,2274,2275,2280],{"__ignoreMap":60},[93,2276,2277],{"class":95,"line":96},[93,2278,2279],{"class":662},"cp -rf ./cv_bridge ~/Yolo_Tensorrt_Demo/demo01_test/src\n",[93,2281,2282],{"class":95,"line":103},[93,2283,2284],{"class":662},"catkin_make\n",[15,2286,2287,2288,2290,2291,2294],{},"Then you can use ",[51,2289,2168],{}," as a functional package. Add the following to the ",[51,2292,2293],{},"CMakeLists.txt"," of your existing package:",[85,2296,2298],{"className":2176,"code":2297,"language":1044,"meta":60,"style":60},"find_package(cv_bridge_480)\n",[51,2299,2300],{"__ignoreMap":60},[93,2301,2302,2304],{"class":95,"line":96},[93,2303,53],{"class":159},[93,2305,2306],{"class":662},"(cv_bridge_480)\n",[15,2308,2309],{},"package.xml:",[85,2311,2313],{"className":2245,"code":2312,"language":2247,"meta":60,"style":60},"\u003Cbuild_depend>cv_bridge_480\u003C/build_depend>\n\u003Cbuild_export_depend>cv_bridge_480\u003C/build_export_depend>\n\u003Cexec_depend>cv_bridge_480\u003C/exec_depend>\n",[51,2314,2315,2329,2342],{"__ignoreMap":60},[93,2316,2317,2320,2323,2325,2327],{"class":95,"line":96},[93,2318,2319],{"class":662},"\u003C",[93,2321,2322],{"class":2257},"build_depend",[93,2324,2261],{"class":662},[93,2326,2322],{"class":2257},[93,2328,2266],{"class":662},[93,2330,2331,2333,2336,2338,2340],{"class":95,"line":103},[93,2332,2319],{"class":662},[93,2334,2335],{"class":2257},"build_export_depend",[93,2337,2261],{"class":662},[93,2339,2335],{"class":2257},[93,2341,2266],{"class":662},[93,2343,2344,2346,2349,2351,2353],{"class":95,"line":110},[93,2345,2319],{"class":662},[93,2347,2348],{"class":2257},"exec_depend",[93,2350,2261],{"class":662},[93,2352,2348],{"class":2257},[93,2354,2266],{"class":662},[15,2356,2357],{},"At this point, the custom cv_bridge package is configured.",[15,2359,2360,2361,2364,2365,2367],{},"If you also want to use code completion in VS Code, just add the path all the way to the ",[51,2362,2363],{},"include"," directory of the ",[51,2366,2168],{}," package. In my case, it's a different workspace, but it works the same way.",[85,2369,2373],{"className":2370,"code":2371,"language":2372,"meta":60,"style":60},"language-json shiki shiki-themes github-light github-dark","\"includePath\": [\n    \"/home/liu/cv_bridge_ws/src/cv_bridge/include\",\n    \"/home/liu/cv_bridge_ws/src/cv_bridge\"\n\n]\n","json",[51,2374,2375,2383,2391,2396,2400],{"__ignoreMap":60},[93,2376,2377,2380],{"class":95,"line":96},[93,2378,2379],{"class":155},"\"includePath\"",[93,2381,2382],{"class":662},": [\n",[93,2384,2385,2388],{"class":95,"line":103},[93,2386,2387],{"class":155},"    \"/home/liu/cv_bridge_ws/src/cv_bridge/include\"",[93,2389,2390],{"class":662},",\n",[93,2392,2393],{"class":95,"line":110},[93,2394,2395],{"class":155},"    \"/home/liu/cv_bridge_ws/src/cv_bridge\"\n",[93,2397,2398],{"class":95,"line":117},[93,2399,100],{"emptyLinePlaceholder":99},[93,2401,2402],{"class":95,"line":122},[93,2403,2404],{"class":662},"]\n",[1031,2406,2408],{"id":2407},"ros2","ROS2",[15,2410,2411,2412,1399],{},"See the CV_Bridge section in the ",[30,2413,2415],{"href":2414},"/wiki/2023-12-30-ros2-tutorial","ROS2 Robot Operating System Tutorial",[626,2417,2419],{"id":2418},"the-issue-of-opencv-compilation-running-out-of-memory","The issue of OpenCV compilation running out of memory.",[15,2421,2422,2423,2426],{},"Solution: Use multi-core compilation. Typically, running ",[51,2424,2425],{},"make -j16"," (where 16 is the number of CPU threads, adjustable based on your situation) will resolve this. The more CPU threads, the faster the compilation speed.",[1031,2428,2430],{"id":2429},"in-windows","In Windows:",[15,2432,2433],{},"Mingw：",[85,2435,2439],{"className":2436,"code":2437,"language":2438,"meta":60,"style":60},"language-PowerShell shiki shiki-themes github-light github-dark","mingw64-make -j16\n","PowerShell",[51,2440,2441],{"__ignoreMap":60},[93,2442,2443],{"class":95,"line":96},[93,2444,2437],{},[15,2446,2447],{},"It is worth noting that MinGW does not support compiling opencv_contrib on Windows, and this will be indicated at the very beginning of the configure step.",[15,2449,2450],{},"Vs：",[15,2452,2453],{},[30,2454,2455],{"href":2455,"rel":2456},"https://blog.csdn.net/hollyholly5/article/details/68062513",[504],[1031,2458,2460],{"id":2459},"in-linux","In Linux:",[85,2462,2464],{"className":87,"code":2463,"language":89,"meta":60,"style":60},"make -j$(grep -c ^processor /proc/cpuinfo)\n",[51,2465,2466],{"__ignoreMap":60},[93,2467,2468,2470,2472,2474,2476,2478,2480],{"class":95,"line":96},[93,2469,1507],{"class":113},[93,2471,1564],{"class":134},[93,2473,1567],{"class":113},[93,2475,1236],{"class":134},[93,2477,1537],{"class":155},[93,2479,1540],{"class":155},[93,2481,1546],{"class":134},[10,2483,46],{"id":2484},"windows",[15,2486,2487,2488],{},"See ",[30,2489,2492],{"href":2490,"rel":2491},"https://sdutvincirobot.feishu.cn/wiki/Lm6XwbEJyi099ykqyV4cvirPn2f",[504],"Using OpenCV to Infer Yolov8 Model (C++)",[2494,2495,2496],"style",{},"html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}",{"title":60,"searchDepth":103,"depth":103,"links":2498},[2499,2500],{"id":12,"depth":110,"text":13},{"id":2484,"depth":110,"text":46},"/en-us/wiki/2023-12-10-dian-kong-shi-jue-huan-jing-da-jian/ch5-opencv-cuda-huan-jing-da-jian",5000000,"2023-12-10","wiki/2023-12-10-dian-kong-shi-jue-huan-jing-da-jian","en-us:2023-12-10-dian-kong-shi-jue-huan-jing-da-jian","/en-us/wiki/2023-12-10-dian-kong-shi-jue-huan-jing-da-jian","电控视觉环境搭建","md","wiki/2023-12-10-电控视觉环境搭建/ch5-OpenCV__CUDA环境搭建",false,null,"en-US","en-us",{},{"title":5,"description":60},"/wiki/2023-12-10-dian-kong-shi-jue-huan-jing-da-jian/ch5-opencv-cuda-huan-jing-da-jian","_i18n/en-us/wiki/2023-12-10-电控视觉环境搭建/ch5-OpenCV__CUDA环境搭建","8Bf87sjpcLHcVoVY1qJWFJhZjBQzWX82Ijte2H-Nr_E",[2520,2525,2530,2535,2540,2541,2546,2551,2556,2561],{"path":2521,"stem":2522,"title":2523,"date":2503,"chapter":715,"chapterSort":2524,"docKey":2505,"docRoot":2506,"docTitle":2507,"isWikiDoc":99,"isWikiIndex":2510},"/en-us/wiki/2023-12-10-dian-kong-shi-jue-huan-jing-da-jian/ch1-c-c-huan-jing-da-jian","_i18n/en-us/wiki/2023-12-10-电控视觉环境搭建/ch1-C_C++环境搭建","C/C++ environment setup",1000000,{"path":2526,"stem":2527,"title":2528,"date":2503,"chapter":720,"chapterSort":2529,"docKey":2505,"docRoot":2506,"docTitle":2507,"isWikiDoc":99,"isWikiIndex":2510},"/en-us/wiki/2023-12-10-dian-kong-shi-jue-huan-jing-da-jian/ch2-armkeilmdk-arm-dan-pian-ji-huan-jing-da-jian","_i18n/en-us/wiki/2023-12-10-电控视觉环境搭建/ch2-ARMKeilMDK(ARM单片机环境搭建)","ARM Keil MDK (ARM Microcontroller Environment Setup)",2000000,{"path":2531,"stem":2532,"title":2533,"date":2503,"chapter":725,"chapterSort":2534,"docKey":2505,"docRoot":2506,"docTitle":2507,"isWikiDoc":99,"isWikiIndex":2510},"/en-us/wiki/2023-12-10-dian-kong-shi-jue-huan-jing-da-jian/ch3-linux-ji-ben-pei-zhi","_i18n/en-us/wiki/2023-12-10-电控视觉环境搭建/ch3-Linux基本配置","Basic Linux Configuration",3000000,{"path":2536,"stem":2537,"title":2538,"date":2503,"chapter":730,"chapterSort":2539,"docKey":2505,"docRoot":2506,"docTitle":2507,"isWikiDoc":99,"isWikiIndex":2510},"/en-us/wiki/2023-12-10-dian-kong-shi-jue-huan-jing-da-jian/ch4-cmake-gong-cheng-da-jian","_i18n/en-us/wiki/2023-12-10-电控视觉环境搭建/ch4-CMake工程搭建","CMake project setup",4000000,{"path":2501,"stem":2517,"title":5,"date":2503,"chapter":735,"chapterSort":2502,"docKey":2505,"docRoot":2506,"docTitle":2507,"isWikiDoc":99,"isWikiIndex":2510},{"path":2542,"stem":2543,"title":2544,"date":2503,"chapter":740,"chapterSort":2545,"docKey":2505,"docRoot":2506,"docTitle":2507,"isWikiDoc":99,"isWikiIndex":2510},"/en-us/wiki/2023-12-10-dian-kong-shi-jue-huan-jing-da-jian/ch6-yolo-huan-jing-da-jian","_i18n/en-us/wiki/2023-12-10-电控视觉环境搭建/ch6-YOLO环境搭建","YOLO environment setup",6000000,{"path":2547,"stem":2548,"title":2549,"date":2503,"chapter":745,"chapterSort":2550,"docKey":2505,"docRoot":2506,"docTitle":2507,"isWikiDoc":99,"isWikiIndex":2510},"/en-us/wiki/2023-12-10-dian-kong-shi-jue-huan-jing-da-jian/ch7-ros-huan-jing-da-jian","_i18n/en-us/wiki/2023-12-10-电控视觉环境搭建/ch7-ROS环境搭建","ROS environment setup",7000000,{"path":2552,"stem":2553,"title":2554,"date":2503,"chapter":750,"chapterSort":2555,"docKey":2505,"docRoot":2506,"docTitle":2507,"isWikiDoc":99,"isWikiIndex":2510},"/en-us/wiki/2023-12-10-dian-kong-shi-jue-huan-jing-da-jian/ch8-qt-huan-jing-da-jian","_i18n/en-us/wiki/2023-12-10-电控视觉环境搭建/ch8-QT环境搭建","QT environment setup",8000000,{"path":2557,"stem":2558,"title":2559,"date":2503,"chapter":755,"chapterSort":2560,"docKey":2505,"docRoot":2506,"docTitle":2507,"isWikiDoc":99,"isWikiIndex":2510},"/en-us/wiki/2023-12-10-dian-kong-shi-jue-huan-jing-da-jian/ch9-docker-huan-jing-da-jian","_i18n/en-us/wiki/2023-12-10-电控视觉环境搭建/ch9-Docker环境搭建","Docker environment setup",9000000,{"path":2506,"stem":2562,"title":2563,"date":2503,"chapter":2511,"chapterSort":2564,"docKey":2505,"docRoot":2506,"docTitle":2507,"isWikiDoc":99,"isWikiIndex":99},"_i18n/en-us/wiki/2023-12-10-电控视觉环境搭建/index","Electrical Control Vision Environment Setup",0,{"variants":2566},[2567,2568,2571,2574,2577],{"path":2501,"localeSlug":2513,"i18nKey":2509},{"path":2569,"localeSlug":2570,"i18nKey":2509},"/zh-hant/wiki/2023-12-10-dian-kong-shi-jue-huan-jing-da-jian/ch5-opencv-cuda-huan-jing-da-jian","zh-hant",{"path":2572,"localeSlug":2573,"i18nKey":2509},"/zh-hk/wiki/2023-12-10-dian-kong-shi-jue-huan-jing-da-jian/ch5-opencv-cuda-huan-jing-da-jian","zh-hk",{"path":2575,"localeSlug":2576,"i18nKey":2509},"/zh-tw/wiki/2023-12-10-dian-kong-shi-jue-huan-jing-da-jian/ch5-opencv-cuda-huan-jing-da-jian","zh-tw",{"path":2578,"localeSlug":2579,"i18nKey":2509},"/zh-cn/wiki/2023-12-10-dian-kong-shi-jue-huan-jing-da-jian/ch5-opencv-cuda-huan-jing-da-jian","zh-cn",[2501,2516,2569,2516,2572,2516,2575,2516,2578,2516],1780673987597]