Fusion Technology with Enfuse, Hugin and my batch files.

For the following article, and because i am in the process of scripting and testing, i will need to come back on it for further updates and adjustments.
When its whole enough to make a page in the workshop section, i will add a page for it with all the information and codes to that point.
Today its just a new post.
I while ago i posted the article “Fusion Technology” http://www.digicrea.be/fusion-technology/
I wrote a simple batch file for it, and made it downloadabe in my downloads section.
Today, a lot of testing and reading later, I feel the need to go deeper in on the subject, and try to make some usable an interesting scripts or batch files you can use or further developing in your own way.
My starting point today are some readings i have done on Pat Davids website about the subject.
More particular I am refering to the folowing articles :
Automatic Exposure Blending with Enfuse (HDR-ish) – http://blog.patdavid.net/2013/07/automatic-exposure-blending-with-enfuse.html
and :
Focus Stacking Macro Photos (Enfuse)
Here I found some interesting command line examples. Many thanks to Pat David and his great articles !
I also tried testing with EnfuseGUI, but got an error message : “invalid enfuse version found. Enfusegui requires Enfuse version 4 or later”
A search on Google lead me to a page on Flickr where sugestions where made with different name giving etc.
-> none had positive result

Another one mentioned a download from Windows ( Microsoft Visual C++ 2008 Redistributable Package (x86) )
-> before messing with my windows system, I tried sending a call for support to the developer from EnfuseGUI, I am waiting for answer, and possible I am coming back on this later.
But for now i am re-writing the command line examples of Pat David for easier use, so anyone can easily insert them in their own workflow.
First, the alignment problem.
For aligning the program Hugin is used, in particular the align_image_stack module.
If you don’t already have Hugin installed, you can find it @ http://hugin.sourceforge.net/download/
Be aware that the latest version ( 2014.0.0 at the time of writing this ) works only on Windows Vista and up, if you are stil using Windows XP, you need to look for Hugin 2013.0.
The latest version is available in a few flavors, namely 32/64 bit versions, an installer version, a 7zip format etc.
I prefer the portable version ( also the same as the 7zip version ),
and this is also the version i am goin to use in the folowing script examples.
Don’t worry, my scripts are supposed to work with both ( if not all ) versions.

Let’s get started !
the used command line is : C:\Program Files\Hugin\bin\align_image_stack -m -a OUT FILE1 FILE2 FILE3
the explanation for the switches -m and -a is to be found at Pat’s site, i am not going further into his command line examples, only when i make my own adjustments to it, i will explain them thoroughly.
For easy use we’re making a batch file as following :
Open notepad and save a .bat file in the Hugin\bin folder – i would suggest to name it “align images.bat” ( change the .txt extention to .bat when saving )
Now open this file and insert the following text code :

TITLE Hugin Align Images – set working folder
color 2E
@echo off
ECHO º º
ECHO º Hugin Align Images º
ECHO º ——————– º
ECHO º º
ECHO º 1. Set working folder º
ECHO º º
ECHO º Ex. C:\Pictures\IN\ º
ECHO º or copy\paste them into º
ECHO º º
ECHO º 2. Run align_image_stack.exe º
ECHO º º
ECHO º º
ECHO º º
ECHO º Q. Quit º
ECHO º º

set /p Choice=Enter: 1,2,3,.. or Q to Quit –

if [%Choice%]==[1] goto working_folder
if [%Choice%]==[2] goto align_image_stack
if [%Choice%]==[q] goto end
if [%Choice%]==[Q] goto end
For %%a in (1,2,3,..9,q,Q) do if not [%Choice%]==[%%a] goto end

@echo off

set /p input=Enter or copy paste working folder path:
goto set_folder_menu

TITLE Hugin Align Images – Run align_image_stack
color 2E
@echo off
align_image_stack -m -a %input%\OUT %input%\*.tif

This is an actual screen print of the batch file, here it looks different due to my site text formatting :


To use this batch file ( which would be Hugin\bin\align images.bat ) double click it
press one to set the working folder ( where your images are )
then type the path of the images you want to use ( like c:\pictures\test )
or navigate with your Windows explorer to them, and copy the path in the adres task bar ( left click in the adres bar and copy adres by right click – or right click in adres bar and copy )

these screenprints are from a Dutch computer, but they would look the same on an English one ( copy adres – copy )

copy_adres copy_path




-> then past it in the bat command file by right click and paste.







-> then run the script by pressing two

As you can see, i have adjusted the original command line from Pat David a bit.
i have added an interactive menu where you can easily pre-set the working path of your pictures, and I have added the same entry path as output path – i find that much easier to locate the altered pictures afterwards – everything in the same place.
You can make a shortcut to the align images.bat on your desktop, and then its easy to do this job.

This is enough for today,
if you want, you can download my example align images.bat @ http://www.digicrea.be/downloads/my-downloads/
See you next episode

Leave a Reply

Your email address will not be published. Required fields are marked *