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

相关推荐
大熊背几秒前
ISPPipeline中的图像噪声问题解析
图像处理·人工智能·计算机视觉·去噪·isppipeline
数造科技11 分钟前
政务数据治理实战:统一数据底座如何破解商事注册“重复填报”与数据孤岛
大数据·人工智能·科技·政务·ai-native
HyperAI超神经14 分钟前
SenseNova-U1.5-8B-MoT 统一生成与理解,解锁原生多模态创作;DeepSeek-V4-Flash-Vision-Exp 拓展视觉理解新能力
人工智能·深度学习·图像生成·多模态大模型·视觉推理
xierui12312316 分钟前
Agent记忆不是聊天记录:用三层存储构建可追溯的 AI 工作流
数据库·人工智能·aigc·软件工程
程序员Better19 分钟前
2026 AI Agent 开发学习路线:从小白到全栈,这波红利必须抓住!
人工智能
RAOY的AI笔记20 分钟前
GPT-6打破孪生素数猜想最新纪录:AI正在进入数学研究新时代?
人工智能·gpt·算法
围炉聊科技27 分钟前
Agent 的隐身术:CloakBrowser 反检测拆解
人工智能
长空任鸟飞_阿康28 分钟前
三、《从零手撸 Agent》 · system prompt 与核心参数:调好你的旋钮
人工智能·python·ai·prompt
daad77728 分钟前
AI 能造出更接近香农极限的译码器吗?
人工智能·5g·译码器·香农