HDR blending not working with 16 bit images
1 view (last 30 days)
Show older comments
I'm using the camresponse function and the makehdr function to blend few images and create a radiance map. I have no problem using 8 bits images, everything works fine. But if I use the same images but encoded with 16 bits, I get really bad results, as you can see in the following images. Using that crf with mkhdr results in a really bad quality hdr image.
The images are converted to 8 bit and 16 bit png from the original RAW file.
Any help? Is this function supposed to work with images with more than 8 bits? I guess so looking at camresponse.m but still I have these problems.
3 Comments
Answers (1)
Vinai Datta Thatiparthi
on 11 Nov 2019
Hey!
I believe that this is expected behavior of the commands makehdr and camresponse. 8 bit images generally produce smoother camresponse curves since the intensity range is narrower as compared to 16 bit images.
As a workaround to obtaining a more accurate looking curve, considering using a higher sampling interval to narrow down the “crf” result.
% Increasing sampling interval
crfNew = crf(1:200:65536,:);
range = 0:length(crfNew)-1;
% Response function plots for every channel
figure(2); hold on;
if(size(crf,2) == 3)
% RGB Image
plot(crfNew(:,1),range,'r','LineWidth',2);
plot(crfNew(:,2),range,'g','LineWidth',2);
plot(crfNew(:,3),range,'b','LineWidth',2);
legend('R-component','G-component','B-component','Location','southeast');
else
% Grayscale Image
plot(crf(:,1),range,'-k','LineWidth',2);
end
Hope this helps!
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!