-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinpaintingFrucVideoWithAverageStart.m
35 lines (35 loc) · 1.2 KB
/
inpaintingFrucVideoWithAverageStart.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
function [ new , mses, psnrs] = inpaintingFrucVideoWithAverageStart( original, fps, comparison, frames_mask)
[height,width,original_frame_rate] = size(original);
frames = 2*original_frame_rate;
corrupted = averageFRUC(original);
mask = zeros(height,width,frames);
%Copy the original frames to the new video
for i=2:2:frames
mask(:,:,i) = 1;
end
prev = corrupted;
ycbcr_image = ones( height, width, 3, 'uint8' );
mov_struct = struct( 'cdata', ycbcr_image, 'colormap', [] );
for i=1:1:frames,
mov(i) = mov_struct;
end
itr = 2;
[mses(1),psnrs(1)] = errorsVideos(comparison, prev, frames_mask);
figure;
hold on;
line = plot(0,mses);
loc = 2;
for i=47*itr:1:49*itr,
%disp(i);
res = hevc_x265_video_compression_decompression(uint8(prev), mov,51 - floor(i/itr), 'inpaintedMovie',fps,frames);
prev = (uint8(res) .* uint8(mask)) + (uint8(corrupted).*uint8(1-mask));
[mses(loc),psnrs(loc)] = errorsVideos(comparison, prev, frames_mask);
loc = loc + 1;
delete(line);
line = plot(0:1:length(mses)-1,mses);
drawnow();
end
new = prev;
figure;
plot(0:1:length(psnrs)-1,psnrs);
end