Click4Ai

324.

Easy

Bounding Box Detection

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

**Problem:** Given an image and a list of bounding box coordinates, detect the objects within the image and return their bounding box coordinates.

Example:

Suppose we have an image of a car with two bounding boxes: one for the car itself and one for the license plate. We want to detect the objects within the image and return their bounding box coordinates.

Constraints:

  • The image is a 2D numpy array with pixel values between 0 and 255.
  • The bounding box coordinates are given as a list of tuples, where each tuple contains the x, y, width, and height of the box.
  • Solution:

    Implement a function that takes an image and a list of bounding box coordinates as input and returns the detected objects with their bounding box coordinates.

    Test Cases

    Test Case 1
    Input: [[[255, 255, 255], [255, 255, 255]], [[10, 10, 50, 50]]]
    Expected: [[[255, 255, 255], [255, 255, 255]], [[0, 0, 0, 0]]]
    Test Case 2
    Input: [[[0, 0, 0], [0, 0, 0]], [[100, 100, 200, 200]]]
    Expected: [[[0, 0, 0], [0, 0, 0]], [[0, 0, 0, 0]]]
    + 3 hidden test cases