function normalized = normalize(drawing, x_sz, y_sz)
    s = size(drawing);
    left = 1;
    right = s(2);
    up = 1;
    down = s(1);
    count = 1;
    while (sum(drawing(count,:)) == 0)
        up = count;
        count = count + 1;
    end
    count = s(1);
    while (sum(drawing(count,:)) == 0)
        down = count;
        count = count - 1;
    end
    count = 1;
    while (sum(drawing(:, count)) == 0)
        left = count;
        count = count + 1;
    end
    
    count = s(2);
    while (sum(drawing(:, count)) == 0)
        right = count;
        count = count - 1;
    end
        
    %normalized = change_size(drawing(up:down, left:right), s(2), s(1));
    normalized = change_size(drawing(up:down, left:right), x_sz, y_sz);
end