def test_windowiterator_hog_no_padding():
    n_cases = 5
    image_width = np.random.randint(50, 250, [n_cases, 1])
    image_height = np.random.randint(50, 250, [n_cases, 1])
    window_step_horizontal = np.random.randint(1, 10, [n_cases, 1])
    window_step_vertical = np.random.randint(1, 10, [n_cases, 1])
    window_width = np.random.randint(3, 20, [n_cases, 1])
    window_height = np.random.randint(3, 20, [n_cases, 1])
    for i in range(n_cases):
        image = MaskedImage(np.random.randn(1, image_height[i, 0],
                                            image_width[i, 0]))
        hog_img = hog(image, mode='dense', cell_size=3, block_size=1,
                      window_height=window_height[i, 0],
                      window_width=window_width[i, 0], window_unit='pixels',
                      window_step_vertical=window_step_vertical[i, 0],
                      window_step_horizontal=window_step_horizontal[i, 0],
                      window_step_unit='pixels', padding=False)
        n_windows_horizontal = len(range(window_width[i, 0] - 1,
                                         image_width[i, 0],
                                         window_step_horizontal[i, 0]))
        n_windows_vertical = len(range(1 - window_height[i, 0],
                                       image_height[i, 0],
                                       window_step_vertical[i, 0]))
        assert_allclose(hog_img.shape, (n_windows_vertical,
                                        n_windows_horizontal))
dataset/ETHPy150Open menpo/menpo/menpo/feature/test/test_features.py/test_windowiterator_hog_no_padding/swapped operands of `-`