Ask Your Question

Background Subtraction example

asked 2015-08-04 08:03:44 -0500

breizher gravatar image

Hi, I am trying to follow this tutorial : When I compile the code I get this error :

Unhandled exception at 0x07EFC900 (amdocl.dll) in ConsoleApplication1.exe: 0xC0000005: Access violation reading location 0xF5A910D4.

The error arrived at the processVideo function at this line : pMOG2->apply(frame, fgMaskMOG2);

How can I solve this issue ? Thanks in advance for your help and sorry for my english

edit retag flag offensive close merge delete


Thanks it works now! adding cv::ocl::setUseOpenCL(false); and

  #include <opencv2/core/ocl.hpp>
breizher gravatar imagebreizher ( 2015-08-04 10:42:51 -0500 )edit

what is your graphic card?

LBerger gravatar imageLBerger ( 2015-08-04 11:04:36 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2015-08-04 08:53:45 -0500

LBerger gravatar image

updated 2015-08-04 11:32:58 -0500

May be you 've got a problem with ocl. You can insert this line before pMOG2->app to disable opencl call.

#include <opencv2/core/ocl.hpp>

You can try this example too

edit flag offensive delete link more



The OpenCL issue has been a problem for a while now. I hope someone is working on fixing that.

unxnut gravatar imageunxnut ( 2015-08-04 11:41:15 -0500 )edit

@unxnut It's not clear for me. Where is opencl code all codes are in modules/core/src/opencl or some codes are in hardware?

LBerger gravatar imageLBerger ( 2015-08-04 12:03:31 -0500 )edit

OpenCL is meant to take advantage of hardware acceleration using SIMD-type of instruction set, doing some vector processing. The code using OpenCL makes calls to distribute processing in hardware; so it is a combination of hardware/software though portable.

unxnut gravatar imageunxnut ( 2015-08-04 12:16:00 -0500 )edit

@unxnut actually the best way to go for the moment if you do not need OpenCL is to built OpenCV without OpenCL support. Else there is indeed the problem of functions calling OpenCL internally without you knowing it ... @mshabunin you know if someone at the OpenCV core dev team is working on these OpenCL issues? They seem to have started when introducing the T-API...

StevenPuttemans gravatar imageStevenPuttemans ( 2015-08-05 02:59:23 -0500 )edit

@StevenPuttemans Yes indeed. I rebuilt OpenCV without OpenCL support and have not had a problem. I am hoping that at some point, we do get a message that the problem has been fixed so that we can go back and use the OpenCL capabilities.

unxnut gravatar imageunxnut ( 2015-08-05 08:13:32 -0500 )edit

Are there any issues on tracker opened?

mshabunin gravatar imagemshabunin ( 2015-08-06 04:17:15 -0500 )edit

@mshabunin no idea. I only know of the Q&A topics.

StevenPuttemans gravatar imageStevenPuttemans ( 2015-08-06 04:21:49 -0500 )edit

@StevenPuttemans It's not clear for me in my post I think that's problem can be solved using an another graphic card. So where is problem in openc with opencl or hardware?

LBerger gravatar imageLBerger ( 2015-08-06 05:10:12 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-08-04 08:03:44 -0500

Seen: 312 times

Last updated: Aug 04 '15