Failed to load OpenCL runtime in OpenCV for Python

I am trying to run the first example here , but I am getting this error. I am using Ubuntu 13.10.

Failed to load OpenCL runtime
OpenCV Error: Unknown error code -220 (OpenCL function is not available: [clGetPlatformIDs]) in opencl_check_fn, file /home/cristi/opencv/modules/core/src/opencl/runtime/opencl_core.cpp, line 204
OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /home/cristi/opencv/modules/imgproc/src/color.cpp, line 3159
Traceback (most recent call last):
  File "/home/cristi/opencv1/src/video.py", line 11, in <module>
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.error: /home/cristi/opencv/modules/imgproc/src/color.cpp:3159: error: (-215) scn == 3 || scn == 4 in function cvtColor


Process finished with exit code 1

Also, this is the line causing the problem (line 11 in my code):

gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

What should I do?

+3
source share
3 answers

Failed to load OpenCL runtime

Most likely there are some problems with your installation. If you are not working with the GPU, I recommend that you disable all CUDA / OpenCL modules in OpenCV at compile time.

error: (-215) scn == 3 || scn == 4 in the cvtColor function

, 3 (BGR/ ) 4 ( RGBA). , , frame, print frame.shape.

, , , . print frame.shape , NoneType.

, . OpenCL , , , . , VideoCapture. , :

cap . , . , . cap.isOpened(). , .

+1

OpenCL, :

sudo apt-get install ocl-icd-opencl-dev

. , OCL opencv_core, , .

+12

You might want to install / update the driver: http://streamcomputing.eu/blog/2011-12-29/opencl-hardware-support/

Updating the driver will help solve my problem with OpenCL

+2
source

All Articles