function output = convertToSVM(input, x_sz, y_sz)
[inp_y, inp_x] = size(input);
output = zeros(y_sz, x_sz);
flperror = 0.001;

% conversion factors
conv_x = inp_x/x_sz;
conv_y = inp_y/y_sz;

for row=1:y_sz
    for col=1:x_sz
        x_min = floor((col-1)*conv_x)+1;
        x_max = floor(col*conv_x-flperror)+1;
        y_min = floor((row-1)*conv_y)+1;
        y_max = floor(row*conv_y-flperror)+1;
        output(row,col) = sum(sum(input(y_min:y_max,x_min:x_max)));
    end
end
end