Wednesday, May 7, 2014

Fixing wide-angle distortions with Hugin

Note: Hugin is a free cross-platform image processing tool, so this may be of interest to you even if you're using Windows or Mac.

Hugin is best known as a great tool to create panorama images from multiple photos; after all, the full title of the software product is Hugin – Panorama photo stitcher.

Another, not so widely known use of the same application is correcting distortions of wide-angle photos. When shooting with a wide-angle lens, you invariably end up with vertical lines leaning back, leaning to the side, or even "falling in" on the observer. While this keystone effect can enhance the impact of an photograph and is sometimes consciously included in the composition of an image for artistic effect, it often simply distracts the viewer, when you simply want to show a building or a city street "as is" and are using a wide-angle lens purely for practical purposes.

There's an extensive tutorial on the subject on the Hugin website, on which I've based my tests and the following notes.

The process of correcting those "falling" vertical lines essentially includes 2 basic steps:
1) Define lines that are supposed to be perpendicular
2) Distort the image so that these defined lines actually become perpendicular

Let's do this with this image:
Original wide angle photo

1) Load the image into Hugin, just as you would load any sequence of photos to create a panorama image.
Add image

2) Set the control points. This is where you spend most of your time, this is the step that takes some real, manual work.

Make sure that Auto add is set. To start with, make sure Zoom is set to fit to window (you may need to temporarily change this to 100 % in order to get the exact positioning of some control points perfectly right).

To set the control points, pick a vertical feature in the left copy of the image and set a control point at one end. Then, set the corresponding control point at the other end of that vertical feature in the right copy of the image.

Ideally, you define your vertical features spread over the whole image, from left to right, and both in the top and the bottom section. This will allow Hugin to correctly calculate the correct distortion for the whole image; if you only define vertical lines in the left half of the image, Hugin has no way of knowing that there are also vertical lines in the right half, leaning in a different direction.
Set control points

3) Click the Optimize button
Optimize

This will, well, optimize your control points. When done, apply the result of the optimization process:
Optimize completed

4) Open the Fast preview window:
Open Quick Preview

5) In the Projection tab, set projection type to Rectilinear.
Projection

6) In the Crop tab, drag the boundaries to adjust the crop area.
Crop

7) Create the corrected image. Since Hugin's primary function is to stitch multiple photos together to create panorama images, the final step of the process is called Stitch even though with only 1 image, you don't actually have anything to stitch together.

With that in mind, switch to the Stitch tab, make sure that Projection is set to Rectilinear, and click the Stitch button to let Hugin do its magic.
Stitcher

There you have it; one wide-angle picture with perfectly perpendicular vertical lines:
Modified by Hugin

Below are some more examples;

Original wide angle photo Modified by Hugin

Original wide angle photo Modified by Hugin

Original wide angle photo Modified by Hugin

Original wide angle photo Modified by Hugin

Original wide angle photo
Modified by Hugin

Monday, May 5, 2014

Video editing with Ubuntu

AVI Demux video editor
Avidemux is a free video editor designed for simple cutting, filtering and encoding tasks. The user interface doesn't exactly make this the ideal tool for complex editing (for instance, there's no "timeline" to arrange your clips), it does provide a good range of filters, resizing options, etc, it allows frame-accurate navigation thru your video, and individual frames can be saved as *.jpg images.

Most importantly, however, Avidemux makes it easy to create time-lapse videos from individual photos. As long as your image files are named sequencially (e. g. image0001.jpg, image0002.jpg, image0003.jpg, …), you simply drop the first one into Avidemux, and the software uses all subsequent image files in that folder to generate the video file.

Installation
Via Synaptic Package manager

