forked from jflalonde/skyModel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
exactSkyModel.m
28 lines (26 loc) · 1.19 KB
/
exactSkyModel.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 lum = exactSkyModel(a, b, c, d, e, f, up, vp, vh, phi, phiSun, thetaSun)
% Synthesizes the full sky model.
%
% 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
% - vh: horizon line (0 = center of image)
% - phi: camera azimuth angle (in radians)
% - phiSun: sun azimuth angle (in radians)
% - thetaSun: sun zenith angle (in radians)
%
% Output parameters:
% - lum: luminance map in image coordinates (same dimensions as up and up)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function lum = exactSkyModel(a, b, c, d, e, f, up, vp, vh, phi, phiSun, thetaSun)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright 2006-2009 Jean-Francois Lalonde
% Carnegie Mellon University
% Do not distribute
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% produce of sun and gradient luminance
lum = exactGradientModel(a, b, f, up, vp, vh) .* exactSunModel(c, d, e, f, up, vp, vh, phi, phiSun, thetaSun);