Ask Your Question

OpenCV Error: OpenGL API call cv::ogl::Arrays::bind

asked 2014-04-17 12:10:05 -0500

FENGFENG gravatar image

updated 2014-04-18 11:38:47 -0500

I compiled OpenCV 2.4.8 with both cuda and opengl support using VS 2012 in Windows 8.1. Tested cuda with provided gpu optical flow sample and it worked well. OpenGL test failed using the provided gpu-example-opengl sample. The error msg is as following:

D:\Dev\SDKs\opencv-2.4.8-src\build_cuda+ogl\bin\Debug>gpu-example-opengl.exe road.png

OpenCV Error: OpenGL API call (An unacceptable value is specified for an enumera ted argument) in cv::ogl::Arrays::bind, file D:\Dev\SDKs\opencv-2.4.8-src\source s\modules\core\src\opengl_interop.cpp, line 1353

Update: after installing GLUT on my new laptop, running gpu-example-opengl.exe in release mode worked correctly. The error still existed in debug mode with the same error message, even after I recompiled OpenCV.

Any idea how to solve it? Thanks!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-05-13 02:39:45 -0500

LBerger gravatar image

Hi, one year after I have got same error. Program is OK in release mode and not in debug mode with windows 7-64 bits and VS 2013 and opencv-3.0.

Problem is relative this call at line 1347 of core/src/opengl.cpp


gl::GetError(); return gl::INVALID_ENUM. In opengl docs this message is for


        An unacceptable value is specified for an enumerated argument. The offending command is ignored and has no other side effect than to set the error flag.

* So I understand this message as it's only a warning. If you disable this check in opengl.cpp I can see an image in debug like in release mode. Is it necessary to send an assertion for this value?

edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2014-04-17 12:10:05 -0500

Seen: 243 times

Last updated: Apr 18 '14