Click4Ai

336.

Hard

### Object Detection Basics

In object detection, we want to identify the presence and location of objects within an image. This problem is a fundamental step in many applications such as self-driving cars, surveillance systems, and medical imaging.

**Example:** Given an image with a single object, we want to detect its presence and return its bounding box coordinates.

**Constraints:** The object is assumed to be a rectangle, and the image is a 2D array of pixel values.

### Solution

Write a function object_detection that takes an image and returns the object's bounding box coordinates (x, y, w, h) if detected, otherwise returns None.

Test Cases

Test Case 1
Input: [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
Expected: (1.0, 1.0, 2.0, 2.0)
Test Case 2
Input: [[0, 0, 0], [0, 1, 0], [0, 0, 0]]
Expected: None
+ 3 hidden test cases