Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
RenderToolbox4
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chenhao Ma
RenderToolbox4
Commits
0baf527b
Commit
0baf527b
authored
7 years ago
by
Henryk Blasinski
Browse files
Options
Downloads
Patches
Plain Diff
Added missing files.
parent
82e9cadb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ExampleScenes/GcloudRenderer/BuildOI.m
+51
-0
51 additions, 0 deletions
ExampleScenes/GcloudRenderer/BuildOI.m
with
51 additions
and
0 deletions
ExampleScenes/GcloudRenderer/BuildOI.m
0 → 100644
+
51
−
0
View file @
0baf527b
% Build and ISET Optical Image.
% @param photons h x w x 31 multi-spectral radiance matrix
% @param depthMap h x w depth matrix
% @param oiParams struct of extra optical image params
function
oi
=
BuildOI
(
photons
,
depthMap
,
oiParams
)
%% New optical image with photon and depth data.
oi
=
oiCreate
;
oi
=
initDefaultSpectrum
(
oi
);
oi
=
oiSet
(
oi
,
'depthmap'
,
depthMap
);
% need to truncate and scale photon data for some reason?
oi
=
oiSet
(
oi
,
'photons'
,
single
(
photons
));
%% Transfer various lens parameters to optical image.
if
strcmp
(
oiParams
.
lensType
,
'realisticDiffraction'
)
oi
=
oiSet
(
oi
,
'optics name'
,
oiParams
.
specFile
);
oi
=
oiSet
(
oi
,
'optics fnumber'
,
oiParams
.
filmDistance
/
oiParams
.
apertureDiameter
);
elseif
strcmp
(
oiParams
.
lensType
,
'PinholeLens'
)
% TODO: What are the real names for this in PBRT?
% Pinholes have no real aperture size. So, we set the f-number
% really big.
oi
=
oiSet
(
oi
,
'optics name'
,
'pinhole'
);
oi
=
oiSet
(
oi
,
'optics fnumber'
,
999
);
elseif
strcmp
(
oiParams
.
lensType
,
'IdealLens'
)
% TODO: What are the real names for this in PBRT?
% This case is a diffraction limited lens but with an aperture of a
% real size.
oi
=
oiSet
(
oi
,
'optics name'
,
'diffraction limited'
);
oi
=
oiSet
(
oi
,
'optics fnumber'
,
oiParams
.
filmDistance
/
oiParams
.
apertureDiameter
);
else
fprintf
(
'Could not find lens type in hints! Setting arbitrary values.\n'
)
% TODO: What sort of arbitrary values should go here?
end
oi
=
oiSet
(
oi
,
'optics focal length'
,
oiParams
.
filmDistance
*
1e-3
);
% Compute the horizontal field of view
x
=
size
(
photons
,
1
);
y
=
size
(
photons
,
2
);
d
=
sqrt
(
x
^
2
+
y
^
2
);
% Number of samples along the diagonal
fwidth
=
(
oiParams
.
filmDiag
/
d
)
*
x
;
% Diagonal size by d gives us mm per step
% multiplying by x gives us the horizontal mm
% Calculate angle in degrees
fov
=
2
*
atan2d
(
fwidth
/
2
,
oiParams
.
filmDistance
);
% Store the horizontal field of view in degrees in the oi
oi
=
oiSet
(
oi
,
'fov'
,
fov
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment