setting exposure on linux (CV_CAP_PROP_EXPOSURE and v4l)

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

setting exposure on linux (CV_CAP_PROP_EXPOSURE and v4l)

Lars O. Grobe
Hello,

this is my first mail to the opencv community. I am working on an application to stack frames captured from a uvc-camera for the generation of HDR images.

To get support for the v4l api on my ubuntu system, I recompiled opencv-2.48 with libv4l-dev. This finally allows me to adjust some of the settings, such as the resolution. However, setting the exposure on my camera (Logitech 920C), which is possible using v4l2-ctl as well as the various uvc-tools, fails.

The function call

capture.set( CV_CAP_PROP_EXPOSURE, 100);

leads to

HIGHGUI ERROR: V4L: Property Exposure(15) not supported by device

and also reading the settings does not work

HIGHGUI ERROR: V4L2: Unable to get property Exposure(9963793) - Invalid argument
HIGHGUI ERROR: V4L: Exposure control in V4L is not supported CV_CAP_PROP_EXPOSURE -1

Is there anything I am missing?

Thanks for any helpful hints, cheers,
Lars.



------------------------------------

Change settings: http://www.yahoogroups.com/mygroups, select
   Get Emails (get all posts)
   Daily Digest (one summary email per day)
   Read on the web (read posts on the web only)Or Unsubscribe by mailing [hidden email]
Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/OpenCV/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/OpenCV/join
    (Yahoo! ID required)

<*> To change settings via email:
    [hidden email]
    [hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo Groups is subject to:
    http://info.yahoo.com/legal/us/yahoo/utos/terms/

Reply | Threaded
Open this post in threaded view
|

Re: setting exposure on linux (CV_CAP_PROP_EXPOSURE and v4l)

sungam.yang
I came across the same problem before. On Linux, the function doesn't call V4L2 API, it always calls V4L API. It's strange. However, you can detour the problem by executing another program such as v4lctl. Otherwise, you should modify OpenCV source code under the highgui directory so that OpenCV invokes V4L2 API.




On Monday, February 24, 2014 6:49 PM, Lars O. Grobe <[hidden email]> wrote:
 
Hello,

this is my first mail to the opencv community. I am working on an application to stack frames captured from a uvc-camera for the generation of HDR images.

To get support for the v4l api on my ubuntu system, I recompiled opencv-2.48 with libv4l-dev. This finally allows me to adjust some of the settings, such as the resolution. However, setting the exposure on my camera (Logitech 920C), which is possible using v4l2-ctl as well as the various uvc-tools, fails.

The function call

capture.set( CV_CAP_PROP_EXPOSURE, 100);

leads to

HIGHGUI ERROR: V4L: Property Exposure(15) not supported by device

and also reading the settings does not work

HIGHGUI ERROR: V4L2: Unable to get property Exposure(9963793) - Invalid argument
HIGHGUI ERROR: V4L: Exposure control in V4L is not supported CV_CAP_PROP_EXPOSURE -1

Is there anything I am missing?

Thanks for any helpful hints, cheers,
Lars.



------------------------------------

Change settings: http://www.yahoogroups.com/mygroups, select
   Get Emails (get all posts)
   Daily Digest (one summary email per day)
   Read on the web (read posts on the web only)Or Unsubscribe by mailing [hidden email]
Yahoo Groups Links



    http://info.yahoo.com/legal/us/yahoo/utos/terms/
Reply | Threaded
Open this post in threaded view
|

Re: setting exposure on linux (CV_CAP_PROP_EXPOSURE and v4l)

Lars O. Grobe
Hi,

first of all, thank you for the reply. I know about the possibility to
do a system call to v4lctl, but it is not a very efficient work-around
if the target is instant control of the properties while capturing images.

Did anyone manage to work-around the limitation by modifying the code?
If so, is it opencv-2.4.8/modules/highgui/src/cap_libv4l.cpp where the
case-conditionals have to been changed? I just started with opencv, so
it is a scary idea to begin with modifying the underlying code.. ;)

Did any such modification make it into the repositries?

Cheers, Lars.

