Scripting Exposure Compensation for Timelapse

As I discussed previously it’s sometimes necessary to change the exposure during a timelapse capture ( for example for a sunset or sunrise). However for timelapse the advice is generally to leave the camera in full manual mode because modifying the exposure during the capture can lead to two problems:

  • Changing the exposure can cause a very noticeable flicker in the final movie which de-flickering tools may not be able to remove
  • Adjusting the controls on the camera during a timelapse can cause the camera to move slightly which will also be very noticeable in the final movie

The process described below can overcome both of these problems over a limited range of exposures. Wider exposure changes need different approaches and these are discussed at the end.

Note that in the discussions below “Exposure Value” means the potential total amount of light entering the camera for each shot. A larger exposure value means potentially more light and this can be achieved by one or more of:

  • Decreasing the aperture ( e.g. f8 instead of f11 )
  • Decreasing the shutter speed ( e.g. 1/60s instead of 1/120s )
  • Increasing the ISO ( e.g. 400 ISO instead of 100 ISO )

The opposite is done to reduce the exposure value. The Wikipedia article on Exposure value discusses this in great detail but the introduction gives the information that most people need..

The Problem

The exposure problem is shown in the following diagram:

The red line shows the actual exposure needed for a sunset timelapse. At the start the required exposure is lower because the sun is higher in the sky and so is brighter. As the sunset progresses then the sun gets lower and less bright so more exposure is needed. ( I’ve assumed that the change in exposure is linear ). The green line is the exposure of the camera which, being fixed, is a compromise. It’s over exposed at the start, nearly correct in the middle and then under exposed at the end.

The Solution

If we shoot in RAW format then there is scope for adjusting the exposure of each shot after the timelapse sequence is taken.

The two blue lines show the exposure compensation that is available from the RAW format – usually about +/- 3EV. This shows that it’s possible to modify the “fixed” exposure from the camera to meet that of the sunset. However there are limitations to this technique. For example trying to shoot a 24hr timelapse of a city scene going from full daylight to full darkness is probably going to require more exposure change than this technique can handle.

I found that the easiest way of determining the amount of compensation needed was to open the first and last frames in an editor ( I use Darktable or UFRaw ) and modify the exposure of each frame until they look OK. Ideally for a sunset the first image will need a negative compensation ( made darker ) and the final image positive compensation ( made lighter ). I then make a note of these changes for the script below.

Tools and Scripts

Having decided on the exposure change needed for the first and last frames then manually calculating and modifying the exposure for the remaining frames of the video is somewhat impractical and tedious so some form of script is needed. In addition, after the exposure compensation has been applied to a RAW image, it needs to be converted to a jpg or a png file. Finally a “nice to have” option would be the ability to crop and/or resize the images.

The only tool that I know of that can do all this from the command line is UFRaw, or specifically the command line version – ufraw-batch. The man page for ufraw-batch will show the very large number of options available but we need to end up with something along the following lines for each file:

ufraw-batch DSC_4442.NEF --exposure -1.5 --restore clip 
--out-type png --crop-left 209 --crop-right 4072 --crop-top 603 
--crop-bottom 2776 --size 1279 --out-path=output_files --overwrite

This looks complicated but is quite logical:

  • The black text runs ufraw-batch on the file DSC_4442.NEF
  • The red text specifies the exposure change needed ( 1.5 stops darker in this case ) the “–restore” option control how highlights are restored when applying negative EV. ‘clip’ restores nothing and is therefore safe from any artifacts. Refer to the man page for more details.
  • The green text specifies the output file type, the output location ( in a sub-directory called output_files in this case ) and to automatically overwrite any existing files.
  • The blue text is optional and specifies any cropping and resizing

( Note: The “size” option should specify the number of pixels on the larger side of the final image. In this case I wanted a width of 1280 but to achieve this I had to set –size to 1279. I haven’t checked the UFRaw code to see if this is a bug or a feature )

The script to make these edits runs in a two stage process. Note that the script and an example configuration file can be found in my GitHub repository – – under the directory “timelapse_exposure_script”

  1. Run the first script ( ) and its associated configuration file on the directory containing the RAW images. This generates a ufraw-batch command for each file which can be stored in a second script file …
  2. The actual edits are done by running the second script file. Note that this make take some time to run.

I chose the two step approach because the edit commands can take a long time to run and sometimes it’s useful to do a sanity check first.

The script is largely self explanatory but some points to note:

  • The configuration files are effectively script files themselves which are run using the “source” command in the script. This is a simple way of allowing the user to override the default values.
  • Cropping can be disabled by setting the left and right crop values to be the same, disabled by default
  • Resizing can be disabled by setting the size value to be 0, disabled by default
  • Script files can normally only handle integer values. However floating point values are needed to calculate the exposure values. I’ve used the bc language as a simple calculator to achieve this. Four decimal places are used to maintain the accuracy although I think that that UFRaw only uses two places.
  • The script currently assumes a linear change in exposure values. However it could be modified to handle more complex changes if necessary.
  • The script sends its output to the command line. To create the second script this output needs to be redirected to a file, e.g. “ myconfig.cfg > editscript

