stitching_detailed.cpp : throw_no_cuda

1. 问题点

opencv-4图像拼接官方示例代码,opencv-4.5.5/samples/cpp/stitching_detailed.cpp 打开--try_cuda yes开关后运行测试,

opencv-4.5.5/modules/core/include/opencv2/core/private.cuda.hpp:112: error: (-213:The function/feature is not implemented) The called functionality is disabled for current build or platform in function ‘throw_no_cuda’

2. 分析

在代码seam_finder处报错崩溃,提示throw_no_cuda,事实上本地已编译带cuda支持的opencv了。其他代码处使用cuda的函数均无问题。唯独seam_finder报错。

if (try_cuda && cuda::getCudaEnabledDeviceCount() > 0)
            seam_finder = makePtr<detail::GraphCutSeamFinderGpu>(GraphCutSeamFinderBase::COST_COLOR);
            
seam_finder->find(images_warped_f, corners, masks_warped);

使用cpu版本seam_finder的执行正常。

https://github.com/opencv/opencv/issues/7344文中有提到,
seam_finder的cuda版本底层依赖cv::cuda::graphcut,在CUDA 8.0及以后的版本被抛弃,最后一个支持版本为CUDA 7.5。

3. Workaround

该问题2016即已爆出,至今仍未修复。
临时的解决办法,强制seam_finder使用cpu模式(CPU模式会使用OpenCL加速),其他保持不变。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值