通常、コンパイル済みのOpencv LIBを利用すれば良いと思いますが、
CUDA GPUサポート機能を利用したい場合、そのために、
Opencvのソースコードを自分で、GPUサポートというようなコンパイルスイッチを入れて、
再コンパイルしなければならないのでしょうか。
宜しくお願いします
Opencvに明るい方へ
Re: Opencvに明るい方へ
その通りです。CUDA のツールキットをインストールしてから OpenCV をビルドすると組み込まれます。以下に示すページに書かれていますが、CMake のときに WITH_CUDA=ON オプションが付加されていて、かつ、CUDA のツールキットがインストールされていれば CUDA を組み込む Makefile が生成されます。(確か WITH_CUDA オプションはデフォルトが ON だったと思います。)
GPU Module Introduction — OpenCV 2.4.13.2 documentation
http://docs.opencv.org/2.4/modules/gpu/ ... ction.html
GPU Module Introduction — OpenCV 2.4.13.2 documentation
http://docs.opencv.org/2.4/modules/gpu/ ... ction.html
Re: Opencvに明るい方へ
みえ様
ありがとうございました!
=======================
To enable CUDA support, configure OpenCV using CMake with WITH_CUDA=ON .
When the flag is set and if CUDA is installed, the full-featured OpenCV GPU module is built.
Otherwise, the module is still built but at runtime all functions from the module throw Exception with CV_GpuNotSupported error code, except for
gpu::getCudaEnabledDeviceCount(). // これは旧版のOpencv [トピック主注]
cv::cuda::getCudaEnabledDeviceCount(). // これは新版のOpencv[トピック主注]
The latter function returns zero GPU count in this case.
Building OpenCV without CUDA support does not perform device code compilation, so it does not require the CUDA Toolkit installed. Therefore, using the gpu::getCudaEnabledDeviceCount() function, you can implement a high-level algorithm that will detect GPU presence at runtime and choose an appropriate implementation (CPU or GPU) accordingly.
========================
ありがとうございました!
=======================
To enable CUDA support, configure OpenCV using CMake with WITH_CUDA=ON .
When the flag is set and if CUDA is installed, the full-featured OpenCV GPU module is built.
Otherwise, the module is still built but at runtime all functions from the module throw Exception with CV_GpuNotSupported error code, except for
gpu::getCudaEnabledDeviceCount(). // これは旧版のOpencv [トピック主注]
cv::cuda::getCudaEnabledDeviceCount(). // これは新版のOpencv[トピック主注]
The latter function returns zero GPU count in this case.
Building OpenCV without CUDA support does not perform device code compilation, so it does not require the CUDA Toolkit installed. Therefore, using the gpu::getCudaEnabledDeviceCount() function, you can implement a high-level algorithm that will detect GPU presence at runtime and choose an appropriate implementation (CPU or GPU) accordingly.
========================