-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathexactGradientModel.m
29 lines (26 loc) · 1.02 KB
/
exactGradientModel.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
28
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function lum = exactGradientModel(a, b, f, up, vp, vh)
% Synthesizes the sky gradient part only.
%
% Input parameters:
% - a, b: 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
%
% Output parameters:
% - lum: luminance map in image coordinates (same dimensions as up and vp)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function lum = exactGradientModel(a, b, f, up, vp, theta)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright 2006-2009 Jean-Francois Lalonde
% Carnegie Mellon University
% Do not distribute
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% convert to camera parameters
% thetac = pi/2+atan2(vh, f);
thetap = pixelZenithAngle(theta, f, up, vp);
% plug in Perez sky model
lum = perezGradientModel(a, b, thetap);