sustaining_gazes/matlab_version/face_validation/quantizeContinuous.m
Tadas Baltrusaitis 5959176921 Some big changes:
- face validator is a retrained CNN now
- starting retiring CLM-Z from OpenFace
2017-08-01 17:11:02 -04:00

12 lines
372 B
Matlab

function [quantized] = quantizeContinuous(values, min_v, max_v, num_bins)
step_size = (max_v - min_v) / num_bins;
bin_centres = min_v + step_size/2 : step_size : max_v;
bin_centres = repmat(bin_centres, numel(values),1);
values = repmat(values, 1, num_bins);
[~,quantized] = min(abs(values - bin_centres)');
quantized = quantized';
end