def test_hog_channels_zhuramanan():
    n_cases = 3
    cell_size = np.random.randint(2, 10, [n_cases])
    channels = np.random.randint(1, 4, [n_cases])
    for i in range(n_cases):
        image = MaskedImage(np.random.randn(channels[i], 40, 40))
        win_width = np.random.randint(3 * cell_size[i], 40, 1)
        win_height = np.random.randint(3 * cell_size[i], 40, 1)
        hog_img = hog(image, mode='dense', algorithm='zhuramanan',
                      cell_size=cell_size[i],
                      window_height=win_height[0],
                      window_width=win_width[0],
                      window_unit='pixels', window_step_vertical=3,
                      window_step_horizontal=3,
                      window_step_unit='pixels', padding=True, verbose=True)
        length_per_block = 31
        n_blocks_horizontal = np.floor((win_width[0] / cell_size[i]) + 0.5) - 2
        n_blocks_vertical = 2 - np.floor((win_height[0] / cell_size[i]) + 0.5)
        n_channels = n_blocks_horizontal * n_blocks_vertical * length_per_block
        assert_allclose(hog_img.n_channels, n_channels)
dataset/ETHPy150Open menpo/menpo/menpo/feature/test/test_features.py/test_hog_channels_zhuramanan/swapped operands of `-`