Ask Your Question
0

CV_CAP_PROP_SETTINGS working on opencvsharp not on opencv??

asked 2014-09-14 15:26:35 -0500

updated 2014-09-15 07:21:44 -0500

Hello, I've been using opencvsharp and this code works fine:

        VideoCapture capture = new VideoCapture(0);
        capture.Set(37, 1);

where 37 is CV_CAP_PROP_SETTINGS ( not defined in opencvsharps ) and correctly open my webcam configuration window.

Now trying on a cpp project with opencv

VideoCapture capture(0); // open the default camera
if (!capture.isOpened())  // check if we succeeded
    return -1;

capture.set(CV_CAP_PROP_SETTINGS, 1);

open the device, but no configuration window appears.

Any hint?

edit retag flag offensive close merge delete

Comments

1

is this the same machine and camera (driver installation) ?

note, that this property is not supported for all camera models / os / capture types.

did you try to access the props page from another program, like graphedit, or vlc even ?

which opencv version are you using ?

berak gravatar imageberak ( 2014-09-15 09:12:06 -0500 )edit

machine and camera are the very same and thus the drivers. Maybe there is some additional code in the opencvsharp wrapping that make the property page of camera appear. I could check but I've not such a deep expertise. Maybe someone do? Otherwise does anyone know of a camera model whose exposure can be set from opencv ( that is my purpose but my camera which is a SPC530NC allows it only via its property page ) ?

RaffaeleLiguri gravatar imageRaffaeleLiguri ( 2014-09-16 12:25:26 -0500 )edit

2 answers

Sort by » oldest newest most voted
0

answered 2014-09-14 19:59:16 -0500

Hi,

I am confused what you mean by configuration window; no window should come up that I am aware of. When using a capture.set() you are adjusting the camera settings where I grabbed some examples from link below: http://docs.opencv.org/trunk/doc/user_guide/ug_highgui.html

• CV_CAP_PROP_FRAME_WIDTH – Frame width in pixels.

• CV_CAP_PROP_FRAME_HEIGHT – Frame height in pixels.

• CV_CAP_PROP_FPS – Frame rate in FPS.

Hope this helps.

edit flag offensive delete link more

Comments

sorry, but this does not help. did you even try it ?

the goal of capture.set(CV_CAP_PROP_SETTINGS, 1); is to access the cam's property page, where you can store settings persistantly, and also reach some props , which are not wrapped in the opencv interface.

berak gravatar imageberak ( 2014-09-15 01:33:43 -0500 )edit
0

answered 2017-01-26 05:15:53 -0500

pklab gravatar image

from the doc

CAP_PROP_SETTINGS Pop up video/camera filter dialog (note: only supported by DSHOW backend currently.

Maybe opencvsharp uses cv::CAP_DSHOW as default backend for VideoCapture. Try using:

VideoCapture capture(0+cv::CAP_DSHOW); // open the default camera using DirectShow
if (!capture.isOpened())  // check if we succeeded
    return -1;
capture.set(CV_CAP_PROP_SETTINGS, 1);

And the doc says

Backends are available only if they have been built with your OpenCV binaries. See Video I/O with OpenCV Overview for more information.

edit flag offensive delete link more

Comments

PS: Currently there is an error in the doc. The description of CV_CAP_PROP_SETTINGS is under CAP_PROP_BUFFERSIZE

pklab gravatar imagepklab ( 2017-01-26 05:18:21 -0500 )edit

an error why do you mean?

LBerger gravatar imageLBerger ( 2017-01-26 09:04:21 -0500 )edit
1

In the doc, the description of CV_CAP_PROP_SETTINGS is under CAP_PROP_BUFFERSIZE. BTW I'm fixing it with PR8082

pklab gravatar imagepklab ( 2017-01-26 09:34:05 -0500 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2014-09-14 15:26:35 -0500

Seen: 1,988 times

Last updated: Jan 26 '17