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

相关推荐
科技发布1 分钟前
2026户外广告数字化升级:传播易以AI技术重构全域户外品效营销体系
人工智能·重构
SNKXD_12 分钟前
避开选型认知误区:2026年实测8款智能AI数字人平台总结筛选标准
大数据·人工智能·机器学习
未来和明天2 分钟前
领嵌iLeadE-588边缘计算盒子16路AI视频分析、4路AHD、4路千兆网、4G/5G通讯、标准API接口
人工智能·5g·边缘计算
香蕉鼠片3 分钟前
图像处理经典脚本
图像处理·python·opencv
微硬创新4 分钟前
耐达讯自动化PROFINET转DeviceNet网关:医药包装生产线的合规与效率双保障
服务器·人工智能·物联网·网络协议·自动化·信息与通信
小林ixn9 分钟前
Vue3接入DeepSeek流式输出,把“二进制碎片”和“局部热更新”扒个精光
前端·vue.js·人工智能
数聚天成DeepSData10 分钟前
自动驾驶感知数据集选型指南:目标检测、分割、车道线、车牌识别
人工智能·目标检测·自动驾驶
土星云SaturnCloud15 分钟前
SAM2模型在土星云边缘计算设备上的部署实战(下):从原理到落地全解析
服务器·人工智能·ai·边缘计算
QCoding16 分钟前
Java转AI第三课:Spring AI如何把100行HTTP代码缩减到10行?
java·人工智能
十九画生17 分钟前
从 Document 到 LLM Answer:手写 LangChain RAG 检索与生成闭环
人工智能