cmake编译opencv的cuda库的注意事项

说明

1、相关版本
cuda8.0.60+opencv3.4.16+vs2013+windows7+cmake3.25.0
2、文章内容
主要对一些容易忽略的安装步骤和错误进行分析

一、Cmake编译opencv的基本使用

参考我的这篇博客的第五节:编译32位的库

二、需要准备的工具

在编译之前,需要安装好cuda并配置好系统环境,下载好opencv_contrib库,因为cuda属于额外的库。

三、opencv_contrib下载

1、官网

githup
直接浏览器下载也不慢,使用迅雷更快。
参考下图选择自己需要的版本
在这里插入图片描述

2、opencv_contrib库的使用

(1)第一次configure后,勾选BU

新手友好 win10使用cmake3.17编译配置OpenCV3.4.1+CUDA10.2+VS2019 为了试试GPU能不能使数字识别的纯算法代码加速,而去配置了OpenCV+CUDA的环境。作为一个小白,配置过程中遇到了不少报错,从暴躁,到无奈,到葛优瘫式认命望天——感谢前人分享的经验,在他们的基础上,我想把自己的配置过程、遇到的问题和原因猜测分享给大家。同时,也欢迎大家进行补充,如果有不正确的地方,也请多指教。 前提环境: Win10 VS2019 OpenCV3.4.1 CUDA10.2 CM... 阅读详情

相关推荐

基于Visual Stduio 2019的Cmake3.28.6编译OpenCV4.9.0,CUDA12.3.2,cudnn8.9.7.29,TBB21.13.0操作步骤(小白零基础操作版)

目前网上已经发布的教程大多是基于OpenCV,CUDA,TBB等较古老版本搭建的,本文引入新的版本,使用最新的功能特性,充分利用电脑的性能,加速项目的开发。同时本文也介绍了一些缩减环境变量长度的配置方法,以及构建C++工程项目文件时的相对路径的设置。项目配置较为顺利,如有不当之处,恳请专家学者批评指正。

TIME_IS_QUIET的博客 2585

OpenCV CUDA 4.10 编译,静态编译,全流程

在附加依赖项里面填入 下面的lib名称(opencv_world4100d.lib这个名字不知道会不会不同,z大家注意确认一下) 如果没有这个那么说明你前面编译阶段没选择上BUILD_opencv_world ,你需要填入的就是这个目录下所有带 *d.lib的文件名称 ,文件名称最后一个字母带d是debug模式的。上图中 2是下载地址,我是直接用迅雷可以下载,下载完成之后名称要修改与1的一样 替换即可,需要下载的不止一个由于截图我这里只展示1个,全部下载完成 先关闭CMake 在打开CMake。

u010240469的博客 3309

Windows10+VS2017+cmake 编译opencv4.1 + opencv_contrib(含cuda)

