After unzip opencv3.1.0, I was cmake with:
sudo cmake -D CMAKE_BUILD_TYPE=RELEASE -D INSTALL_C_EXAMPLES=ON –D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_CUDA=ON -D CUDA_FAST_MATH=1 -D WITH_CUBLAS=1 -D WITH_OPENGL=ON -D WITH_V4L=ON –D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_TBB=ON ..
But when I run opencv-3.1.0/sample/gpu/video_reader.cpp with compile :
sudo g++ $(pkg-config --libs --cflags opencv) -o stream video_reader.cpp
I have received notice:
OpenCV was built without CUDA Video decoding support
I'm using Raspberry 3. Thanks all !
解决方案
Raspberry Pi 3 has no NVIDIA GPU, therefore CUDA is not supported.
CUDA® is a parallel computing platform and programming model invented by NVIDIA. It enables dramatic increases in computing performance by harnessing the power of the graphics processing unit (GPU). - See more at: http://www.nvidia.com/object/cuda_home_new.html#sthash.5wWaGnZI.dpuf
Q: Is it possible to use the GPU for calculations? (e.g. CUDA/OpenCL)
A: Not at present - there is only a framebuffer interface for display purposes. There is no OpenCL and no plans for it nor is there documentation available to create OpenCL. CUDA is Nvida only so isn't applicable. Once an OpenGL driver becomes available you may be able to engineer some calculations via the GPU but how useful that will be remains to be seen.
Instead you can use OpenGL ES or OpenVG to write code using GPU. Raspberry PI video api