Ubuntu20 安装 带cuda的opencv遇到的问题

问题1:

CUDA 12.2 fp16 dnn 编译错误 错误 C2666: 'operator !=': 具有类似的转换重载函数

解决:

CUDA 12.2 fp16 dnn compilation error · Issue #23893 · opencv/opencv · GitHub

Solution:

I "solved" this by using static_cast.

You want to change line 114 in opencv/modules/dnn/src/cuda4dnn/primitives/normalize_bbox.hpp:

from:
if (weight != 1.0)

to:
if (weight != static_cast<T>(1.0))

As well as line 124 in opencv/modules/dnn/src/cuda4dnn/primitives/region.hpp (due to a similar error):

from:
if (nms_iou_threshold > 0) {

to:
if (nms_iou_threshold > static_cast<T>(0)) {

Explanation:

Since both variables, weight and nms_iou_threshold, are templated and finally boil down to a primitive type during compilation, it is meaningful to use a static_cast to convert the respective constant (1.0 (by default double) and 0 (by default int)) to the template type. Based on the operator candidates the required types should all be compatible, i.e., the constant values are safe to be casted to the target template type.

问题2:

undefined reference to `TIFFReadDirectory@LIBTIFF_4.0'

解决:

https://stackoverflow.com/questions/38729954/error-installing-opencv-on-ubuntu-16-04

cmake 增加 -D BUILD_TIFF=ON

相关推荐
txg6664 分钟前
VULOC:基于汇编切片的漏洞定位框架,精准锁定二进制中的危险代码
汇编·人工智能·深度学习·安全·网络安全
会编程的吕洞宾10 分钟前
LangChain4j Tool Calling 实战:让大模型自动查数据库发邮件,一句话搞定复杂任务
数据库·人工智能
xcLeigh11 分钟前
编程语言的 AI 友好度排名:Python、JavaScript、TypeScript 谁更适合 AI 辅助
javascript·人工智能·python·ai·typescript·ai编程
玖妍呐13 分钟前
做小红书封面图,用哪个AI绘图工具生成出来好看?
人工智能
明源云18 分钟前
资产管理软件哪个好?不动产资产管理系统的选型逻辑与标杆实践
大数据·人工智能·架构
LaughingZhu33 分钟前
Product Hunt 每日热榜 | 2026-08-08
人工智能·经验分享·深度学习·神经网络·产品运营
硅谷秋水1 小时前
人工智能医疗健康机器人研究综述与分析
人工智能·深度学习·计算机视觉·语言模型·机器人
Industio_触觉智能1 小时前
瑞芯微RV1126B安防视觉场景解析|AI门禁+智能IPC+边缘分析
人工智能·硬件工程·智能硬件·核心板·瑞芯微·rv1126b·rv1126bj
guo_xiao_xiao_2 小时前
YOLO三相电能表数字与单位符号目标检测数据集
人工智能·yolo·目标检测
DFT计算杂谈2 小时前
C4T交错磁体中的超导交织序向列涨落与自旋流环涨落的选择机制
大数据·数据库·人工智能