> I came across the same problem before. On Linux, the function doesn't
> call V4L2 API, it always calls V4L API. It's strange. However, you can
> detour the problem by executing another program such as v4lctl.
> Otherwise, you should modify OpenCV source code under the highgui
> directory so that OpenCV invokes V4L2 API.
>
>
> On Monday, February 24, 2014 6:49 PM, Lars O. Grobe <[hidden email]> wrote:
> Hello,
>
> this is my first mail to the opencv community. I am working on an
> application to stack frames captured from a uvc-camera for the
> generation of HDR images.
>
> To get support for the v4l api on my ubuntu system, I recompiled
> opencv-2.48 with libv4l-dev. This finally allows me to adjust some of
> the settings, such as the resolution. However, setting the exposure on
> my camera (Logitech 920C), which is possible using v4l2-ctl as well as
> the various uvc-tools, fails.
>
> The function call
>
> capture.set( CV_CAP_PROP_EXPOSURE, 100);
>
> leads to
>
> HIGHGUI ERROR: V4L: Property Exposure(15) not supported by device
>
> and also reading the settings does not work
>
> HIGHGUI ERROR: V4L2: Unable to get property Exposure(9963793) - Invalid
> argument
> HIGHGUI ERROR: V4L: Exposure control in V4L is not supported
> CV_CAP_PROP_EXPOSURE -1
>
> Is there anything I am missing?
>
> Thanks for any helpful hints, cheers,
> Lars.

Reply | Threaded
Open this post in threaded view
|

Re: setting exposure on linux (CV_CAP_PROP_EXPOSURE and v4l)

Asanka Wickramasinghe
Hi. I ran into same problem and ended up modifying opencv code. Exposure settings work with two cameras I tested. If you want I can share my opencv fork with you. Thanks
Reply | Threaded
Open this post in threaded view
|

Re: setting exposure on linux (CV_CAP_PROP_EXPOSURE and v4l)

Lars O. Grobe
Hi,

I am sure I would not be the only one here highly appreciating that,
could you share the changes?

Cheers, Lars.

> Hi. I ran into same problem and ended up modifying opencv code. Exposure
> settings work with two cameras I tested. If you want I can share my
> opencv fork with you. Thanks

Reply | Threaded
Open this post in threaded view
|

Re: setting exposure on linux (CV_CAP_PROP_EXPOSURE and v4l)

Asanka Wickramasinghe
Sure I ll update my repo as soon as I done testing




On Thursday, 1 May 2014, 13:42, Lars O. Grobe <[hidden email]> wrote:

 
Hi,


I am sure I would not be the only one here highly appreciating that,
could you share the changes?


Cheers, Lars.


> Hi. I ran into same problem and ended up modifying opencv code. Exposure
> settings work with two cameras I tested. If you want I can share my
> opencv fork with you. Thanks




Reply | Threaded
Open this post in threaded view
|

Re: setting exposure on linux (CV_CAP_PROP_EXPOSURE and v4l)

sungam.yang
In reply to this post by Asanka Wickramasinghe
Hello, congratulations on your progress.
It must be great contribution to the OpenCV community.

Could you please share the code so that I can test your code and give some feedback to you?

Thanks,

Sung Am YANG
On Wednesday, April 30, 2014 8:13 PM, "[hidden email]" <[hidden email]> wrote:
 
 
Hi.
I ran into same problem and ended up modifying opencv code. Exposure settings work with two cameras I tested. If you want I can share my opencv fork with you.  Thanks  
 
Reply | Threaded
Open this post in threaded view
|

Re: setting exposure on linux (CV_CAP_PROP_EXPOSURE and v4l)

Asanka Wickramasinghe
In reply to this post by Asanka Wickramasinghe
hello,


I have updated my opencv repository. https://github.com/asanka424/opencv


Manual exposure and focus settings are working. (tested with Logitech c920). To set exposure or focus manually first auto exposure/focus should be disabled. use property ID CV_CAP_PROP_FOCUS_AUTO and CV_CAP_PROP_EXPOSURE_AUTO for that.
eg: disable auto focus
cap.set(CV_CAP_PROP_FOCUS_AUTO,0)

enable auto focus
cap.set(CV_CAP_PROP_FOCUS_AUTO,1)


exposure settings are little different. V4L2 has four type of exposure modes. Therefore values for CV_CAP_PROP_EXPOSURE_AUTO should be 0,1,2 or3. Please refer v4l2 documents for proper definitions. These settings will differ from camera to camera. Logitech camera I use only support mode 1 (manual) and 3 (aperture mode).



Hope this helps. Please let me know if you face any problems.








On Thursday, 1 May 2014, 18:58, Asanka Wickramasinghe <[hidden email]> wrote:


 
Sure I ll update my repo as soon as I done testing




On Thursday, 1 May 2014, 13:42, Lars O. Grobe <[hidden email]> wrote:

 
Hi,


I am sure I would not be the only one here highly appreciating that,
could you share the changes?


Cheers, Lars.


> Hi. I ran into same problem and ended up modifying opencv code. Exposure
> settings work with two cameras I tested. If you want I can share my
> opencv fork with you. Thanks








Reply | Threaded
Open this post in threaded view
|

Re: setting exposure on linux (CV_CAP_PROP_EXPOSURE and v4l)

irum
This post has NOT been accepted by the mailing list yet.
hi.. i replaced my cap_v4l with one from your repo. but iys not reflecting any changes. and also I still have the exposure problem. Is there anything I am doing wrong ?