I used this script to process the files for the sunset timelapse. The change in exposure was quite small = -1.5EV for the first image and +1EV for the final image. The change in the final image is virtually unnoticeable after the image has been cropped and rescaled but it does make a subtle improvement to the overall movie

First Frame

Final Frame

Alternative Methods

Other techniques like Bulb Ramping are available to cope with wider exposure changes but these usually need additional equipment and put restrictions on what shutter speeds, and therefore what image intervals, you can use.

The Alpine Labs website has some explanations and example timelapses taken with their equipment ( but note that I haven’t tried any of their products). Other, usually more expensive, controllers can use a combination of shutter speed, aperture and ISO to ramp the exposure but may depend on what remote control features are available on your camera.

If you have a Canon camera then the Magic Lantern alternative firmware can implement bulb ramping in camera. I have a Nikon so I haven’t tried it.


Posted in Timelapse | Leave a comment

Buildings and Patterns

Repeating patterns can often add interest to what might otherwise be mundane images. I found that this was especially true of buildings and architecture. The photos below were taken during the period that I lived and worked near Birmingham in the UK.

This is one of the upper floors of the new Birmingham Library. The photo was taken from the public balcony overlooking Centenary Square and the colours of the decoration on the building contrast nicely with the blue sky.

This one was taken from the same place as the previous photo but looking in the opposite direction. I liked the way that the windows of the building were acting as a mirror. The panes of glass looked very regular and perfect but the distortion of the reflection shows that this isn’t the case. ( The building in the reflection is the Alpha Tower and I was slightly surprised to learn that it’s Grade II listed 🙂 )

There are two patterns in this photo. In the foreground is the 19th Century Birmingham Town Hall now used as a concert venue. In the background is the Alpha Tower again and I liked the contrast between the old and modern patterns.

This photo happened by accident. I was a little early for my train home so I went up to the car park above Snow Hill station in Birmingham to see if it was a suitable location for rail related shots. It wasn’t but I did get another reflection photo. I especially like the slight “circus mirror” distortion effects in the reflected image.

I walked past this large apartment complex every day on my way to work. During the 2014 World Cup in Brazil there was obviously one optimistic England fan living there and I liked the way that the flag broke up the slightly austere look of the building. This side got the sun in the morning and I had been trying, without success, all week to get a sunlit photo at that time of day. By the end of the week I got fed up and just took the photo anyway. It was a good job that I did because that evening England lost 2-1 to Uruguay effectively knocking them out of the competition and the following morning the flag was gone 🙂


Technical comment – In my experience it’s often difficult to get into the perfect position for taking photos of buildings. Usually you’re too high or too low or off to one side which inevitably means that it’s going to be necessary to correct the perspective. It’s worth experimenting with your favourite photo editor because I think that it can make a big difference to the final image. On the right is a version of the second image above without the perspective correction and I don’t think that it’s as good.

Posted in Patterns, Photography | Leave a comment


OK, so Paris, at number 3 in the world’s most popular tourist cities, is not exactly off the beaten track. However there are still relatively undiscovered activities and locations to be had which allow you to avoid the crowds.

Getting there, accommodation and getting about

From the UK you can travel to Paris by virtually any mode of transport. The most convenient is maybe the Eurostar and, like our Brussels trip, we had in the past booked a hotel conveniently close to the Gare du Nord via the Eurostar website along with the train ticket. For our last visit however the city centre hotel prices seemed to have gone up alarmingly so we decided that a re-think was necessary.

Having had success with the Gîtes de France site in other areas of France we had a quick look and found a reasonably priced place in Saint-Nom-la-Bretèche to the west of Paris, not far from Versailles. It was self-catering but as it was only a couple of hours drive from the channel ports then this was not a problem.

We picked the accommodation mainly because it was a short drive to the Gare de Saint-Nom-la-Bretèche – Forêt de Marly station on the Paris Transilien suburban rail network with the added bonus of free parking 🙂 Train ticket options around Paris appears to be just as confusing as the UK but we found that the Zone 1 to 5 Mobilis tickets were the best option. For 17.30€ these give one day access to any method of transport and you can buy them from the automated ticket machines at the stations. Generally the trains into the centre of Paris were not too crowded, on time and there were 2 trains an hour off peak.

Alternative Things to See and Do

La Défense

The area of La Défense was named, not after a fort or citadel, but after a statue erected to commemorate the defence of Paris during the 1870 Franco-Prussian war. Today it’s the business district but nevertheless has some interesting architecture. The most well known is probably the Grande Arche but there are plenty of others. As well as office buildings there are a number of shopping arcades with a mix of the usual large chains and smaller shops.

“Le Pouce” by sculptor César Baldaccini. This is ( an extremely ) large scale model of the artist’s own thumb. It’s 12m tall and weighs 18 tons, just the thing for your business district 🙂

