Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
QIS_HDR_TCI20/LDR_reconstruction.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
32 lines (30 sloc)
1.2 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function out = LDR_reconstruction(im,sigmaRN,T,B,denoise) | |
% Authors : Abhiram Gnanasambandam (agnanasa@purdue.edu), | |
%Stanley H. Chan (stanchan@purdue.edu) | |
%Intelligent Imaging Lab, Dept. of ECE, Purdue University | |
% Reference: | |
%[1]HDR Imaging with Quanta Image Sensors: Theoretical Limits and Optimal | |
%Reconstruction, Abhiram Gnanasambandam and Stanley H. Chan, | |
%IEEE Transactions on Computational Imaging, 2020 | |
%[2]High Dynamic Range Imaging using Quanta Image Sensors, Abhiram | |
%Gnansambandam, Jiaju Ma, Stanley H. Chan, IISW 2019. | |
% This function reconstructs LDR QIS images | |
%im - Noisy sum of static QIS data | |
%sigmaRN - Read noise of the sensor | |
% T - Number of frames summer to get T | |
% B - Non-linear mapping corresponding to q-bit QIS. | |
% denoise - use BM3D denoiser if denoise = 1. | |
addpath('utils/denoisers') | |
if denoise == 1 | |
im = 2 * sqrt(im + 3/8 + T * sigmaRN^2); | |
maxi = max(im(:)); | |
mini = min(im(:)); | |
im = (im - mini)/(maxi-mini); | |
im = wrapper_BM3D(im,1/(maxi-mini))*(maxi-mini) + mini ; | |
im = (im/2).^2 - 1/8 - T * sigmaRN^2; | |
im(im<0) = 0; | |
im(im>max(im(:))) = max(im(:)); | |
end | |
im = im/T; | |
out = B(im); | |
end |