-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathexactSkyModelRatio.m
27 lines (26 loc) · 1.22 KB
/
exactSkyModelRatio.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function ratio = exactSkyModelRatio(a, b, c, d, e, f, up, vp, vh, lz, phi, phiSun, thetaSun)
% Synthesizes the full sky model, based on ratios of luminances
%
% Input parameters:
% - a, b, c, d, e: Perez sky model parameters
% - f: camera focal length (in pixels)
% - up: x-coordinates of pixels in image
% - vp: y-coordinates of pixels in image
% - theta: camera zenith angle
% - lz: zenith luminance
% - phi: camera azimuth angle (in radians)
% - phiSun: sun azimuth angle (in radians)
% - thetaSun: sun zenith angle (in radians)
%
% Output parameters:
% - ratio: ratio of luminances (with respect to zenith)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function ratio = exactSkyModelRatio(a, b, c, d, e, f, up, vp, lz, theta, phi, phiSun, thetaSun)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright 2006-2009 Jean-Francois Lalonde
% Carnegie Mellon University
% Do not distribute
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ratio = lz .* exactSkyModel(a, b, c, d, e, f, up, vp, theta, phi, phiSun, thetaSun) ./ perezSkyModel(a, b, c, d, e, 0, thetaSun);