Closed AnjieCheng closed 2 years ago
Hi. This is a Matlab-implementation of the smoothness metric:
function S = video_smoothness( test_vid, ref_vid, fps )
if nargin < 3
fps = 30;
end
freq_cutoff = 0.15; % [s] - this should remove less visible temporal frequencies
sigma = fps*freq_cutoff;
test_hp = get_hp(test_vid);
ref_hp = get_hp(ref_vid);
S = mean( ref_hp(:) ) / mean( test_hp(:) );
function vid_hp = get_hp( vid )
k_size = round(ceil( sigma*5 )/2)*2;
xx = linspace( -k_size/2, k_size/2, k_size+1 );
gauss_kernel = exp( -xx.^2 / (2*sigma^2) );
gauss_kernel = gauss_kernel/sum(gauss_kernel);
vid_lp = filtfilt( gauss_kernel, 1, vid );
vid_hp = sqrt(mean((vid - vid_lp).^2,1));
end
end
Thank you! That helps a lot.
Hi, thanks for sharing this awesome work!
I'm interested in the smoothness metric mentioned in your CVPR'19 paper. If you don't mind, could you share the implementation details or short code snippets for Eq. 9?
Thank you!