Click4Ai

347.

Medium

Face Detection

=====================

In this problem, you will implement the face detection algorithm, which is a technique used in computer vision to detect faces in an image. This is achieved by using a Haar cascade classifier to detect the edges of a face.

Example:

Suppose we have an image of a person with a face. We want to detect the face in the image.

Constraints:

  • The input image should be a grayscale image.
  • The output should be a rectangle bounding the face.
  • The face detection algorithm should be implemented using a Haar cascade classifier.
  • Test Cases

    Test Case 1
    Input: ['image.jpg']
    Expected: [[10, 10, 50, 50]]
    Test Case 2
    Input: ['image2.jpg']
    Expected: [[20, 20, 100, 100]]
    + 3 hidden test cases