A couple more small points:

  • La Défense has good rail links and we found that it was more convenient to get off there rather than go into Gare Saint-Lazare which is an extra 15 min travelling.
  • You can avoid a lot of queuing to get into Paris museums by buying the tickets from a FNAC store. There’s a big FNAC in La Défense which was virtually empty mid-morning when we went in there ( I think that there’s a 1€ supplement on the tickets )

Free Classical Music Concerts

The École Normale de Musique de Paris is roughly the equivalent of the Royal School of Music in the UK. Every Tuesday and Thursday at 12:30 there are free concerts – Les Concerts de Midi & Demi – given by the higher level students as part of their course. Check the website for details of the concerts each week but we heard a piano recital and it was of an extremely high standard.

Île Saint-Louis

There are two islands in the Seine in the centre of Paris. The well known one is the Île de la Cité which is the one with the Notre-Dame Cathedral on it. The other one, next door, is the Île Saint-Louis which is much less well known but is full of largely unchanged 17th and 18th Century architecture.

It’s mainly a residential area but the Saint-Louis-en-l’Île Church is certainly worth visiting. We wandered in because we heard some wonderful organ music being played. There was no specific occasion, it was just the organist practicing – he or she was very good 🙂 There’s a page on the Pleasure of the Pipes website with some great pictures and recordings.

Other Sights

Paris Métro

Entrance to Abbesses Métro station

I love the art nouveau signage and station entrances on the Paris Métro. However there are only three stations that have the original glass roofs designed by Hector Guimard. The Abbesses station ( pictured ) is one, Porte Dauphine and Châtelet are the others.

Strictly speaking Porte Dauphine is the only completely original one – the Abbesses roof was moved from the Hôtel de Ville station in 1974 and Châtelet is a replica.

Other stations, e.g. the Louvre and Arts et Métiers, also have their own unique themes and are worth visiting.

Eiffel Tower at Night

The Eiffel Tower is illuminated at night and there are often special light shows using the tower’s lights. A great place to view them is from the Esplanade de Trocadéro, it’s a popular spot but not so busy that you can’t find a wall to prop the camera on to take some pictures.

The Pont d’Iéna is also a good spot for pictures. It was a bit busy here but I managed to find a lamp post to lean on to remove most of the camera shake ( 1/8th s exposure )

Tesco Vouchers

UK visitors with Tesco vouchers can exchange them for a 1 hour boat trip on the Seine at very advantageous rates. We got two tickets worth 4x the value of the vouchers.

Posted in Paris, Travel | Leave a comment

Book Review – Corsairville

corsairvilleWhen I was a teenager I read a feature in the Western Mail newspaper about the Short Sunderland flying boats that operated from Pembroke Dock in West Wales during the Second World War. For some reason this really caught my imagination and since then I’ve always had a background interest in flying boats.

Graham Coster’s book “Corsairville” provides an insight into the ten years that Imperial Airways operated passenger services using the Short Empire flying boats. The title of the book refers to an incident that happened to the flying boat G-ADVB – Corsair where, because of an incorrectly fitted navigation aid, she was put down on the River Dungu in the then Belgian Congo, now Democratic Republic of the Congo, rather than the Sudan which was her original destination. Because of the outbreak of war, and the switch in production by Short’s to the Sunderland for the RAF it was unlikely that Imperial Airways would ever be able to get a replacement from the factory. So the decision was made to try and recover Corsair rather than abandon her. This lead to a protracted rescue and repair mission where a small village – Corsairville – was built to house the engineers and labourers taking part in the recovery. Eventually, 10 months later, on the second attempt after the river had been dammed to raise the water level, Corsair flew again and was eventually returned to service.

The book is arranged around Graham’s journey to retrace one of the Imperial Airways routes to South Africa and to try and find any remains or memories of the flying boat landing points along the route. He’s also tracked down many of the people who flew on and crewed these craft and their reminiscences make for fascinating reading. It’s possible that this period is about the last where air travel itself was an adventure rather than today being just a commodity to be bought off the internet.

Graham has also tracked down a few of the remaining flying boat services in Alaska and Florida and describes his experiences with these crafts. However I get the feeling that these, although interesting, are a mere shadow of the original Imperial routes.

Overall a fascinating book showing the drive and determination needed to set up the flying boat service in the first place and also the skills needed to extract Corsair from the River Dungu.

Other Notes

  1. The TV series “Mighty Planes” has an episode on one of the few remaining Martin Mars flying boats which is currently being used as a water bomber for fighting forest fires. The series is shown fairly regularly on the Discovery or Quest channels in the UK and has some fabulous footage of the take offs and landings.
  2. On a blog dealing with missionary letters from the Congo there’s a brief description of the Corsair event together with a photo. The description written on the back of the photo is also very interesting.
  3. In the book Airfields and Landing Grounds of Wales: West there’s a chapter describing flying boat operations during the war from RAF Pembroke Dock.
Posted in Book Review | Leave a comment

