OpenCV3的GPU模块编译

作者联系方式:cuijialiang@pku.edu.cn 有问题欢迎来讨论。

【摘要】

OpenCV3的GPU模块需要手动重新编译才可以使用。本文介绍了编译OpenCV3 + GPU模块的方法。

【关键词】OpenCV; GPU; CUDA; 编译器;

【本文使用的操作系统、软件版本】

OS:Windows10 2015.11月更新后
OpenCV 3.0.0
CMake 3.4.0-rc
CUDA v7.5 for windows10 x86_64
Visual Studio 2013 Community

【正文】

1.前言

1.1.为什么要重新编译?

OpenCV3封装了许多可以直接从高层调用的基于GPU计算的方法。但是直接用官网下载的编译好的OpenCV3调用GPU命令会发生 No CUDA support 错误,如下图:
No CUDA support

错误描述中说 The library is compiled without CUDA support.
OpenCV需要和CUDA模块一起编译,才可以使用GPU接口。

1.2.What is CUDA

NVIDIA官网 https://developer.nvidia.com/cuda-toolkit 的描述如下:

The NVIDIA® CUDA® Toolkit provides a comprehensive development environment for C and C++ developers building GPU-accelerated applications. The CUDA Toolkit includes a compiler for NVIDIA GPUs, math libraries, and tools for debugging and optimizing the performance of your applications. You’ll also find programming guides, user manuals, API reference, and other documentation to help you get started quickly accelerating your application with GPUs.

CUDA toolkit是NVIDIA的一个驱动包,封装了GPU硬件加速功能,屏蔽了硬件,提供方便调用的C/C++编程接口。

2.准备工具-安装C

  • 3
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值