How to properly set up VideoCapture Tags

asked 2017-08-02 14:23:38 -0500

DavidR gravatar image

I am having trouble setting up opencv in C++ to manually change these properties, but every time I try I get the warning "An unhandled exception of type 'System.AccessViolationException' occurred in OpenCV Code.exe" and an error is thrown.

Here is how I am setting it up (cap is my videocapture object):


edit retag flag offensive close merge delete



"System.AccessViolationException" -- that's not an opencv exception, but one from your os. it's probably not the opencv code, but the way, you set up your project.

berak gravatar imageberak ( 2017-08-02 19:28:32 -0500 )edit

I see, thank you, do you know the proper format for the properties in order for OPENCV to recognize it also? I know you need a double value, but I am unsure of what range it takes.

DavidR gravatar imageDavidR ( 2017-08-03 12:04:00 -0500 )edit

can you try again with a simple, opencv console (empty, even, as in : no further assumption) application ?

(noticed, that you were trying to mix opencv and clr code before, which unfortunately is a "straight receipe for desaster" for any noob there)

opencv and clr/cli don't mix happily (being 2 almost orthogonal programming models), avoid the latter.

berak gravatar imageberak ( 2017-08-03 12:19:15 -0500 )edit

@berak can you elaborate on what types of code organizations would throw this error?

DavidR gravatar imageDavidR ( 2017-08-03 12:19:49 -0500 )edit

Unfortunately I cannot, I am trying to implement a windows forms UI which uses clr, is there any way around that error?

DavidR gravatar imageDavidR ( 2017-08-03 12:20:50 -0500 )edit

in short - don't. (unless you absolutely know, what you're doing with both opencv and win forms.)

also - gui obsession is a typical n00b thing (and a total waste of time). if you're really into computervision, you'll soon find out, that you won't need any of that.

berak gravatar imageberak ( 2017-08-03 12:43:35 -0500 )edit

Ok thanks, I will work within opencv's highgui. Do you know by chance where to find the range of values used in the the videocapture properties? I was unable to find anything in the documentation

DavidR gravatar imageDavidR ( 2017-08-03 13:25:42 -0500 )edit