hdrvdp_rod_sens.m 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. function S = hdrvdp_rod_sens( la, metric_par )
  2. % Copyright (c) 2011, Rafal Mantiuk <mantiuk@gmail.com>
  3. % Permission to use, copy, modify, and/or distribute this software for any
  4. % purpose with or without fee is hereby granted, provided that the above
  5. % copyright notice and this permission notice appear in all copies.
  6. %
  7. % THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  8. % WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  9. % MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  10. % ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  11. % WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  12. % ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  13. % OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  14. S = zeros( size( la ) );
  15. peak_l = metric_par.csf_sr_par(1);
  16. low_s = metric_par.csf_sr_par(2);
  17. low_exp = metric_par.csf_sr_par(3);
  18. high_s = metric_par.csf_sr_par(4);
  19. high_exp = metric_par.csf_sr_par(5);
  20. rod_sens = metric_par.csf_sr_par(6);
  21. ss = la>peak_l;
  22. S(ss) = exp( -abs(log10(la(ss)/peak_l)).^high_exp/high_s );
  23. S(~ss) = exp( -abs(log10(la(~ss)/peak_l)).^low_exp/low_s );
  24. S = S * 10.^rod_sens; %TODO: check if this is really needed
  25. end