Tone Mapping with Enfuse

The previous article was about producing an image free of noise, now we can apply a tone mapping [1]. I’m going to use Enfuse to generate a natural HDR/LDR image.



Due to the nature of the image produced by the Noise Suppression technique, we can generate over-exposed images (1EV 2EV 3EV 4EV) without any quality issues. Then we are going to feed the resultant images (with a gamma 2.2 applied) to Enfuse.

convert ${min_ev_name}_fon.tiff -alpha off -gamma 2.2 ${min_ev_name}_tone_a.tiff
letters=( a b c d e f g h i j k l m n o p q r s t u v w x y z )
counter=1
while true; do
  exp=`echo "2^${counter}" | bc`
  if [ "${exp}" -gt "${max_exp}" ]; then
     break
  fi
  convert ${min_ev_name}_fon.tiff -alpha off -evaluate multiply ${exp} -gamma 2.2 ${min_ev_name}_tone_${letters[${counter}]}.tiff
  let counter=${counter}+1
done
convert ${min_ev_name}_fon.tiff -alpha off -evaluate multiply ${max_exp} -gamma 2.2 ${min_ev_name}_tone_${letters[${counter}]}.tiff
tone_files=`ls ${min_ev_name}_tone_*.tiff`
enfuse -v -o ${min_ev_name}_tm.tiff ${tone_files}



Enfuse generates internally the following merging masks.



Finally Enfuse produces a natural looking image.



Additionally we can process the image a little bit further by applying contrast and saturation to the HDR/LDR image. I’m using a sigmoidal contrast curve of 2×50% and a 30% increase of saturation.

convert ${min_ev_name}_tm.tiff -sigmoidal-contrast 2x50% -modulate 100,130,100 ${min_ev_name}_final.tiff




[1] Guillermo Lujik – HDR TONE MAPPING

Advertisements

~ by cedricbompart on December 1, 2009.