Garmin Gecko with Free & Open Source Software ( FOSS )

Garmin geko201Some years ago I bought a Garmin Geko 201 GPS receiver, mainly for tracking paths and routes when out walking, cycling or cross country skiing. At the time I bought it because it was the cheapest unit that I could find that had a serial interface for uploading data. Although it’s now a discontinued model it still works very well and, having finally bought a proper handlebar mount, I now mainly use it on my mountain bike. I suspect that my Android phone would do the same job but I wouldn’t really be happy strapping that to the bike whereas the Garmin takes all the punishment I can throw at it. I also get 8 – 12 hours of battery life out of 2 AAA cells so I don’t have to worry about flattening / recharging the phone battery.

Connecting it to my Linux PC and uploading the tracks is a fairly straightforward process. There are three main steps:

  1. Physically connect the device to the PC
  2. Upload the GPS track data
  3. Display the track data, preferably overlaid on a map

Taking each of these in turn:

Connecting to the PC

The 201 has a serial interface ( RS232 – remember them 🙂 ) but these days very few PCs have serial ports. The simplest solution is to buy a USB/serial converter which should cost around £10. A lot of these are based around a chip produced by FTDI and the latest Linux kernels will recognise these automatically. If not then you’ll need to look through the DMESG output for something along these lines and find the necessary drivers online:

[ 2813.639277] usb 2-1.4: Manufacturer: FTDI
[ 2813.699703] usbserial: USB Serial support registered for FTDI USB Serial Device
[ 2813.699784] ftdi_sio 2-1.4:1.0: FTDI USB Serial Device converter detected
[ 2813.701642] usb 2-1.4: FTDI USB Serial Device converter now attached to ttyUSB0

( left ) RS232 / USB adpater & ( right ) Garmin serial cable

The 201 unit itself has a custom serial port connector rather than the standard 9 pin D-type so you’ll need a further adaptor cable. A search for “garmin geko 201 serial cable” should bring up some alternatives. These are more expensive than you might think at about £20.

Once you’ve physically connected the Garmin then it will appear as something like:

crw-rw---- 1 root dialout 188, 0 Jan 16 21:20 /dev/ttyUSB0

By default it’s in the “dialout” group so you’ll need to add your user to that group to be able to use the device. There is some discussion in this forum post and the following command worked fine for me:

sudo usermod -a -G dialout <user>

( Replace <user> with your user name )

Upload track data

The “go to” software for uploading GPS data from the Garmin is GPSBabel. This is a command line program but there is a front end GUI available called Gebabbel which I use and find quite useful. It’s a very simple interface:


The process is:

  1. Select “Get tracks from Garmin”
  2. Set up the input type, in this case a Garmin device on ttyUSB0
  3. Set any filters. I always leave this blank and do any filtering or editing in the display program – see below
  4. Set up the output type, in this case a GPX file that can be imported into the display program
  5. Set up what to import
  6. Click execute and wait for the import to complete

( The program has many more options than this, refer to the manual for details )

Display track data

To display the track data I had a number of basic requirements:

  • Overlay one or more tracks on a map – either something like OpenStreetMap or like Google / Bing maps aerial view.
  • Display some summary statistics like total distance / average speed / height gained etc.
  • Display graphs of things like elevation profiles and speed

After a bit of a search and trying out a few options I settled on the Viking software. It does everything that I want and has some more advanced features that I may investigate in the future.

Two points about the UI which caught me out:

1. To see the statistics about a GPS track you need to select the track then right-click and select “Properties”.

2. The map layer needs to be the bottom layer so that the tracks are overlaid on top. To move a layer up or down use the arrow keys at the bottom of the left hand pane. I right-clicked the layer and expected “move up/move down” options!

The only problem that I’ve had with it is that clicking on, for example, the Elevation-distance graph should show the point on the map view. I have had occasional crashes when doing this, however it’s not serious enough for me to stop using it.

Other software is available of course:

GpsPrune came a close second but I felt wasn’t quite as easy to use. Also there is limited online documentation as the author of the software prefers to sell the manual as a printed book or PDF download.

There is a very good online tool called GPS Visualizer but I wanted to be able to store and analyse tracks on my PC rather than online.

I came across an old forum post with a list of suggested software. Not all of these are for Linux and I imagine that some don’t exist anymore but it may be worth a quick peruse.

Posted in FOSS, Garmin | 4 Comments

Motion Blur in Photography

Photographs by their very nature capture an instant in time. To give the impression of movement or speed it’s sometimes necessary to move outside the standard camera settings or techniques. One option is to pan the camera as the photo is taken so that the background is blurred but the object being photographed is sharp to give the impression of speed. This method is often used to great effect with action sports.

An alternative is to use a much slower shutter speed than normal so that the background stays sharp but the object being photographed is blurred which also gives the impression of movement.

Here are a few that I’ve taken using the second method together with some additional information that may be helpful. Note that all these photos were taken with the camera on a tripod and I used a remote shutter release cable.

