-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathViewLightField.m
45 lines (36 loc) · 1.04 KB
/
ViewLightField.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2015.05.14 Jaesik Park
% 2017.10.15 Vincent Qin revised
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function fn_ViewLightField
% input : 5D light field image structure (t,s,y,x,ch), single type pixel intensities.
function ViewLightField(LF)
fprintf('ViewLightField...');
ns = size(LF,1);
nt = size(LF,2);
h = size(LF,3);
w = size(LF,4);
% keyboard;
bigimg = zeros(h*nt,w*ns,3);
% cnt=1;
for t=1:nt
ts = (t-1)*h+1;
te = t*h;
for s=1:ns
ss = (s-1)*w+1;
se = s*w;
img = squeeze(LF(t,s,:,:,:));
% bigimg(ts:te,ss:se,:) = img;
bigimg(ts:te,ss:se,1) = img(:,:,1);
bigimg(ts:te,ss:se,2) = img(:,:,2);
bigimg(ts:te,ss:se,3) = img(:,:,3);
% cnt = cnt + 1;
figure(1); imshow(img);
title(sprintf('s : %d, t : %d',s,t));
pause(0.05);
end
end
% bigimg = imresize(bigimg);
figure; imshow(bigimg);
imwrite(bigimg,'bigimg.jpg','jpg');
fprintf('done.\n');