opencv: stitching_detailed.cpp : throw_no_cuda
System information (version)
- OpenCV => 3.1
- Operating System / Platform => ubuntu 16
- Compiler => make
Detailed description
I have compiled OpenCV with cuda, and run
cuda::GpuMat
cuda::cvtColor
well.
I complie stitching_detailed.cpp
, and run with 1.jpg 2.jpg --try_cuda yes --features orb
. When running at LINE 709: seam_finder->find(images_warped_f, corners, masks_warped);
crashed:
OpenCV Error: The function/feature is not implemented (The called functionality is disabled for current build or platform) in throw_no_cuda, file ***/opencv/modules/core/include/opencv2/core/private.cuda.hpp, line 101
terminate called after throwing an instance of 'cv::Exception'
what(): /home/duchengyao/project/
***/opencv/modules/core/include/opencv2/core/private.cuda.hpp:101: error: (-213) The called functionality is disabled for current build or platform in function throw_no_cuda
It is really annoying me.
Regards,
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 21 (3 by maintainers)
maybe one solution for stitching is using stitching_detailed.cpp instead of Stitcher class and then comment out parts given below or utilize another method for seam_find_type that use CPU instead of GPU like dp_colorgrad this helps you to use GPU and Cuda library for other modules of stitching pipeline furthermore, if you compile OpenCV with OpenCL this code can help you get faster speed.
if use seam_find_type == “gc_color”
or if use seam_find_type == “gc_colorgrad”
总结一下,4.x 之后就没有 GPU 加速了,我模仿 3.x 修改了相关源码,添加了 try_cuda 参数,并使用了相关 GPU 方法,然后编译调用,发现和使用 CPU 差不多,甚至有些配置下会更慢一点点。可能是我改源码的时候,有那么一两个 GPU 方法在 CUDA 8.x 之后就用不了了的原因,那一两个方法我保持了原样。 现在测试下来,两张 720p 的相机画面做融合,每一帧最快 0.3s,想做实时融合还是有点卡,应该还是只能针对相机画面场景自己实现了。
In summary, there is no GPU acceleration after version 4.x. I mimicked the changes made in version 3.x by modifying the relevant source code, adding a “try_cuda” parameter, and utilizing GPU methods. However, upon compilation and testing, I found that it performs similarly to using the CPU, and in some configurations, it’s even slightly slower. This might be because a couple of GPU methods I modified are no longer compatible with CUDA 8.x and later. I left those one or two methods as they were. Now, after testing, when combining the images from two 720p cameras, the fastest frame processing time is 0.3 seconds. Real-time fusion is still somewhat laggy, so it seems that implementing a custom solution for camera image scenarios is the way to go.