Quotient of Gaussian

Here the quotient of the results of correlating the image with Gaussian filters of different size is computed.  The Quotient of Gaussian can be used for tone mapping of high dynamic range images.

#!/usr/bin/env ruby
require 'hornetseye'
raise "Syntax: q_o_g.rb <input file> <output file>" if ARGV.size != 2
img = Hornetseye::MultiArray.load_sfloatrgb ARGV[0]
qog = img.gauss_blur( 0.5 ) / ( img.gauss_blur( 2.0 ) + img.max * 0.01 )
qog.normalise.save_ubytergb ARGV[1]
Close