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

相关推荐
极客先躯2 分钟前
智能体开发高级面试每日一题|2026-06-04|Agent 的规划(Planning)能力来自哪里?LLM 原生规划有哪些局限?
人工智能·面试·agent·每日一题·高级面试·智能体开发·agenticworkflow
阿策小和尚2 分钟前
把 Python 3.14 + FastAPI + Nuxt 4 压成 164MB 单包迁进 Dopame OS:4 个坑和一份真实体积账单
前端·人工智能·前端框架
极客先躯3 分钟前
智能体开发高级面试每日一题|2026-06-02|为什么说“Agent 的能力上限由 LLM 决定“?工程层面可以做哪些弥补?
人工智能·面试·大模型·llm·agent·高级面试题·智能体开发
kobesdu5 分钟前
RK3588 还是等 RK3668?一次选型窗口的取舍
人工智能·机器人·ros·slam
嗨起飞了11 分钟前
《Finerd:AI产品榜第 1 名的只读核查》
人工智能
爱聊灵光的维C12 分钟前
AI时代下,写博客的意义体现在哪里?
人工智能·学习·技术思考·思想成长
阿策小和尚14 分钟前
干掉 better-sqlite3,把 5 万星的 Ghost 6.81 压成 67MB 单包跑进 Dopame OS
人工智能·设计模式·github
I Am a robert girl18 分钟前
Scaffold3D:当神经网络开始“请教”传统几何学家
人工智能·深度学习·神经网络·计算机视觉·3d·3d重建·几何约束
海思开发板总店24 分钟前
RV1126B/BP YOLOv8模型部署实战 sensor采集+实时YOLO11检测+RTSP传输30FPS 模型部署实战
人工智能·yolo·目标检测·计算机视觉·rv1126b
ShiMetaPi28 分钟前
RK1828 视频 AI 链路:RTSP 推流、NPU 检测与 OSD 画框全流
人工智能·边缘计算·端侧ai·rk1828