当前位置:网站首页>Opencv compile and call GPU version
Opencv compile and call GPU version
2022-07-25 22:46:00 【ima_ zhan】
1、 Install well cuda drive
May refer to CUDA Environment building _ima_zhan The blog of -CSDN Blog _cuda Environment building
2、 download opencv 3.11 Source code and lib
On the official website release The download of each version can be found on the page
3、 download cmake 3.23.2, Baidu can go to the official website to download
4、 open cmake, Select source file as opencv3.11 Source code , The compilation directory is newly created opencv311_build
Click on Configure, Make the following configuration in the configuration window :
stay WITH Choose from WITH_CUDA,WITH_NVCUVID.
stay BUILD Choose BUILD_opencv_world Compile the file into a dll, It's really convenient to quote , But the file is a little big , I finally have 200 Multi megabit .
Configure You can click again if you encounter an error in Configure Have a try , Other mistakes can be found in 5 The solution in .
complete Configure Then click Generate Build project , And then click OpenProject Open the project .
5、 Several problems encountered during compilation
1、 First choose cuda, Click on Configure You can't see it until the button runs once cuda The option to , stay CUDA_ARCH_BIN Configuring the version you need in can really improve the following vs Compilation speed in . Other acceleration methods , It's useful to find some in others' blogs , Direct reference win10 compile opencv4.5.0 (gpu edition )_Mr.Q The blog of -CSDN Blog _win install opencv
2、 File cannot be downloaded
ffmpegedll There are other files that cannot be downloaded automatically , You can download and replace .cache file , The main downloaded files are changed to and .cache The same name in . The download connection can be viewed in the error prompt file , stay build The folder CMakeDownloadLog.txt There are all the ways .
3、 Compile time cuda Options are automatically selected , If all are selected in vs Errors will be reported when compiling . This is what happened to me , The detailed reason has not been checked .
6、 Errors encountered in the use of compiled
After successful compilation, a mfc Engineering to test opencv_world3411d.dll Call to , Encountered several errors
error 1:
Put... In the source file include Folder added to

base.hpp Middle tip , Error in the following figure

In operation engineering Install, Will be in opencv311_build Produced under the catalogue install Catalog , Among them is include The folder contains the header files that need to be referenced . Add this folder to C++ The contents of , The specific operation is as follows :

error 2: Compile the prompt “ Unresolved external symbols private:void _cdecl cv::String::deallocate(void)"
Need to put install In the catalog x64( Because I use x64) In the catalog vc16/lib Under the opencv_world3411d.lib Add to project OpenCvCamera Of lib In the list , The specific operation is
First of all, will install In the catalog x64/vc16/lib Directory added to vc++ The Library Directory of , as follows

Then add opencv_world3411d.lib, as follows

边栏推荐
猜你喜欢

Simple setting of drop-down triangle
![[training day13] travel [violence] [dynamic planning]](/img/ac/dd52771fec20432fd084d8e3cc89e1.png)
[training day13] travel [violence] [dynamic planning]

Dom and events

Mocha test

【MySQL提权】UDF提权(附带大马)

【集训DAY12】树!树!树!【贪心】【最小生成树】

【集训DAY12】Minn ratio 【dfs】【最小生成树】

Data governance under data platform

Kibana~后台启动Kibana之后无法找到进程号

Pyspark data analysis basis: pyspark.sql.sparksession class method explanation and operation + code display
随机推荐
Examples and points for attention about the use of getchar and scanf
Mysql数据类型
Matrix of C language
LabVIEW develops PCI-1680U dual port can card
XSS tool beef XSS installation and use
Pyspark data analysis basis: pyspark.sql.sparksession class method explanation and operation + code display
JVM内存区域
【自然语言处理】【向量表示】AugSBERT:改善用于成对句子评分任务的Bi-Encoders的数据增强方法
【集训DAY15】油漆道路【最小生成树】
Explore the use of self increasing and self decreasing operators
1000个Okaleido Tiger首发上线Binance NFT,引发抢购热潮
单元测试,写起来到底有多痛?
[training day13] travel [violence] [dynamic planning]
[PMP learning notes] Chapter 1 Introduction to PMP System
[training Day11] Calc [mathematics]
[training Day12] x equation [high precision] [mathematics]
贴片微型滚珠振动开关的结构原理
Force deduction solution summary 919 complete binary tree inserter
LabVIEW 开发 PCI-1680U双端口CAN卡
汇编语言与微机原理实验一、实验二、实验三:分支程序设计/循环程序设计/子程序设计