Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/video_band_detect.m
Original file line number Diff line number Diff line change
Expand Up @@ -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' };
Expand All @@ -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));

Expand Down Expand Up @@ -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));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also fclose(fileID) to avoid file handle leaks

fclose(fileID);