View Single Post
Posts: 11 | Thanked: 8 times | Joined on Mar 2010 @ Sabah, Malaysia
#112
I've been running through a couple of forum threads and noticed that the N900 Video focus and led light, python script thread uses the v4l2-ctl library. Like expcomp, it supports changing exposure settings for the camera. Unlike expcomp, it doesn't change the EV relative to the default preset - instead you specify an absolute value.

While testing both libraries, I noticed that there is a maximum and minimum value for the EV. Exceeding these limits will simply cause the value to be set to the minimum or maximum possible. However, expcomp will erroneously report the out-of-bounds EV.

TL;DR: I wrote a set of HDR scripts which utilises the superior v4l2-ctl library:

./bracket-auto.sh performs just like the original script as provided by davost, with one extra twist - it will first check whether the current EV of the camera is already at minimum or maximum, and bracket accordingly. For example: If the EV is already at its maximum, instead of bracketing +2 and -2, it will bracket -2 and -4. As an added bonus, if you've installed eSpeak, the script will announce what it is doing, as well as its completion.

./bracket-manual.sh is a little bit more special - it allows you to manually set the minimum and maximum EV for the shot..
IMPORTANT: This script cannot be run as root. You must run it as the default user, otherwise you won't get any on-screen notifications while the camera application is active. Therefore, DO NOT sudo gainroot in X Terminal before running this script.
To use it, run the script with the camera application closed. The script will start the camera application and notify you to aim the camera at the brightest area in the scene, then half-press the shutter button. After this, you must repeat the procedure but point the camera at the dimmest area in the scene. This is necessary so the script can determine the minimum and maximum EV for the current scene.
After this, you should mount the camera on a tripod and half-press the shutter button a third time to focus the camera properly. The moment you release the shutter button, you will have 5 seconds to close the camera application by tapping the close button. After the 5 seconds have elapsed, the script will automatically take 3 shots at the minimum, maximum and ((minimum + maximum)/2) EV.
The script will beep 3 times when it completes (it won't announce anything even if eSpeak is installed).
Note: For both scripts, images will be saved in /home/user/MyDocs/hdr/. Make sure that you create this directory.

I've attached two files with this post:

1. A sample HDR image generated with enfuse running on Easy Debian with the raw images captured by ./bracket-auto.sh. It took about 15 minutes on my N900 to process it. FYI: That's a very hot tropical mid-day sun.

2. The actual scripts compressed into a tar.gzip file.
The scripts consists of several files which must be extracted and stored in a non-vfat folder (like the original davost scripts). Make sure that all of the files are executable, then you can run the two scripts listed above.
For more information about these scripts (including more comprehensive installation and usage instructions), you can check out my blog post. You can also see the raw images I used to generate the sample HDR image, as taken by ./bracket-manual.sh.

This is a pretty long post, I hope its useful I'm not sure whether I should start a new thread or keep it within this single thread. Let me know if I should start a new thread exclusively for these scripts.

Cheers

UPDATES
  • 2009-04-22: Uploaded new bracketing script (bracketing.20100419c.tar.gz) that *should* fix the "dsp_thread: failed waiting for events" issue when the script takes jpegs instead of pngs. I've left the older archive (bracketing.20100418.tar.gz) just in case something goes wrong with this newer script.


P.S. The tar.gzip package also contains hdr-enfuse.sh, which can be used in conjunction with Easy Debian to automate the processing of the raw image files.
Attached Images
 
Attached Files
File Type: gz bracketing.20100418.tar.gz (196.0 KB, 172 views)
File Type: gz bracketing.20100419c.tar.gz (196.0 KB, 135 views)

Last edited by eol; 2010-04-22 at 07:44. Reason: Updates
 

The Following 5 Users Say Thank You to eol For This Useful Post: