focus stacking tool with Hugin

939 views
Skip to first unread message

Matou Rameur

unread,
Jul 7, 2021, 2:50:22 PM7/7/21
to hugin and other free panoramic software
Hello all,

Happy user of Hugin I only used it for making lanscape images and I liked it. I recently began using it for focus stacking. I might have been wrong somewhere but I was not so happ : the resulting images were quite blurred. It looked like the "optimal" image in the stack was not the only one used at any point.
I finally decided to use the Tiff, multilayered output of Hugin to feed a simple program that computes an estimation of the sharpness of each image, and takes the best one at any point. The local sharpness is estimated by a Haar transformation.

I put here a reduced copies of the first image of a sample stack, and the result.

If this program is of interest for Hugin, I can give its source code to the communauty. Just tell me. Again, I admit I did not dig into the way I used Hugin, so my opinion is far from being definitive, and I do not blame anyone, nor anything.

Best regards,

Michel Guitel (France)
dse23002-p.JPG
dse23002 - dse23010-p.png

dkloi

unread,
Jul 7, 2021, 6:19:01 PM7/7/21
to hugin and other free panoramic software
Hi Michel,

You may want to look at https://patdavid.net/2013/01/focus-stacking-macro-photos-enfuse/ Enfuse is normally used for exposure blending https://patdavid.net/2013/07/automatic-exposure-blending-with-enfuse/ but can do exposure stacking as well. There is a standalone enfuse/enblend package http://enblend.sourceforge.net/ but it is also included as part of Hugin

Daniel

Harry van der Wolf

unread,
Jul 8, 2021, 2:59:27 AM7/8/21
to hugi...@googlegroups.com


Op do 8 jul. 2021 om 00:19 schreef 'dkloi' via hugin and other free panoramic software <hugi...@googlegroups.com>:
Hi Michel,

You may want to look at https://patdavid.net/2013/01/focus-stacking-macro-photos-enfuse/ Enfuse is normally used for exposure blending https://patdavid.net/2013/07/automatic-exposure-blending-with-enfuse/ but can do exposure stacking as well. There is a standalone enfuse/enblend package http://enblend.sourceforge.net/ but it is also included as part of Hugin

Daniel

There is no standalone package. The link you are referring to contains the source code. It allows you to build a standalone version of enblend/enfuse. 

Lux (previously called PV) can also do focus-stacking.

If your software can do the same then please share it. If it can do that even better: great!. 
We can all learn from each other and software that does something better, or faster at same quality, than other software is always welcome.


Harry

dkloi

unread,
Jul 8, 2021, 4:41:55 AM7/8/21
to hugin and other free panoramic software
There are precompiled Windows executables on Sourceforge in the zip files.

New tools are always welcome, you may want to look at Enfuse as a starting point for improving its performance.

Matou Rameur

unread,
Jul 12, 2021, 12:20:16 PM7/12/21
to hugin and other free panoramic software
Hello all,
I attach the source files and Makefile for focus_stacking_fusion. Feel free to re-use it if it suits your needs.I put CImg.h file in it. It also requires libpng.
Put everything in a directory, compile with make and launch ./focus_stacking_fusion -h to get a brief explanation of its usage.
I compile and use it on Ubuntu 20.04.
I do not pretend it is better than enfuse. I was only unhappy with enfuse default parameters as set by Hugin. I agree with you when you write that I could go further with enfuse and try getting better results with it.
focus_stacking_fusion.tgz

T. Modes

unread,
Jul 13, 2021, 1:48:01 PM7/13/21
to hugin and other free panoramic software
matou....@gmail.com schrieb am Montag, 12. Juli 2021 um 18:20:16 UTC+2:
I was only unhappy with enfuse default parameters as set by Hugin. I agree with you when you write that I could go further with enfuse and try getting better results with it.

In the enfuse manual there is a complete section devoted to focus stacking which explains which parameters to use and how to fine-tune them: http://enblend.sourceforge.net/enfuse.doc/enfuse_4.2.xhtml/enfuse.html#sec%3Afocus-stacks--depth-of-field-increase
Maybe this helps you to get better results.

It is also possible to create an user defined output sequence to automate this. I already added a general focus stacking output sequence to the default branch of Hugin, so this should now be easier to start.

Thomas

Stanley Green

unread,
Jul 14, 2021, 4:51:29 AM7/14/21
to hugi...@googlegroups.com
Hugin.docx

David W. Jones

unread,
Jul 14, 2021, 5:57:21 AM7/14/21
to hugi...@googlegroups.com
On July 13, 2021 10:51:04 PM HST, 'Stanley Green' via hugin and other free panoramic software <hugi...@googlegroups.com> wrote:


And this is what? Perhaps an infected Word document?

--
David W. Jones
gnome...@gmail.com
wandering the landscape of god
http://dancingtreefrog.com

Sent from my Android device with F/LOSS K-9 Mail.

Matou Rameur

unread,
Jul 17, 2021, 2:12:08 PM7/17/21
to hugi...@googlegroups.com
Thank you for these informations. Now, I must read and I should know how to better use the existing tools.

Thank you again, the first reading is not enough !

Michel.

--
A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ
---
You received this message because you are subscribed to a topic in the Google Groups "hugin and other free panoramic software" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hugin-ptx/aLog319T1gI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hugin-ptx+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hugin-ptx/9fbda610-04c1-4da7-b7e0-c84212e70469n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages