As the title says, this converts a HDR image into LDR image.
Please site this work if you are using this code. 'Naman Bansal and Shanmuganathan Raman, "Regularized Tone Mapping Using Edge Preserving Filters", (Oral) In 21st National Conference on Communications (NCC), IIT Bombay, Feb. 27 - Mar. 1, 2015.'
Also, I'm refering wlsfilter provided by 'Edge-Preserving Decompositions for Multi-Scale Tone and Detail Manipulation", ACM Transactions on Graphics, 27(3), August 2008.'(http://www.cs.huji.ac.il/~danix/epd/wlsFilter.m)
Also, you need to install HDR_Toolbox as provided by Francesco Banterle (https://github.com/banterle/HDR_Toolbox)