Click4Ai

328.

Hard

HOG Features

**Problem:** Compute HOG features from an image.

Example:

Given an image, compute HOG features and return the descriptors.

Constraints:

  • Use the HOG algorithm to compute features.
  • Use NumPy to manipulate arrays.
  • Return descriptors as a single array.
  • **Note:** HOG features are often used in object detection and recognition tasks.

    Test Cases

    Test Case 1
    Input: [[1,2],[3,4]]
    Expected: [0.1, 0.2]
    Test Case 2
    Input: [[5,6],[7,8]]
    Expected: [0.3, 0.4]
    + 3 hidden test cases