-
Notifications
You must be signed in to change notification settings - Fork 27
/
showResults.m
53 lines (48 loc) · 1.52 KB
/
showResults.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
46
47
48
49
50
51
52
%% void showResults(matrix,matrix,matrix,matrix,int,int,int)
% I - Input sequence
% L - Low-rank sequence
% S - Sparse sequence
% O - Outliers sequence
% nFrame - Number of frames
% vidHeight - Video height
% vidWidth - Video width
%
function [] = showResults(I,L,S,O,nFrame,vidHeight,vidWidth)
warning('off','all');
for i = 1:nFrame
Input = reshape(I(:,i),vidHeight,vidWidth);
%Input = uint8(Input);
if(size(L) == size(I))
LowRank = reshape(L(:,i),vidHeight,vidWidth);
%LowRank1 = reshape(L(:,i),vidHeight,vidWidth);
%LowRank = mat2gray(LowRank1);
%LowRank = im2uint8(LowRank);
else
LowRank = uint8(zeros(size(Input)));
end
if(size(S) == size(I))
Sparse = reshape(S(:,i),vidHeight,vidWidth);
%Sparse1 = reshape(S(:,i),vidHeight,vidWidth);
%Sparse = mat2gray(Sparse1);
%Sparse = im2uint8(Sparse);
else
Sparse = uint8(zeros(size(Input)));
end
if(~isempty(O))
Outlier = reshape(O(:,i),vidHeight,vidWidth);
%Outlier1 = reshape(O(:,i),vidHeight,vidWidth);
%Outlier = mat2gray(Outlier1);
%Outlier = im2uint8(Outlier);
%Outlier = medfilt2(Outlier, [5 5]);
else
Outlier = uint8(zeros(size(Input)));
end
subplot(2,3,1), imshow(Input,[]), title('Input (I)');
subplot(2,3,2), imshow(LowRank,[]), title('Low Rank (L)');
subplot(2,3,3), imshow(Sparse,[]), title('Sparse (S)');
subplot(2,3,4), imshow(Outlier,[]), title('Outliers (O)');
disp(i);
pause(0.01);
end
warning('on','all');
end