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

相关推荐
ShallWeL1 分钟前
AUC、F1、召回率怎么选
人工智能·算法·机器学习
Sirius Wu1 分钟前
OpenClaw SubAgent 三层安全约束完整详解
人工智能·安全·ai·架构·aigc
老刘干货4 分钟前
深度拆解:Harness与Multica的核心差异及AI工程化落地最佳实践
人工智能
再让我睡两分钟4 分钟前
【无标题】
android·java·数据库·人工智能·prompt·ai应用开发
盖立克思GEO研究院14 分钟前
【2026】海外 B2B 工厂 AI 询盘破局:独立站 + GEO 双驱动,ChatGPT/Gemini1 个月精准获客案例拆解
人工智能·chatgpt
东坡肘子14 分钟前
当每一次写入都有了新价格 -- 肘子的 Swift 周报 #144
人工智能·swiftui·swift
水龙吟啸15 分钟前
华为2026.6.3机考选择题+编程题【速刷敲黑板】
人工智能·深度学习·算法·华为
盼小辉丶18 分钟前
OpenCV-Python实战(33)——构建实时目标检测与跟踪系统
python·opencv·目标检测·计算机视觉
郭泽斌之心31 分钟前
让别人临时接管你的 AI 助手:分级授权的远程控制怎么设计
人工智能·深度学习·量化交易·ea·mt5·fay数字人·easydeal
卷福同学31 分钟前
AI编程出海第一步:别急着写代码,先找到老外真正愿意付费的需求
人工智能·后端·面试