code: def test_hog_orientations_circle():
      # scenario:
      #  1) create image with blurred circle in the middle
      #  2) calculate feature.hog()
      #  3) verify that the resulting feature vector contains uniformly
      #     distributed values for all orientations, i.e. no orientation is
      #     lost or emphasized
      #  4) repeat the scenario for other 'orientations' option
  
      # size of testing image
      width = height = 100
  
      image = np.zeros((height, width))
      rr, cc = draw.disk(
          (int(height / 2), int(width / 2)), int(width / 3)
      )
      image[rr, cc] = 100
      image = filters.gaussian(image, 2, mode="reflect")
  
      for orientations in range(2, 15):
          (hog, hog_img) = feature.hog(
              image,
              orientations=orientations,
              pixels_per_cell=(8, 8),
              cells_per_block=(1, 1),
              visualize=True,
              transform_sqrt=False,
              block_norm="L1",
          )
  
          # set to True to enable manual debugging with graphical output,
          # must be False for automatic testing
          if False:
              import matplotlib.pyplot as plt
  
              plt.figure()
              plt.subplot(1, 2, 1)
              plt.imshow(image)
              plt.colorbar()
              plt.title("image_float")
              plt.subplot(1, 2, 2)
              plt.imshow(hog_img)
              plt.colorbar()
              plt.title(
                  "HOG result visualisation, "
                  f"orientations={orientations}"
              )
              plt.show()
  
          # reshape resulting feature vector to matrix with N columns (each
          # column corresponds to one direction),
          hog_matrix = hog.reshape(-1, orientations)
  
          # compute mean values in the resulting feature vector for each
          # direction, these values should be almost equal to the global mean
          # value (since the image contains a circle), i.e., all directions have
          # same contribution to the result
          actual = np.mean(hog_matrix, axis=0)
          desired = np.mean(hog_matrix)
          assert_almost_equal(actual, desired, decimal=1)
  
file_path: scikit-image/skimage/feature/tests/test_hog.py
imports: import numpy
  import pytest
  from numpy.testing import assert_almost_equal
  from skimage import color, data, draw, feature, img_as_float
  from skimage._shared import filters
  from skimage._shared.testing import fetch
  from skimage._shared.utils import _supported_float_type
label_desc: Use image node_id 7 for calling a global function with example usage: test_hog_orientations_circle() without return types