Skip to content

Instantly share code, notes, and snippets.

@danielronnkvist
Last active August 29, 2015 14:10
Show Gist options
  • Save danielronnkvist/4db1c523ef0df1378c23 to your computer and use it in GitHub Desktop.
Save danielronnkvist/4db1c523ef0df1378c23 to your computer and use it in GitHub Desktop.
makeHDR
tic
clear all
load('gfun.mat');
ffun= (2.^gfun);
finalpic(:,:,:) = zeros(683,1024,3);
for i=1:14
value = imread(strcat('Img', int2str(i), '.tiff'));
if value > 127
value = 255-value;
end
irValue = ffun(value+1)/(2*i);
finalpic = imadd(finalpic,irValue.*(double(value)/255));
end
%tonemap and show the result
figure
imshow(tonemap(finalpic));
toc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment