Reply
Thread Tools
Posts: 61 | Thanked: 77 times | Joined on Dec 2009 @ Lancaster
#1
I am doing a feasibility study of an application on N900 that would set the value of aperture and leave the expousure and focuse on automatic settings, however, I need to retreive the focus distance (V4L2_CID_FOCUS_ABSOLUTE). I read through the video4Linux API and in section 1.9.6 Camera Control Reference found the following.


Exposure and aperture:


V4L2_CID_EXPOSURE_AUTO integer
Enables automatic adjustments of the exposure time and/or iris aperture. The effect of manual changes of the exposure time or iris aperture while these features are enabled is undefined, drivers should ignore such requests. Possible values are:

V4L2_EXPOSURE_AUTO Automatic exposure time, automatic iris aperture.
V4L2_EXPOSURE_MANUAL Manual exposure time, manual iris.
V4L2_EXPOSURE_SHUTTER_PRIORITY Manual exposure time, auto iris.
V4L2_EXPOSURE_APERTURE_PRIORITY Auto exposure time, manual iris.



Focus:


V4L2_CID_FOCUS_ABSOLUTE integer
This control sets the focal point of the camera to the specified position. The unit is undefined. Positive values set the focus closer to the camera, negative values towards infinity.

V4L2_CID_FOCUS_AUTO boolean
Enables automatic focus adjustments. The effect of manual focus adjustments while this feature is enabled is undefined, drivers should ignore such requests.


Using this values one could get the camera in the appropriate mode of operation and theoretically through the control class retrieve any of those values.

Will the V4L2_CID_FOCUS_ABSOLUTE value change as the camera tries to autofocus on an object? If not, is there any other value I missed that could be used for that. Where can I check if these controls are supported by the N900 hardware.

Thx for any help,

Klen

Last edited by klen; 2009-12-16 at 18:29.
 

The Following 3 Users Say Thank You to klen For This Useful Post:
Posts: 119 | Thanked: 110 times | Joined on Sep 2009 @ Prague
#2
I don't think that camera of n900 has any aperture (except for the aperture of lens - f/2.8) - only way to control exposition is therefore changing shutter speed and iso... and i'm not completely sure ISO changing is hardware-supported either (i.e. whether it isn't simulated by simply multiplying pixel values)..

dunno about the focusing - I've thought the video app has to control this, but seeing the focus_auto option makes me wonder........

there's a "mirror" app in repos - a simple python script showing how to handle v4l devices using python.. let's try hacking it to play with the back camera..
 

The Following 3 Users Say Thank You to andree For This Useful Post:
Posts: 61 | Thanked: 77 times | Joined on Dec 2009 @ Lancaster
#3
First of all, Thank you for your reply!

You are right about the aperture. I got confused by the way they wrote 2.8/5.2 on the camera lens.

The aperture is now irrelevant. I would only want to access the focal distance which I guess is stored in (V4L2_CID_FOCUS_ABSOLUTE).

Are there any examples of how to use Video4Linux API in maemo 5 application except for the camera_example? Is it possible to get the full source of a camera example?

Thx,
Klen
 
Posts: 119 | Thanked: 110 times | Joined on Sep 2009 @ Prague
#4
well, you could e.g. have a look on the source of the "mirror" app (in extras-devel).. or here: http://wiki.maemo.org/Documentation/...ging_subsystem
 
Posts: 61 | Thanked: 77 times | Joined on Dec 2009 @ Lancaster
#5
Thank you for your reply.

Unfortunately there are no source fails of the mirror app available in the extras-devel repo. One can only find files of the debian packaging.
 
Flandry's Avatar
Posts: 1,559 | Thanked: 1,786 times | Joined on Oct 2009 @ Boston
#6
Originally Posted by klen View Post
Thank you for your reply.

Unfortunately there are no source fails of the mirror app available in the extras-devel repo. One can only find files of the debian packaging.
You're not kidding. Furthermore, it's full of .svn files.

Ugh.
__________________

Unofficial PR1.3/Meego 1.1 FAQ

***
Classic example of arbitrary Nokia decision making. Couldn't just fallback to the no brainer of tagging with lat/lon if network isn't accessible, could you Nokia?
MAME: an arcade in your pocket
Accelemymote: make your accelerometer more joy-ful
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#7
Originally Posted by klen View Post
Unfortunately there are no source fails of the mirror app available in the extras-devel repo. One can only find files of the debian packaging.
It's written in Python. So I guess one could say that the program itself is its source.
 
Flandry's Avatar
Posts: 1,559 | Thanked: 1,786 times | Joined on Oct 2009 @ Boston
#8
Ah that didn't occur to me. I just saw the /opt and /usr directories and assumed it was precompiled.

Still a nasty mess with the subversion protected files everywhere though.
__________________

Unofficial PR1.3/Meego 1.1 FAQ

***
Classic example of arbitrary Nokia decision making. Couldn't just fallback to the no brainer of tagging with lat/lon if network isn't accessible, could you Nokia?
MAME: an arcade in your pocket
Accelemymote: make your accelerometer more joy-ful
 
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#9
Wha' ? Who ? Where ? There was a version in testing that accidentally got packaged with .svn stuff but it was fixed, like, months ago. The current version (2.1-1, that is in Extras) certainly does not have subversion files. Be sure to check your version.

Also, Mirror uses gstreamer for the video operations, nothing really low level so it's (from a hacking standpoint) almost the same as if you experimented with gst-launch from the command line (which is actually how Mirror came to life in the first place )
__________________
Blogging about mobile linux - The Penguin Moves!
Maintainer of PyQt (see introduction and docs), AppWatch, QuickBrownFox, etc
 
Posts: 45 | Thanked: 54 times | Joined on Oct 2009 @ Uppsala,Sweden
#10
Look at the source of v4l2ucp http://sourceforge.net/projects/v4l2ucp/. Especially the file v4l2ctrl.c. That can at least access the focus and shutter speed. However, I wanted to use that for bracketing shutterspeed (for making HDR pictures) but for some reason I cant get it to work.


Edit: Added link.
 
Reply


 
Forum Jump


All times are GMT. The time now is 09:24.