Car lights blur

car_lightsThis is a classic “car lights at night” photo. I found that these shots work best when there are other sources of light as well as the cars so as to add some detail to the scene – just a picture of car lights up a dark road is not very interesting. An alternative is to shoot at twilight or dawn when there’s just enough light to see some surrounding detail but the car lights are still visible.

This is a junction of the M40 motorway, there’s a convenient footbridge just south of the junction which is where I took the photo. It’s a 25s exposure to make sure that I got plenty of lights on the motorway, including some dashed orange lights from car indicators and also some lights up and down the slip roads.

Railway at night

This is a slight variation on the “car lights” theme with a long exposure photo of trains passing through a station at night. The idea was to get a “ghost train” type effect by starting the exposure before the train entered the frame so that the platform opposite was partly exposed then stopping the exposure once enough of the train had passed through. The exposure time was dependent on how long it took the train to pass through the station and it took a few attempts to get it just right. The exposure times were 6s and 2s respectively for the two photos and the aperture / ISO set accordingly. I experimented with the exposure with an empty station beforehand to get it right with no train passing through.

Night train #3In this photo the station train information displays were a bit of a problem because they were quite over exposed. I tried a few things to get round it but in the end I decided that they weren’t too bad and just left them as they were. The exception was one display just in the top left hand corner which was too bright and distracting so I edited the image to blank that display. The dashed orange lights were caused by the dot matrix information panels on the side of the train.

Railway during the day

Motion blur like this doesn’t always have to happen at night. These are two photos that I took during the day with the help of an 8 stop neutral density ( ND ) filter. The first one is of a locomotive hauled train and for some reason the loco is in a different livery from the rest of the train which makes for an interesting contrast. In the second one a public footpath ran right next to the line before going over it on the footbridge behind. At this range even a 1/8th of second exposure was sufficient to get quite a lot of motion blur.

General comments

1. Every Train Operating Company ( TOC ) in the UK will have a set of rules or guidelines about taking photographs on station platforms. Usually these can be found on the company website and most of them are along the lines of “Feel free to take photos but don’t be an idiot and don’t get in the way”. There may also be restrictions on commercial use of these photographs.

2. For locations other than stations then a map can be useful to find out where public footpaths run close to or across railway lines. There are a few options here:

  • Bing maps has an OS map option and you can zoom in to a 1:25000 scale.
  • Google or Bing map satellite views are great for getting more detailed information about a prospective site and Google Street Map is useful for identifying parking spots down remote country roads.
  • New OS paper maps have a code that can be used to download an electronic version of the map to your tablet or phone or you can buy just the electronic versions.
  • OpenStreetMap is a free alternative, I use the OsmAnd app on my phone which allows maps to be downloaded for offline use. ( There’s a free version with limited map download capability or a paid for version with unlimited downloads )

The location for the two daylight ones above was found from examining an OS map.

3. The best source of train time information for the UK that I’ve found is the Realtime Trains website. You can pick any station in the UK and the site will give you a list of all trains passing through that station, including ones that don’t stop and including goods trains. The data is updated in real time and there are now iPhone and Android apps as well but I haven’t used these.

4. My experience is that it’s virtually impossible to predict how a photo like this is going to turn out so experimentation and perseverance are essential. For the night time photos I found that the evening weekday peak periods during the winter months were the best times to get most trains per hour. I used to print out a listing from Realtime Trains and take it with me but an app would be much better, assuming that there’s a suitable mobile signal.

5. It gets very cold standing around a station for a couple of hours in the dark in the dead of winter. The first two night time train shots above took about 2 hours and several trains to get the timing right. I soon found out that a warm coat, thermal underwear and insulated gloves and boots were much more useful than a fancy camera. Conversely, in the Summer some footpaths may be overgrown and may need a bit of pruning to make access easier. A pair of secateurs would be a useful addition to the camera bag.

Posted in Photography | 2 Comments

Vosges Mountains

Mountain ranges of France map-frThe Vosges mountains lie between the two French regions of Alsace and Lorraine in north eastern France. They’re not as spectacular or as well known as the Alps or the Pyrenees with the highest peak being the Grand Ballon at 1424m ( 4670’ ) Nevertheless the scenery is spectacular with significant forest cover and only the tops of the highest peaks are completely bare. The Vosges act as a barrier to the wet westerly winds and most of the rain ( and snow in the winter ) falls on the Lorraine side. Because of this Alsace is one of the driest regions in France and has a micro-climate which is ideal for growing vines.


Getting there, accommodation and getting about

The two closest airports are Strasbourg to the north or Basel to the south. There’s a good train service up the Rhine valley on the Alsace side and the TGV Est runs from Paris to Strasbourg. However, other than that, the public transport can be a bit patchy and a car is recommended. It’s a long day’s drive from the channel ports especially if you need to arrive at the accommodation by late afternoon. When we travelled by car from the UK we usually stopped off overnight in Reims.

