Showing posts with label HDR. Show all posts
Showing posts with label HDR. Show all posts

Tuesday, July 9, 2013

Remote Camera Control

Gphoto2 is a library/command line tool that can be used to remotely control a digital camera (DSLR) connected to via usb. Under Ubuntu gphoto can be installed from the repository:
sudo apt-get install gphoto2

The following are a few of the available commands to get started:

1. Shoot camera and download image as test.jpg
gphoto2  --capture-image-and-download --filename=test.jpg

2. Download all files on the camera to PC
gphoto2 --get-all-files

3. Show the camera configuration options
gphoto2 --list-config

Some examples from running the above on a Canon EOS 10D:
/main/imgsettings/iso
/main/imgsettings/whitebalance
/main/capturesettings/aperture
/main/capturesettings/shutterspeed


4. Change camera configuration
gphoto2 --set-config /main/capturesettings/shutterspeed=1/8

By combining the above commands in simple scripts we can do stuff like HDR imaging and time lapse:

Shoot three exposures using gphoto and convert to HDR using luminance:
for i in 0.5 1 2; do  gphoto2 --set-config /main/capturesettings/shutterspeed=$i --capture-image-and-download --filename=$i.jpg; done;
 luminance-hdr-cli  -s hdr.exr *jpg

Take a picture every 3 days:
for i in {1..10}; do  gphoto2--capture-image-and-download --filename=$(date -I).jpg; sleep 3d; done;

Monday, April 8, 2013

Convert HDR files to EXR and tonemap using pfstools

Convert all .hdr files to .exr using pfstools. This will replace the hdr extension to exr.

$ for img in *.hdr; do pfsin ${img} | pfsout ${img%%.hdr}.exr; done


Similarly, tonemap multiple HDR files using a variety of tonemapping operations:

$ for img in *.exr; do pfsin ${img} | pfstmo_mantiuk08|pfsout ${img%%.exr}.ppm; done

pfstmo_mantiuk08 is one of many available tonemap operations available in pfstools.

How to install pfstools Matlab support (HDR, EXR)

Pfstools is a set of command line programs for reading, writing and manipulating high-dynamic range (HDR) images and video frames. This is how to install for Matlab:
  1. Get pfstools http://pfstools.sourceforge.net/
  2. ../configure --prefix=$HOME/local --with-mex=/path/to/matlab/bin/mex (this installs in home folder)
  3. make
  4. make install
  5. From Matlab, File, Set Path, set it to $HOME/local//share/pfstools/pfstools_matlab/
Use --prefix=/path/ to istall to custom path. By default it installs to /usr/local/
Note: Most linux distros have a pfstools package. if you don't need Matlab support install that instead.