Openshot video editor
Openshot provides plenty of options and flexibility even for relatively complex video editing tasks, including speed changes (something I haven't found in too many other free video editing tools).

Installation
sudo add-apt-repository ppa:openshot.developers/ppa
sudo apt-get update
sudo apt-get install openshot openshot-doc

Saturday, May 3, 2014

Photo processing with Ubuntu

Image manipulation with GIMP
Many would describe GIMP as the Open Source answer to Photoshop. While it may not include every last obscure feature of Photoshop, I found that it provides pretty much everything I need for my basic amateurish everyday photo processing.

Installation
Note Despite claims to the contrary, neither the installation instructions from the GIMP homepage nor the package retrieved by Synaptic Package Manager installed the latest version (2.8) on my system. Some research revealed that to actually install version 2.8, it needed to be done from a third party PPA, which first needs to be added to your system:

sudo add-apt-repository ppa:otto-kesselgulasch/gimp
sudo apt-get update
sudo apt-get install gimp

Batch photo processing
Phatch allows the bulk manipulation of images, modifying the actual photos as well as editing meta data (Click here for the full list of actions)

Phatch also comes with Phatch Image Inspector, which allows you to easily view all the EXIF tags of one or more image files.

Installation
Via Synaptic package manager

Hugin Panorama stitcher
Just what the title says, Hugin lets you stitch together a number of individual photos to create one big panorama picture. The software can also handle multiple rows of images, and it can be used on single images to correct falling lines on wide angle photos ("Keystoning effect").

Installation
sudo add-apt-repository ppa:hugin/hugin-builds
sudo apt-get update
sudo apt-get install hugin enblend panini

Luminance HDR
Luminance HDR lets you process a series of photos to generate a High Dynamic Rrange image.

Installation
1) Download *.deb file from http://www.ubuntuupdates.org/package/getdeb_apps/precise/apps/getdeb/luminance
2) Open downloaded *.deb file in GDebi Package Installer

Friday, May 2, 2014

Multimedia applications for Ubuntu

Media player
The VLC player is one of the most reliable and most versatile media players available.

Installation
sudo apt-get update
sudo apt-get install vlc browser-plugin-vlc

CD Ripper
Asunder is a graphical Audio CD ripper and encoder. It can be used to save tracks from Audio CDs.

Installation
Via Synaptic Package Manager

Note for the public record: Columbo does not condone "illegal" copying of copyright-protected content, regardless of how outdated the laws on intellectual property, how unfair any "fair use" policy stated in those laws, or how inadequate legal access to your favorite music and other audio content might be in your country.

Audio editor
Audacity is a free, open source, cross-platform software for recording and editing sounds.

Installation
Via Synaptic Package Manager

Thursday, May 1, 2014

Ubuntu online / communication tools

A couple of online / communication related tools for Ubuntu.

Note: In addition to Mozilla Firefox which comes with Ubuntu, most other popular web browsers are also available for Ubuntu. I won't go thru the details of installing the various browsers, as they can easily be found and set up. When in doubt, I recommend starting here.

Email
If you're unhappy with Thunderbird, Evolution may be the alternative for you.

Installation
Via Synaptic Package Manager

Skype
Skype client for Ubuntu

Installation, as per this site

On Ubuntu 32bit:
wget -O skype.deb http://download.skype.com/linux/skype-ubuntu_4.0.0.8-1_i386.deb
sudo apt-get install libxss1
sudo dpkg -i skype.deb
sudo apt-get -f install && rm skype.deb

On Ubuntu 64bit:
wget -O skype.deb http://download.skype.com/linux/skype-ubuntu_4.0.0.8-1_amd64.deb
sudo apt-get install libxss1 lib32stdc++6 lib32asound2 ia32-libs libc6-i386 lib32gcc1
sudo dpkg -i skype.deb
sudo apt-get -f install && rm skype.deb

Deluge bit torrent client
Deluge is an easy to use bit-torrent client.

Installation
Via Synaptic Package Manager
or
sudo apt-get update
sudo apt-get install deluge

Note for the public record: Columbo does not condone "illegal" downloading of copyright-protected content, regardless of how outdated the laws on intellectual property, how unfair any "fair use" policy stated in those laws, or how inadequate legal access to your favorite music, TV shows, and movies might be in your country.