-
Notifications
You must be signed in to change notification settings - Fork 1
/
FRStsFullMap.m
45 lines (45 loc) · 1.72 KB
/
FRStsFullMap.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
function score = FRStsFullMap(refName, disName, height, width)
refFrames = Yuv2Frame(refName, height, width);
disFrames = Yuv2Frame(disName, height, width);
len_frame = min(size(refFrames, 3), size(disFrames, 3));
if (mod(len_frame, 2) ~= 0)
len_frame = len_frame - 1;
end
refFrames = refFrames(:, :, 1:len_frame);
disFrames = disFrames(:, :, 1:len_frame);
sigma = [3.5, 3.7, 3.9];
window_size = 5;
spatial_scale = 1;
temporal_scale = 1;
num_map = 5;
score = [];
frame_score = zeros(len_frame, 7);
count = 1;
for index_frame = 1:2:len_frame - 1
refCur = refFrames(:, :, index_frame);
disCur = disFrames(:, :, index_frame);
ref_diff = refFrames(:, :, index_frame + 1) - refCur;
dis_diff = disFrames(:, :, index_frame + 1) - disCur;
frame_score(count, :) = [getSpatialScore(refCur, disCur, spatial_scale), method_2D(ref_diff, dis_diff)];
count = count + 1;
end
score = [score, mean(frame_score(1:count - 1, :), 1);
frame_score = zeros(height, num_map);
count = 1;
for index_height = 1:2:height
refCur = reshape(refFrames(index_height, :, :), [width, len_frame])';
disCur = reshape(disFrames(index_height, :, :), [width, len_frame])';
frame_score(count, :) = getTemporalScore(refCur, disCur, temporal_scale);
count = count + 1;
end
score = [score, mean(frame_score(1:count - 1, :), 1)];
frame_score = zeros(width, num_map);
count = 1;
for index_width = 1:2:width
refCur = reshape(refFrames(:, index_width, :), [height, len_frame])';
disCur = reshape(disFrames(:, index_width, :), [height, len_frame])';
frame_score(count, :) = getTemporalScore(refCur, disCur, temporal_scale);
count = count + 1;
end
score = [score, mean(frame_score(1:count - 1, :), 1)];
end