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 that is causing the trouble (line 11 in my code):
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
What should I do?
As for the OpenCL failure, try installing required packages:
sudo apt-get install ocl-icd-opencl-dev
Worked for me. My guess is that OCL is a part of the opencv_core
module, and if it failed to initialise, then many other components might behave strange.
You might want to install/update the driver: http://streamcomputing.eu/blog/2011-12-29/opencl-hardware-support/
Updating the driver help to solve my problem with OpenCL
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With