Click4Ai

327.

Hard

SIFT Features

**Problem:** Extract SIFT features from an image.

Example:

Given an image, extract SIFT features and return the keypoints and descriptors.

Constraints:

  • Use the SIFT algorithm to extract features.
  • Use NumPy to manipulate arrays.
  • Return keypoints and descriptors as separate arrays.
  • **Note:** SIFT features are scale-invariant and rotation-invariant.

    Test Cases

    Test Case 1
    Input: image.jpg
    Expected: [[1.0, 2.0], [3.0, 4.0]]
    Test Case 2
    Input: image2.jpg
    Expected: [[5.0, 6.0], [7.0, 8.0]]
    + 3 hidden test cases