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

相关推荐
AI街潜水的八角42 分钟前
基于Opencv的条形码识别与创建
人工智能·opencv·计算机视觉
谁怕平生太急1 小时前
Mobile GUI Agent相关学习资料整理
人工智能·大模型
牛奶1 小时前
2026 春涧·前端走向全栈
前端·人工智能·全栈
DeepVis Research1 小时前
【AGI/Simulation】2026年度通用人工智能图灵测试与高频博弈仿真基准索引 (Benchmark Index)
大数据·人工智能·算法·数据集·量化交易
Linux猿1 小时前
2025数字消费发展报告 | 附PDF
人工智能·研报精选
这张生成的图像能检测吗2 小时前
(论文速读)CCASeg:基于卷积交叉注意的语义分割多尺度上下文解码
人工智能·深度学习·计算机视觉·语义分割
大猪宝宝学AI4 小时前
【AI Infra】BF-PP:广度优先流水线并行
人工智能·性能优化·大模型·模型训练
Jerryhut4 小时前
Opencv总结7——全景图像拼接
人工智能·opencv·计算机视觉
Captaincc4 小时前
AI 原生下的新的社区形态会是什么
人工智能
简简单单OnlineZuozuo6 小时前
提示架构:设计可靠、确定性的AI系统
人工智能·unity·架构·游戏引擎·基准测试·the stanford ai·儿童