From 4f3731c3ea796c4a2277dd3581a5509904cbcb41 Mon Sep 17 00:00:00 2001 From: Joel Sole Date: Wed, 12 May 2021 16:29:18 +0200 Subject: [PATCH] Output video scores on a json file --- src/video_band_detect.m | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/video_band_detect.m b/src/video_band_detect.m index ef294a1..0637da2 100644 --- a/src/video_band_detect.m +++ b/src/video_band_detect.m @@ -43,12 +43,7 @@ result_dir = 'result_banding_detect'; lib_dir = 'lib'; % video parameters -% if different framerates, should store in array [30,25,25,24..] and modify the -% call of video_framerate in Main Body to video_framerate(i)~ -vid_framerate = 30; -vid_width = 1280; -vid_height = 720; -% set frame sampling step. 15 means 1/15frames +% set frame sampling step (15 means 1 out of every 15 frames) sampling_step = 15; % choose which metric to evaluate: 'BBAD', 'FCDR' eval_flags = { 'BBAD' }; @@ -72,6 +67,8 @@ % video level banding score banding_score_BBAD_V = zeros(1, length(test_seqs)); +json_BBAD_V = cell(1, length(test_seqs)); + % frame level banding score banding_score_BBAD_I_frames = cell(1, length(test_seqs)); @@ -155,4 +152,10 @@ im_prev_frame = im; end banding_score_BBAD_V(1,i) = mean(banding_score_BBAD_I_frames{1,i}); + json_BBAD_V{1,i} = struct('input_file', name, 'BBAND', banding_score_BBAD_V(1,i)); end +s.all_scores = json_BBAD_V; +fileID = fopen('bband_results.json', 'w'); +fprintf(fileID, jsonencode(s)); +fclose(fileID); +