Step 1 下载 opencv4.1 和 对应版本的 opencv_contrib 然后找个地方解压 opencv,在此我放在了 D 盘。然后在里面新建一个空的 build 文件夹,同时将 opencv_contrib 解压之后放进去(其实放哪里无所谓,为了方便这里我还改了一下名) Step 2 下载 cmake, 这里我使用的版本是 3.15.0,根据自己是 32 位还是 64 位来下载(...

qq_41180014的博客 9261

Opencv3.4与Opencv_contrib模块联合编译,生成使用CUDA加速的Opencv GPU模块

出于稳定性考虑,Opencv3官方一直没有加入Opencv2中存在的模块,比如像feature2d模块,其中包含了SURF、SIFT这些经典的图像算法。如果想要在Opencv3中使用这些算法,要自己动手从Opencv_contrib模块中编译生成库使用。而今天想要说的重点是用Opencv3.4与Opencv_contrib模块联合编译,生成能够使用CUDA加速的GPU模块,也就是俗称的Opencv...

Goerge_L的博客 1万+

Jetson带CUDA编译的opencv4.5安装教程与踩坑指南,cmake配置很重要!

1.Jetson下编译opencv4.5完整教程 2.cmake参数解释 3.编译过程中各种error原因与解决方法

吾系铵宁的博客 1万+

基于拟蒙特卡洛模拟法的随机潮流计算matlab程序

由式(4-11)可知,蒙特卡洛模拟法的计算量不受电力系统规模大小影响,因此该方法在一些复杂的电力系统中可以得到应用,包括处理电力系统中有多个间歇性新能源接入的问题,解决系统中多个节点之间相关性问题等等。本章在此基础上提出了基于拟蒙特卡洛模拟的随机潮流计算方法,并且对拟蒙特卡洛法中的拟随机数序列进行了改进,大大提高了随机潮流的计算效率。模拟法的具体思路如下:基于实际工程问题的求解需要,建立与之相对应的随机模拟过程和随机概率模型,使得它们的参数,包括概率分布或者数学期望,能够等于问题的实际解;

weixin_47365903的博客 1809

保姆级教程:在S32DS 3.4上安装S32K3xx RTD 4.4驱动包(附常见安装失败排查)

本文提供在S32DS 3.4上安装S32K3xx RTD 4.4驱动包的详细教程,涵盖环境准备、分步安装指南及常见问题排查。特别针对NXP S32K3系列MCU开发者,解决网络问题、路径配置等安装难点,并分享进阶配置技巧和最佳实践,助力高效开发。

weixin_42696271的博客 298

从零构建2.4G无线通信系统:MSPM0G3507与NRF24L01的深度协同设计

本文详细介绍了基于MSPM0G3507微控制器与NRF24L01射频模块构建2.4G无线通信系统的深度协同设计方案。内容涵盖系统架构、SPI通信优化、功耗管理、抗干扰机制及中断/DMA高效利用,为工业物联网应用提供高可靠、低功耗的无线传输解决方案。

rice5的博客 829

医学论文《基于多模态数据融合的乳腺癌生存分析》

本文探讨基于多模态影像组学联合临床特征构建的乳腺癌生存预测模型并与传统预测模型比较。回顾性收集1096例乳腺癌患者的临床及影像资料。选定T2加权像(T2WI)与动态对比增强磁共振成像(DCE-MRI)序列中第二时相的图像,聚焦于显示病灶最为显著的层面。在相应的钼靶(MG)检查图像中,精确标定感兴趣区域(ROI),对标定的ROI进行特征提取,以获取病灶的关键信息。通过Lasso进行特征降维,运用机器学习分类器构建多模态影像组学模型并选择预测性能最佳分类器建立MRI、MG影像组学模型。

m0_69704149的博客 2238

山东大学机器学习(实验一内容)——线性回归

1. 描述 第一个练习将为你提供线性回归练习。这些练习已经用Matlab进行了广泛的测试,但它们也应该在Octave中工作,它被称为“免费版的Matlab”。如果你使用的是Octave,那就是 一定要安装Image包(可在Windows中作为选项使用)安装程序,可从Octave-Forge获得Linux。 2.线性回归 回想一下,线性回归模型是 hθ(x)=θTx=∑j=0nθjxj h_{\th...

HachiLin的博客 4108

[网络安全自学篇] 八.Web漏洞及端口扫描之Nmap、ThreatScan和DirBuster原理详解

Web渗透技术的核心是发现Web漏洞,发现漏洞有手工和软件自动化扫描两种方式。对于用户验证漏洞、用户凭证管理问题、SQL注入等常见Web漏洞,都可以通过Web扫描器进行扫描。各个扫描器的功能和结果都不同,常见的包括HScan、HScan、X-Sccan、Acunetix Web Vulnerability Scanner、Jsky、Router Scan扫描工具等。本文主要讲解三个常见的Web漏洞扫描工具,分别是NMapp、ThreatScan和DirBuster。希望这篇基础性文章对你有所帮助.

杨秀璋的专栏 1万+

【连接器专题】 EIA-364 系列标准的完整列表

EIA-364 系列标准在电子工业中具有重要的地位,为电子连接器和互连系统的测试和验证提供了统一的、可操作的流程和方法,有助于提高电子产品的质量和可靠性,促进了电子工业的发展

一点硬件 2684

三峡大学-微机原理与接口技术实验

其中,A15接E1,因此,A15为1,A14A13A12A11A10A9A8A7通过八输入与非门74LS30与E2连接,因此A14A13A12A11A10A9A8A7为11111111,A6A5A4与CBA连接,因此A6A5A4为101,A3A2A1A0不参与译码,因此IO5的地址范围为1111 1111 1101 0000B~1111 1111 1101 1111B,即0FFD0H~0FFDFH。如图1所示,若IO0输出为低电平,则需要E1接高电平,E2接低电平,E3接低电平,CBA的输入为000。

m0_62222486的博客 500

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

上一篇: IPP图像处理常用函数说明
下一篇: 工业相机和镜头选型技巧
这是一个图像
这是一个图像 新星创作者: 人工智能技术领域 新星创作者: 人工智能技术领域
博客等级 码龄8年 6771粉丝 54原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

这是一个图像

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值