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

相关推荐
俊哥V几秒前
每日 AI 研究简报 · 2026-08-28
人工智能·ai
点PY1 分钟前
《一种超分辨率重建方法和相关装置》专利解析
人工智能·计算机视觉·超分辨率重建
Luke Ewin3 分钟前
Qwen3-ASR藏语语音识别 | 少数民族(藏语|维吾尔语)语音识别 | 本地化部署藏语语音识别模型
人工智能·语音识别·asr·藏语asr
byte轻骑兵3 分钟前
【BlueZ 】蓝牙配对/绑定基础:BlueZ 中安全机制的入门级源码解析
linux·人工智能·bluez·电脑蓝牙·嵌入式蓝牙
飞哥数智坊3 分钟前
当下 Agent 缺少的,也许是读懂产物的能力
人工智能
新知图书5 分钟前
14.1 多模态试驾预约Agent系统概述
人工智能·agent·ai agent·智能体
哦哦~9217 分钟前
AI赋能CFD:从Fluent仿真到物理信息机器学习的智能流体工程实战
人工智能·机器学习·cfd·fluent
QH139292318809 分钟前
R&S FSPN50 FSPN26 FSWP26 相位噪声分析仪典型应用案例
人工智能·百度·微信·集成测试·音视频·facebook·oneapi
用户52746756142111 分钟前
给 Agent 一份 package-lock:别让 Skill、MCP 和权限各自漂移
人工智能
2601_9676598911 分钟前
2026信创深化落地期档案管理系统选型推荐:恒智科技综合档案管理系统
数据库·人工智能·科技