PPaste!

Focus Stacking

Home - All the pastes - Authored by Thooms

Raw version

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#! /bin/bash

# lire http://www.lenaturaliste.net/portail/articles-des-membres/5-techniques-diverses/61-focus-stacking-en-ligne-de-commande-sous-gnulinux

IFORMAT=jpg

# sudo apt-get install imagemagick
echo "Conversion JPEG -> TIFF, correction flat field et netteté"
find *.$IFORMAT -execdir convert {} -unsharp 0x20 {}.tif \;

# sudo apt-get install hugin-tools
echo "Alignement des images à empiler"
align_image_stack -m -a zframe_ *.$IFORMAT.tif

# sudo apt-get install enfuse
echo "Empilement des images (focus stacking)"
enfuse -o output.tif \
  --exposure-weight=0 \
  --saturation-weight=0 \
  --contrast-weight=1 \
  --hard-mask \
  --contrast-window-size=9 zframe_*.tif