There are a number of options for accommodation in the Vosges. There are plenty of hotels to suit all pockets and the area is well served by self catering accommodation all the year round – check the Gîtes de France site for a good selection that can ( mostly ) be booked online. For the summer months there are plenty of campsites in all price brackets.

We’ve mainly stayed in the area around Gerardmer which is convenient for most of the Vosges and the Ballons des Vosges Regional Nature Park in particular.


Summer or winter the Vosges are ideal for outdoor activities of all types. In the summer there are numerous walking or mountain biking routes to suit all skills and abilities. The road from Gerardmer to Munster on the Alsace side goes over the Col de la Schlucht which has been used as a category 2 climb in the Tour de France on several occasions, most recently in 2014. In the summer there are plenty of amateur cyclists pitting themselves against the climb.

In winter of course it’s snow sports that feature the most with facilities for both alpine and cross country skiing. Snow conditions are generally less reliable than the Alps and, for the poorer years, the downhill runs at La Bresse and Gerardmer are equipped with snow cannon.

Cross country ski tracks along the Route des Crêtes

Cross country ski tracks along the Route des Crêtes

At the summit of the Col de la Schlucht the road crosses the Route des Cretes which was built by the French Army as a supply route during World War 1. It runs north/south for over 80km, mostly at an elevation of around 1000m. Parts of the Route des Cretes are closed by snow during the winter and these are used as cross country ski tracks. One of the most picturesque runs for 10km between the Col de la Schlucht and Lac Blanc.

vosges2As well as skiing there’s a diverse range of snowshoeing tracks. Our favourite routes are between the Hohneck ( one of the highest points of the Vosges, near the Col de la Schlucht ) and the Kastelberg to the south along the open peaks or through the trees from the Col de la Schlucht.

There are endless hire shops for mountain bikes, alpine or cross country skis, snowshoes etc.


Alsace-Lorraine is no stranger to conflict. In Roman times the Rhine formed a heavily fortified border to the empire. After the Romans the region was invaded first by the Alamanni then the Franks and subsequently became part of the Holy Roman Empire. Alsace first became part of France during the Thirty Years War to prevent its capture by the Spanish Hapsburgs. Shortly after that the famous military engineer Vauban built the fortress city of Neuf-Brisach which even today retains the defensive fortifications largely intact.

Cimetière des Chasseurs at the Col du Wettstein near Munster

First World War Cimetière des Chasseurs at the Col du Wettstein near Munster

In more recent times control of the area has switched between France and Germany. Following the Franco-Prussian war of 1870 control of the region passed to Germany and stayed that way until 1918. During the First World War the front lines passed through Alsace-Lorraine and the Voseges mountains which formed the border saw fighting throughout the war.

Memorial to the French Second Armoured Division in Badonviller

Memorial to the French Second Armoured Division in Badonviller



The Vosges saw fierce fighting again in 1945 when Operation North Wind, the last major German offensive in the West, attempted to recapture Alsace. It was eventually repulsed and culminated in the Battle of the Colmar Pocket which finally drove the German Army out of France. It was the fourth time in 75 years that Alsace had changed hands between France and Germany.

Old houses in Kayserberg, Alsace

Old houses in Kayserberg, Alsace

Because of this turbulent history there is a very different feel to the villages, towns and cities on opposite sides of the Vosges. The Lorraine side is very French whereas the Alsace side feels more like the Black Forest area of Germany. This is especially true of villages like Kayserberg that have seen little development in recent years and still have many old timber framed buildings that gives them a medieval atmosphere. Even a city like Colmar which has modern developments on the outskirts has an old centre which is more like Freiburg in Germany rather than Metz or Nancy in Lorraine.

General notes

A couple of points for motoring enthusiasts:

Restored pit complex on the Reims-Geaux circuit.

Restored pit complex on the Reims-Geaux circuit.

Between 1926 and 1972 the Reims-Geaux racing circuit hosted Formula 1 grand prix and sports car races. It was a classic road circuit and the old pit complex which lies on the D27 is being restored by a local group If you do stop overnight at Reims then a quick visit to the start-finish straight is well worthwhile.

The famous Collection Schlumpf automotive museum can be found in Mulhouse. This is the biggest museum of its type in the world and well worth a visit for any petrol head.

Quite often the tops of the mountains are clear while the Rhine valley to the east is completely shrouded in mist with only the highest peaks of the Black Forest in Germany visible in the distance. When the atmospheric conditions are really clear then, 100 miles to the south east, the peaks of the Alps are easily visible.

View of the Alps from the summit of the Hohneck

View of the Alps from the summit of the Hohneck

We found the IGN TOP 25 / Carte de Randonee maps to be excellent. They are the French equivalent of the OS Explorer 1:25000 series. In addition all the towns and most villages will have a tourist office which supply local information and maps for walking, mountain biking, cross country skiing etc. In most cases these are free.

Posted in Travel, Vosges | Leave a comment

Book Review – Football Clichés

51ai3glzb1l-_sx320_bo1204203200_It’s a funny old game, usually of two halves unless extra time is looming and then maybe followed by the lottery of the penalty shoot out.

We’re all familiar with the clichés spouted weekly by football pundits either on TV, radio or the internet. Adam Hurrey has gone a step further and painstakingly documented them together with handy flowcharts for scenarios like player transfers. Personally I wouldn’t have thought that it was possible to fill 200 pages on the subject but every page brought at least one smile.

So if you want to know what defenders really fear¹, what slams shut twice a year² or what a manager must never lose³ then this is the book for you.

¹Pace ( or maybe real pace )
²The transfer window
³The dressing room

Updated 9/6/17 – As it’s the end of the season I’m reminded of a great Guardian article by Adam Hurrey:

Posted in Book Review | Leave a comment

Shell Script Pomodoro Timer

If I have difficulty concentrating on a task I find the Pomodoro Technique very useful. When I was a manager or developer on software projects then it was too easy to get distracted by things like email or other discussions. With the Pomodoro Technique I could cleanly partition my work, for example, do three Pomodoros working on a project followed by one for email, one for phone calls etc.

On a Windows PC I found Tomighty to be quite effective but unfortunately there isn’t a Linux version. There are plenty of web based ones available but all the native Linux versions I found seemed to need either Java or libraries that I didn’t have installed. So I did what any self respecting engineer would do and I wrote my own 🙂

I did think of making it purely command line shell based but I find it more useful to have a small window on screen showing the time remaining etc. rather than having to use a terminal window. After some deliberation I implemented the basic control in a shell script and used Zenity to provide the user interaction. To use the script you may need to install Zentity, depending on your distro.

The code is available on GitHub ( ) and is largely self explanatory but the following may be useful to note:

1. There are a number of default values at the start of the script. The time intervals for the Pomodoros are those defined by the Pomodoro Technique website but feel free to modify as necessary. The whole script is a bit Ubuntu-centric where the notification sound is concerned but it’s a simple matter to change the appropriate line if necessary.

2. The script simply asks the user for the number of Pomodoros then steps through each one displaying the various countdowns as necessary. The user can abort the whole process at any time but there’s currently no way of handling any interruptions to a particular Pomodoro.

3. The Zenity commands are all explained in the manual. The only one that’s slightly convoluted is the display of the progress bar:

progressbarThe key here are the following lines from the “Process Dialog” manual page:

“Zenity reads data from standard input line by line. If a line is prefixed with #, the text is updated with the text on that line. If a line contains only a number, the percentage is updated with that number.”

The countdown is done in the countdown() function and the dialog is updated using the following lines:

printf "# Time remaining: %d:%02d\n" $(( t/60 )) $(( t % 60 ));
echo "$(( ( ( TIME - t ) * 100 ) / TIME ))";
( Note the # in the printf line )

launcherThe GitHub repository contains a “.desktop” file which can be dragged onto the Ubuntu Launcher to create a shortcut complete with a suitable icon. For Ubuntu Mate then right click on the desktop and select “Create Launcher …” then add the various details and a launcher complete with icon will appear on the desktop.

I’ve used this off and on for over a year now and it works fine for me. I’ve never needed the “interruptions” handling but it should be fairly easy to add a feature to log any Pomodoros that have been interrupted and report these at the end.

Posted in FOSS, Pomodoro Timer | Leave a comment

Photogrammetry with Free & Open Source Software ( FOSS )

Wikipedia defines photogrammetry as

“… the science of making measurements from photographs, especially for recovering the exact positions of surface points.” If you can recover enough of the surface points then it’s perfectly possible to recreate a complete 3D model of an object from 2D photographs.

( I first got interested in 3D scanning some years ago when I managed a project to develop some software to map and record human body shapes using a ( then quite expensive ) scanner made by a company called TC2.

The project was health related – It’s an interesting idea with lots of health benefits which unfortunately still hasn’t really got into widespread use. I think that’s mainly due to the problem of scanning a human body – you can have any two of quick, cheap and accurate 🙂 )

Today there’s a slightly overwhelming variety of photogrammetry software options available and this post is a summary of the analysis that I went through when trying to select a suitable FOSS toolset to experiment with. I started with the following criteria to assess each option:

Must haves:

  1. Sensible build / install process. Ideally I should be able to fork a GitHub repository and build the software on any recent Linux distribution with any other dependencies able to be installed via standard packages. Life is too short for messing around with complex build processes and arcane library requirements.
  2. Good results / easy setup. It needs to work reasonably well with images taken with my point & shoot camera and without having to fiddle with parameters for every scan.
  3. FOSS. It needs to be FOSS and have no restrictions on the program’s use or on the use of the 3D models generated by the software.

Nice to have:

  1. GUI. A GUI sometimes makes getting started a bit easier but I’m also quite happy with command line tools especially if they can be wrapped in a shell script.
  2. Programming language. It would good to contribute something back to the project so ideally it would be written in a language that I’m familiar with. I don’t mind learning a new programming language but it’s time that could be better spent on other things.

I looked at the following options:

Python Photogrammetry Toolbox & PPT-GUI

The scope of the Python Photogrammetry Toolbox and associated tools seems to have evolved over the years and so is not the easiest thing to define. The simplest way that I found to try it was using the Archeos distribution. This installed fine on an old laptop that I had lying around and also on VirtualBox.

( I did briefly try installing the software on my normal Ubuntu based machine and it mostly worked. There were some problems with paths which would probably been fixable had I spent more time on it )

It runs fine and the GUI is easy to use. The only minor but annoying quirk is that it writes the output files to the /tmp/… directory which gets cleared on a reboot. You have to remember to copy the files to somewhere more sensible before exiting. As the name suggests it’s written in Python, it’s fully FOSS and there are no restrictions on the use of the models.

Archeos is based on Debian and also comes with many other related applications already installed. The team behind Archeos also have an interesting blog

openMVG & MVE

OpenMVG is

“ … a library for computer-vision scientists and especially targeted to the Multiple View Geometry community. It is designed to provide an easy access to the classical problem solvers in Multiple View Geometry and solve them accurately.”

openMVG doesn’t contain a module for generating dense reconstructions directly but the documentation suggests a few possibilities. I started to experiment with MVE and found it to be easy to use1

Both of these are written in C/C++ and are FOSS. I was able to clone and build from GitHub with no dramas other than installing a few extra packages.

There’s no GUI2,3 but it’s easy to put the commands into a shell script and run them that way. The outputs looked fine and I got good results fairly quickly from the models that I tried.

1It’s possible that MVE may do the whole job itself but I haven’t fully explored this yet

2There is a build of openMVG available with a GUI – However this seems to be a fork of openMVG and currently some way behind the original source. There’s a video tutorial using this GUI and it seems that it’s a way of selecting the command line options for the various tools, running them and displaying the output. For me that’s no real advantage over a shell script.

3MVE does contain a GUI for parts of the process but I haven’t investigated in any detail. See MVE build instructions for details.


Regard3D is essentially a GUI wrapper around several third party photogrammetry tools including openMVG and MVE. There are Windows, Linux and OSX versions but only the Windows and OSX versions have installers.

I tried the Windows version and it installed and ran fine. The GUI was easy to use and a useful guide to the options available to the various tools.

However I failed to get the Linux version to build despite spending a reasonable time trying. The main problems were with library versions, especially openCV.

The other drawback is that Regard3D uses a modified version of openMVG which means that there’s inevitably a delay in getting the latest version filtered through and it makes contributing changes back to openMVG more difficult.


I didn’t do any detailed tests on this one because it seems to be more aimed at aerial photography but I included it for completeness.

The GitHub pa describes it as:

OpenDroneMap is a tool to postprocess drone, balloon, kite, and street view data to geographic data including orthophotos, point clouds, & textured mesh. In the tradition of the Ship of Theseus, it was originally forked from qwesda/BundlerTools

I think that it’s command line based and written in Python.

Other Options

I also looked at a couple of other possibilities which didn’t quite meet the criteria above:


VisualFSM has Windows, Linux and OSX versions and is “free for personal, non-profit or academic use”. The Windows version installs and runs OK although my results were not as good as those with openMVG/MVE

Unfortunately the Linux install instructions were lengthy, possibly out of date now and I failed to get them to work.

Online services

There are a number of online photogrammetry services, some are free as in beer, some are paid for, the Wikipedia page referenced below lists a few of these.

I have previously tried Autodesk’s free offering – 123D Catch. It worked reasonably well but gave no control over how the images were interpreted. However I notice that there are now mobile device apps as well – it was web only when I tried. These may offer more control.

Another drawback with these services is the licencing of the scans. For 123D Catch the scans remain your property but you give Autodesk:

“ … a world-wide, royalty-free, fully paid-up, perpetual, non-exclusive, transferable, and fully sublicensable (through multiple tiers) right and license (but not the obligation) to reproduce, distribute, redistribute, modify, translate, adapt, prepare derivative works of, display, perform (each publicly or otherwise) and otherwise use all or part of Your Content, by any and all means and through any media and formats now known or hereafter discovered”

I suspect the other services have similar terms. Of course there is also the possibility that any free services may be discontinued or may have to be paid for at some point in the future.


For me the obvious solution was openMVG/MVE. They’re completely open source, build easily and provide good outputs with minimum configuration changes. There’s no GUI but, to be honest, it was trivial to write some shell scripts to manage the whole process.
In a future post I’ll document how I built these tools and how I set up the directories and shell scripts to manage the model creation process.

For now here are two sceenshots of a stone figure on my neighbour’s wall ( original photographs taken with my Canon IXUS 70 point & shoot camera )

Other Notes

Wikipedia also has a long list of photogrammetry software but this includes some very expensive commercial offerings. There’s an older ( 2015 ) summary of the cheap / free options here –

Posted in FOSS, Photogrammetry | Leave a comment